net.sf.basedb.clients.jobagent
Class AgentSignalReceiver
java.lang.Object
net.sf.basedb.core.signal.AbstractSignalReceiver
net.sf.basedb.core.signal.SocketSignalReceiver
net.sf.basedb.clients.jobagent.AgentSignalReceiver
- All Implemented Interfaces:
- SignalReceiver
public class AgentSignalReceiver
- extends SocketSignalReceiver
Signal receiver implementation for job agents that is compatible with
the SocketSignalReceiver
. This implementation will however not
open a port of it's own, but uses the regular job agent control port.
Incoming signals will first be handled by a SignalRequestHandler
which forwards signals to this class by calling processSignalMessage(String)
.
- Version:
- 2.6
- Author:
- nicklas
- Last modified
- $Date: 2008-09-11 22:05:50 +0200 (Thu, 11 Sep 2008) $
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
agent
private final Agent agent
AgentSignalReceiver
public AgentSignalReceiver(Agent agent)
init
public void init(String params)
- Initialise the receiver. No parameters are needed.
Port number will be taken from job agent configuration.
- Specified by:
init
in interface SignalReceiver
- Overrides:
init
in class SocketSignalReceiver
- Parameters:
params
- The ID of the signal receiver, needed if the default
ID generation should be used
listenOnSocket
protected void listenOnSocket()
- Do not open any socket. Signals will be sent to a
JobAgentServerConnection
and routed to this class via a SignalRequestHandler
.
- Overrides:
listenOnSocket
in class SocketSignalReceiver
processSignalMessage
public void processSignalMessage(String message)
- Make this method public so
SignalRequestHandler
can call it.
- Overrides:
processSignalMessage
in class SocketSignalReceiver
- Parameters:
message
- The message to process, the format of the message
must be compatible with the message that AbstractSignalTransporter.generateSignalMessage(Signal)
generates