public interface Request<M>
Modifier and Type | Method and Description |
---|---|
void |
fail(FailureType type,
DriverState state,
java.lang.Exception ex)
Called if the response to the most recently created message is not going to be received.
|
java.lang.Object |
getKey() |
RequestPriority |
getPriority()
Returns the
RequestPriority of this request. |
int |
getTimeout()
Returns the amount of time (in milliseconds) that this request should be given to run, before it is failed out
for a timeout.
|
boolean |
isRetryAllowed() |
ReceiveAction |
receiveMessage(M message,
java.lang.Object key)
Called when a response message is received for this Request.
|
boolean |
sendMessage()
Creates and puts the
Request s message "on the wire". |
boolean sendMessage()
Request
s message "on the wire". Each call should send a unique message
(different transaction ID, if applicable), in case the request is re-used.java.lang.Object getKey()
Request
.ReceiveAction receiveMessage(M message, java.lang.Object key)
ReadItem
s or WriteItem
s that it contains (if applicable).
If you are extending from AbstractSocketDriver
you must do this work on the thread this call arrived on
or risk the byte[] message being returned its pool and reused in the middle of processing it.message
- The message that was received for this Request.key
- The key used to retrieve this Request.ReceiveAction
that indicates what the driver should do with this request.void fail(FailureType type, DriverState state, java.lang.Exception ex)
int getTimeout()
boolean isRetryAllowed()
true
if retrying is allowed if sendMessage()
returns false
.RequestPriority getPriority()
RequestPriority
of this request.RequestPriority
of this request.