T
- This type identifier specifies the type of data which may be passed
to the deferrable object via the
onCallback
method.U
- This type identified specifies the type of data which will be
returned by either the onCallback
or onErrback
method.public interface Deferrable<T,U>
U onCallback(Deferred<T> deferred, T data) throws java.lang.Exception
deferred
- This is the deferred event object through which the callback was
issued.data
- This is a data object of type T
which encapsulates
any information being passed back as a result of the deferred
event.U
which will be
propagated to the next deferrable in the chain as the
onCallback
data parameter.java.lang.Exception
- Exceptions thrown by callback handlers are propagated to the next
deferrable in the chain as the
onErrback
error
parameter.U onErrback(Deferred<T> deferred, java.lang.Exception error) throws java.lang.Exception
deferred
- This is the deferred event object through which the error callback
was issued.error
- This is the Exception object which has been caught on task
failure. It contains information about the cause of the error. It
can be either handled locally or re-thrown to pass it up the
callback chain.U
which will be
propagated to the next deferrable in the chain as the
onCallback
data parameter.java.lang.Exception
- Exceptions thrown by error callback handlers are propagated to
the next deferrable in the chain as the
onErrback
error
parameter.