2.17.2: 2011-06-17

net.sf.basedb.clients.jobagent
Class AgentSignalReceiver

java.lang.Object
  extended by net.sf.basedb.core.signal.AbstractSignalReceiver
      extended by net.sf.basedb.core.signal.SocketSignalReceiver
          extended by 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) $

Field Summary
private  Agent agent
           
 
Constructor Summary
AgentSignalReceiver(Agent agent)
           
 
Method Summary
 void init(String params)
          Initialise the receiver.
protected  void listenOnSocket()
          Do not open any socket.
 void processSignalMessage(String message)
          Make this method public so SignalRequestHandler can call it.
 
Methods inherited from class net.sf.basedb.core.signal.SocketSignalReceiver
close, forwardSignalMessageIfNeeded, getGlobalSignalId, getSignalTransporterClass, isAllowedHost, parseInitParameters
 
Methods inherited from class net.sf.basedb.core.signal.AbstractSignalReceiver
getLocalSignalHandlerId, getReceiverId, getSignalHandler, registerSignalHandler, sendToAll, sendToAll, unregisterSignalHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent

private final Agent agent
Constructor Detail

AgentSignalReceiver

public AgentSignalReceiver(Agent agent)
Method Detail

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

2.17.2: 2011-06-17