|
JBoss Remoting 3.0.0.Beta2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
O
- the reply typepublic interface RequestContext<O>
The context of a single request. A request listener is obligated to call exactly one of the three send
methods
specified in this interface.
Method Summary | |
---|---|
void |
addCancelHandler(RequestCancelHandler<O> handler)
Add a notifier to be called if a cancel request is received. |
void |
execute(Runnable command)
Execute a task in the context of this request. |
ClientContext |
getContext()
Get the context that the request came in on. |
boolean |
isCancelled()
Determine whether the current request was cancelled. |
void |
sendCancelled()
Send a cancellation message back to the client. |
void |
sendFailure(String msg,
Throwable cause)
Send a failure message back to the caller. |
void |
sendReply(O reply)
Send a reply back to the caller. |
Method Detail |
---|
ClientContext getContext()
boolean isCancelled()
true
if the request was cancelledvoid sendReply(O reply) throws IOException, IllegalStateException
IOException
is thrown from this method
and a reply is sent back to the client which will trigger a RemoteReplyException
to be thrown. If the
client connection is interrupted in such a way that the reply cannot reach the client, the client will (eventually)
receive an IndeterminateOutcomeException
.
reply
- the reply to send
IOException
- if the transmission failed
IllegalStateException
- if this or another of the sendXXX()
methods was already invoked for this requestvoid sendFailure(String msg, Throwable cause) throws IOException, IllegalStateException
RemoteExecutionException
with the message initialized to msg
and the cause initialized to
cause
. If the transmission fails, an IOException
is thrown from this
method and the client will (eventually) receive an IndeterminateOutcomeException
.
msg
- a message describing the failure, if any (can be null
)cause
- the failure cause, if any (can be null
)
IOException
- if the transmission failed
IllegalStateException
- if this or another of the sendXXX()
methods was already invoked for this requestvoid sendCancelled() throws IOException, IllegalStateException
IOException
is thrown from this
method and the client will (eventually) receive an IndeterminateOutcomeException
.
IOException
- if the message could not be sent (the client could not be notified about the cancellation)
IllegalStateException
- if this or another of the sendXXX()
methods was already invoked for this requestvoid addCancelHandler(RequestCancelHandler<O> handler)
handler
- the cancel handlervoid execute(Runnable command) throws RejectedExecutionException
execute
in interface Executor
command
- the task to execute
RejectedExecutionException
|
JBoss Remoting 3.0.0.Beta2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |