Package org.apache.qpid.jms.provider
Class ProviderFuture
java.lang.Object
org.apache.qpid.jms.provider.ProviderFuture
- All Implemented Interfaces:
AsyncResult
- Direct Known Subclasses:
BalancedProviderFuture,ConservativeProviderFuture,ProgressiveProviderFuture
Asynchronous Provider Future class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected ProviderExceptionprotected static final intprotected static final intprotected static final AtomicIntegerFieldUpdater<ProviderFuture>protected static final intprotected final ProviderSynchronizationprotected int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanReturns true if the AsyncResult has completed.voidonFailure(ProviderException result) If the operation fails this method is invoked with the Exception that caused the failure.voidIf the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.abstract voidsync()Waits for a response to some Provider requested operation.abstract booleanTimed wait for a response to a Provider operation.
-
Field Details
-
synchronization
-
INCOMPLETE
protected static final int INCOMPLETE- See Also:
-
COMPLETING
protected static final int COMPLETING- See Also:
-
SUCCESS
protected static final int SUCCESS- See Also:
-
FAILURE
protected static final int FAILURE- See Also:
-
STATE_FIELD_UPDATER
-
error
-
waiting
protected int waiting
-
-
Constructor Details
-
ProviderFuture
public ProviderFuture() -
ProviderFuture
-
-
Method Details
-
isComplete
public 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 interfaceAsyncResult- Returns:
- returns true if the asynchronous operation has completed.
-
onFailure
Description copied from interface:AsyncResultIf the operation fails this method is invoked with the Exception that caused the failure.- Specified by:
onFailurein interfaceAsyncResult- Parameters:
result- The error that resulted in this asynchronous operation failing.
-
onSuccess
public void onSuccess()Description copied from interface:AsyncResultIf the operation succeeds the resulting value produced is set to null and the waiting parties are signaled.- Specified by:
onSuccessin interfaceAsyncResult
-
sync
Waits for a response to some Provider requested operation.- Throws:
ProviderException- if an error occurs while waiting for the response.
-
sync
Timed wait for a response to a Provider operation.- Parameters:
amount- The amount of time to wait before abandoning the wait.unit- The unit to use for this wait period.- Returns:
- true if the operation succeeded and false if the waiting time elapsed while waiting for the operation to complete.
- Throws:
ProviderException- if an error occurs while waiting for the response.
-
failOnError
- Throws:
ProviderException
-