|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - This type parameter specifies the type of the data object which will
be passed each time the signal is triggered.public interface Signal<T>
Defines the signal event interface. This provides the user API for
manipulating signal event objects. Signal event objects can only be created
by using the newSignal method on the
Reactor interface.
| Method Summary | |
|---|---|
Signal<T> |
makeRestricted()
Convert the signal interface to restricted capability. |
void |
signal(T data)
Sends a signal event notification. |
void |
signalFinalize(T data)
Sends a finalising signal event notification. |
void |
subscribe(Signalable<T> signalable)
Subscribes a new signalable object. |
void |
unsubscribe(Signalable<T> signalable)
Unsubscribes a signalable object. |
| Method Detail |
|---|
void subscribe(Signalable<T> signalable)
throws SignalContextException,
ReactorNotRunningException
signalable - This is the signalable object which is being subscribed.
SignalContextException - This runtime exception is thrown if there is an attempt to
subscribe a new signalable object from the context of a signal
event callback.
ReactorNotRunningException - This exception is thrown when attempt is made to subscribe to a
signal when the reactor is not running.
void unsubscribe(Signalable<T> signalable)
throws SignalContextException,
ReactorNotRunningException
signalable - This is the signalable object which is being unsubscribed.
SignalContextException - This runtime exception is thrown if there is an attempt to
unsubscribe a signalable object from the context of a signal
event callback.
ReactorNotRunningException - This exception is thrown when attempt is made to unsubscribe from
a signal when the reactor is not running.
void signal(T data)
throws RestrictedCapabilityException,
ReactorNotRunningException
data - This is the signal data parameter which will be passed to each
subscribed signalable object in turn. It is good practice to make
this parameter object immutable.
RestrictedCapabilityException - This exception is thrown if an attempt is made to call this
method on a signal event object reference with restricted
capability.
ReactorNotRunningException - This exception is thrown if an attempt is made to signal an event
when the reactor is not running.
void signalFinalize(T data)
throws RestrictedCapabilityException,
ReactorNotRunningException
data - This is the signal data parameter which will be passed to each
subscribed signalable object in turn. It is good practice to make
this parameter object immutable.
RestrictedCapabilityException - This exception is thrown if an attempt is made to call this
method on a signal event object reference with restricted
capability.
ReactorNotRunningException - This exception is thrown if an attempt is made to signal an event
when the reactor is not running.Signal<T> makeRestricted()
signal and signalFinalize methods are protected from unauthorised use.
Signal interface with
restricted capability.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||