|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
T - This type parameter specifies the type of data which will be emitted
by the deferred event object at the end of the current callback
chain.public interface Deferred<T>
Defines the deferred event interface. This is the public interface to the deferred event objects implemented by the Reaction framework. Deferred event objects are used to manage callback chains comprising multiple deferrable objects.
| Method Summary | ||
|---|---|---|
|
addDeferrable(Deferrable<T,U> deferrable,
boolean terminal)
Attaches a deferrable object to the deferred event. |
|
void |
callback(T data)
Issues a deferred callback. |
|
void |
cancelTimeout()
Cancels the timeout associated with the deferred event. |
|
void |
discard()
Discards the deferred event. |
|
void |
errback(java.lang.Exception error)
Issues an error callback. |
|
Deferred<T> |
makeRestricted()
Convert the deferred interface to restricted capability. |
|
void |
setTimeout(int msTimeout)
Sets the timeout associated with the deferred event. |
|
| Method Detail |
|---|
void callback(T data)
throws RestrictedCapabilityException,
DeferredTriggeredException
ReactorNotRunningException instead.
data - This parameter is a data object of type T which is
used to pass data back to the deferrable object.
RestrictedCapabilityException - This runtime exception is thrown if an attempt is made to call
this method on a deferred event object reference with restricted
capability.
DeferredTriggeredException - This runtime exception is raised if the deferred event has
already been triggered via the callback
or errback methods.
void errback(java.lang.Exception error)
throws RestrictedCapabilityException,
DeferredTriggeredException
ReactorNotRunningException instead.
error - The error parameter passes an exception object which can be used
to identify the error condition.
RestrictedCapabilityException - This exception is thrown if an attempt is made to call this
method on a deferred event object reference with restricted
capability.
DeferredTriggeredException - This runtime exception is raised if the deferred event has
already been triggered via the callback
or errback methods.
<U> Deferred<U> addDeferrable(Deferrable<T,U> deferrable,
boolean terminal)
throws DeferredTerminationException
U - This type parameter specifies the data type which is returned by
the onCallback and
onErrback
methods of the deferrable object which is being added to the
callback chain.deferrable - This is the deferrable object which is to be added to the callback
chain. It may be a link deferrable or a terminal deferrable,
depending on the state of the terminal parameter.terminal - This flag is set to indicate that this deferrable should terminate
the callback chain. Once a terminal deferrable has been added no
further deferrables can be added.
DeferredTerminationException - This runtime exception is raised if the deferred callback chain
has already been terminated by adding a terminal deferrable.
void setTimeout(int msTimeout)
throws ReactorNotRunningException
DeferredTimedOutException as the parameter. By default no timeout
is set. If this function is called multiple times, the most recently
requested timeout is used. A timeout value of zero or less may be used to
force an immediate timeout.
msTimeout - This is the timeout to be used by the deferred event, specified as
an integer number of milliseconds.
ReactorNotRunningException - This exception is thrown if an attempt is made to set a deferred
timeout when the reactor is not running.void cancelTimeout()
void discard()
DeferredTerminationException - This runtime exception is raised if the deferred callback chain
has already been terminated by adding a terminal deferrable.Deferred<T> makeRestricted()
callback and errback
methods are protected from unauthorised use.
Deferred interface with
restricted capability.
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||