Class ClientFuture<V>
java.lang.Object
org.apache.qpid.protonj2.client.futures.ClientFuture<V>
- Type Parameters:
- V- the eventual result type for this Future
- All Implemented Interfaces:
- Future<V>,- AsyncResult<V>
- Direct Known Subclasses:
- BalancedClientFuture,- ConservativeClientFuture,- ProgressiveClientFuture
Asynchronous Client Future class.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected ExecutionExceptionprotected static final intprotected static final intprotected Vprotected static final AtomicIntegerFieldUpdater<ClientFuture>protected static final intprotected final ClientSynchronization<V>protected int
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancancel(boolean mayInterruptIfRunning) voidIf the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.voidfailed(ClientException result) If the operation fails this method is invoked with the Exception that caused the failure.abstract Vget()abstract Vprotected intgetState()booleanbooleanReturns true if the AsyncResult has completed.booleanisDone()booleanisFailed()protected booleanprotected voidTODO - Provide hook to run on the event loop to do whatever it means to cancel this task and update the task state in a thread safe manner.
- 
Field Details- 
synchronization
- 
INCOMPLETEprotected static final int INCOMPLETE- See Also:
 
- 
COMPLETINGprotected static final int COMPLETING- See Also:
 
- 
SUCCESSprotected static final int SUCCESS- See Also:
 
- 
FAILUREprotected static final int FAILURE- See Also:
 
- 
CANCELLEDprotected static final int CANCELLED- See Also:
 
- 
STATE_FIELD_UPDATER
- 
error
- 
waitingprotected int waiting
- 
result
 
- 
- 
Constructor Details- 
ClientFuture
 
- 
- 
Method Details- 
cancelpublic boolean cancel(boolean mayInterruptIfRunning) 
- 
isFailedpublic boolean isFailed()- Returns:
- true if the Futureoperation failed.
 
- 
getResult- Returns:
- the resulting value of the operation upon successful completion.
 
- 
isCancelledpublic boolean isCancelled()- Specified by:
- isCancelledin interface- Future<V>
 
- 
isDonepublic boolean isDone()
- 
isCompletepublic boolean isComplete()Description copied from interface:AsyncResultReturns true if the AsyncResult has completed. The task is considered complete regardless if it succeeded or failed.- Specified by:
- isCompletein interface- AsyncResult<V>
- Returns:
- returns true if the asynchronous operation has completed.
 
- 
isNotCompleteprotected boolean isNotComplete()
- 
getStateprotected int getState()- Returns:
- the current ClientFuturestate as if this call.
 
- 
failedDescription copied from interface:AsyncResultIf the operation fails this method is invoked with the Exception that caused the failure.- Specified by:
- failedin interface- AsyncResult<V>
- Parameters:
- result- The error that resulted in this asynchronous operation failing.
 
- 
completeDescription copied from interface:AsyncResultIf the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.- Specified by:
- completein interface- AsyncResult<V>
- Parameters:
- result- the object that completes the future.
 
- 
get- Specified by:
- getin interface- Future<V>
- Throws:
- InterruptedException
- ExecutionException
 
- 
getpublic abstract V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
- getin interface- Future<V>
- Throws:
- InterruptedException
- ExecutionException
- TimeoutException
 
- 
tryCancelTaskprotected void tryCancelTask()TODO - Provide hook to run on the event loop to do whatever it means to cancel this task and update the task state in a thread safe manner.
 
-