|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.genesyslab.platform.clusterprotocol.ClusterProtocolImpl.RequestFutureWrapper
protected class ClusterProtocolImpl.RequestFutureWrapper
Constructor Summary | |
---|---|
ClusterProtocolImpl.RequestFutureWrapper(RequestFuture rqFuture,
Protocol protocol)
|
Method Summary | |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Marks this request as canceled and notifies all waiting threads on it. |
Message |
get()
Waits if necessary for the request to complete, and then returns its result. |
Message |
get(long timeout)
Waits if necessary for at most the given time for the request to complete, and then returns its result, if available. |
Message |
get(long timeout,
java.util.concurrent.TimeUnit unit)
Waits if necessary for at most the given time for the request to complete, and then returns its result, if available. |
Message |
getRequest()
Returns original request message. |
Message |
getResponse()
Waits if necessary for the request to complete, and then returns its result. |
Message |
getResponse(long timeout)
Waits if necessary for at most the given time for the request to complete, and then returns its result, if available. |
boolean |
isCanceled()
Returns true if this task was canceled before it completed normally. |
boolean |
isCancelled()
|
boolean |
isDone()
Returns true if this request completed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClusterProtocolImpl.RequestFutureWrapper(RequestFuture rqFuture, Protocol protocol)
Method Detail |
---|
public boolean isCancelled()
isCancelled
in interface java.util.concurrent.Future<Message>
public Message getRequest()
RequestFuture
getRequest
in interface RequestFuture
public boolean isDone()
RequestFuture
beginRequest()
by default.
isDone
in interface RequestFuture
isDone
in interface java.util.concurrent.Future<Message>
public boolean cancel(boolean mayInterruptIfRunning)
RequestFuture
mayInterruptIfRunning
has no effect here because
real request execution is been done on server side and communication
protocols usually do not support cancellation queries.
cancel
in interface RequestFuture
cancel
in interface java.util.concurrent.Future<Message>
mayInterruptIfRunning
- not used
public Message get() throws java.lang.InterruptedException
RequestFuture
get
in interface RequestFuture
get
in interface java.util.concurrent.Future<Message>
java.lang.InterruptedException
- if thread is interruptedpublic Message get(long timeout) throws java.lang.InterruptedException
RequestFuture
get
in interface RequestFuture
timeout
- timeout in milliseconds
java.lang.InterruptedException
- if thread is interruptedRequestFuture.get(long, TimeUnit)
,
TimeUnit.MILLISECONDS
public Message get(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
RequestFuture
get
in interface RequestFuture
get
in interface java.util.concurrent.Future<Message>
timeout
- the maximum time to waitunit
- the time unit of the timeout argument
java.lang.InterruptedException
- if thread is interruptedRequestFuture.get(long, TimeUnit)
,
TimeUnit.MILLISECONDS
public boolean isCanceled()
RequestFuture
isCanceled
in interface RequestFuture
Future.isCancelled()
public Message getResponse() throws java.lang.InterruptedException
RequestFuture
getResponse
in interface RequestFuture
java.lang.InterruptedException
- if thread is interruptedRequestFuture.get()
public Message getResponse(long timeout) throws java.lang.InterruptedException
RequestFuture
getResponse
in interface RequestFuture
timeout
- timeout in milliseconds
java.lang.InterruptedException
- if thread is interruptedRequestFuture.get(long, TimeUnit)
,
TimeUnit.MILLISECONDS
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |