RequestFuture
, java.util.concurrent.Future<Message>
protected class ClusterProtocolImpl.RequestFutureWrapper extends java.lang.Object implements RequestFuture
Constructor | Description |
---|---|
RequestFutureWrapper(RequestFuture rqFuture,
Protocol protocol) |
Modifier and Type | Method | Description |
---|---|---|
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.
|
public RequestFutureWrapper(RequestFuture rqFuture, Protocol protocol)
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 java.util.concurrent.Future<Message>
isDone
in interface RequestFuture
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 java.util.concurrent.Future<Message>
cancel
in interface RequestFuture
mayInterruptIfRunning
- not usedpublic Message get() throws java.lang.InterruptedException
RequestFuture
get
in interface java.util.concurrent.Future<Message>
get
in interface RequestFuture
java.lang.InterruptedException
- if thread is interruptedpublic Message get(long timeout) throws java.lang.InterruptedException
RequestFuture
get
in interface RequestFuture
timeout
- timeout in millisecondsjava.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 java.util.concurrent.Future<Message>
get
in interface RequestFuture
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentjava.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 millisecondsjava.lang.InterruptedException
- if thread is interruptedRequestFuture.get(long, TimeUnit)
,
TimeUnit.MILLISECONDS
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.