public interface Response
AsyncRequestHandler.handle(org.jgroups.Message,Response)
.
Encapsulates information needed to send a response, e.g. the request ID, the sender etc.Modifier and Type | Method and Description |
---|---|
void |
send(Message reply,
boolean is_exception)
Similar to
send(Object,boolean) , but passes a message instead of an object. |
void |
send(java.lang.Object reply,
boolean is_exception)
Sends a response, usually called from a thread spawned by
AsyncRequestHandler.handle(org.jgroups.Message,Response) |
void send(java.lang.Object reply, boolean is_exception)
AsyncRequestHandler.handle(org.jgroups.Message,Response)
reply
- The reply to be sent back, ie. as result to a synchronous RPC. Can be null, e.g.
when the method has a void return type.is_exception
- If AsyncRequestHandler.handle(org.jgroups.Message,Response)
threw an exception,
it must be caught, returned as the reply and is_exception must be true. If reply is a regular
object, is_exception is falsevoid send(Message reply, boolean is_exception)
send(Object,boolean)
, but passes a message instead of an object. The message needs to contain
the marshalled response, so message creation, setting of flags and marshalling is the responsibility of the caller.
The reason for this additional method is to give the caller more control over the response message.
This method may be removed, should we find that it's not really neededreply
- The reply messageis_exception
- Whether the payload of this message is an exception or a real reply objectCopyright © 1998-2020 Red Hat. All Rights Reserved.