2.17.2: 2011-06-17

net.sf.basedb.core.signal
Interface SignalTransporter

All Known Implementing Classes:
AbstractSignalTransporter, Job.JobSignalTransporter, LocalSignalTransporter, SocketSignalTransporter

public interface SignalTransporter

A signal transporter is a class that knows how to send a signal to a specific SignalReceiver implementation. Implementing classes must have a public no-argument constructor. Before signals can be sent with the transporter the init(String) method is called with the same string as returned by the SignalReceiver.registerSignalHandler(SignalHandler) method. This string should contain enough information to let the transporter send the signal to the correct signal handler on the correct signal receiver. The format of this string is implementation-specific and needs only to be known by the coupled transporter and receiver classes. As an example, the SocketSignalReceiver and SocketSignalTransporter uses a URI that contains the IP number and port of the receiver and an ID for identifying the signal handler.

Signal transporters need not be thread safe since a new instance is created for each signal that is going to be sent.

Version:
2.6
Author:
nicklas
Last modified
$Date: 2008-09-11 22:09:17 +0200 (Thu, 11 Sep 2008) $

Method Summary
 Collection<Signal> getSupportedSignals()
          Get a collection containing the signals supported, by the signal handler.
 void init(String params)
          Initialise the signal transporter.
 void send(Signal signal)
          Send a signal.
 

Method Detail

init

void init(String params)
Initialise the signal transporter. The parameter is the same as returned by SignalReceiver.registerSignalHandler(SignalHandler) and should contain information that the transporter can parse and use for contacting the correct signal receiver and to send signals to the registered signal handler.

Parameters:
params - The initialisation string

getSupportedSignals

Collection<Signal> getSupportedSignals()
Get a collection containing the signals supported, by the signal handler. A null return value means that the transporter just doesn't know about which signals are supported and which are not.

Returns:
A collections with the signals, or null

send

void send(Signal signal)
Send a signal.

Parameters:
signal - The signal to send, must not be null

2.17.2: 2011-06-17