public abstract class ProviderFuture extends Object implements AsyncResult
| Modifier and Type | Field and Description |
|---|---|
protected static int |
COMPLETING |
protected ProviderException |
error |
protected static int |
FAILURE |
protected static int |
INCOMPLETE |
protected static AtomicIntegerFieldUpdater<ProviderFuture> |
STATE_FIELD_UPDATER |
protected static int |
SUCCESS |
protected ProviderSynchronization |
synchronization |
protected int |
waiting |
| Constructor and Description |
|---|
ProviderFuture() |
ProviderFuture(ProviderSynchronization synchronization) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
failOnError() |
boolean |
isComplete()
Returns true if the AsyncResult has completed.
|
void |
onFailure(ProviderException result)
If the operation fails this method is invoked with the Exception
that caused the failure.
|
void |
onSuccess()
If the operation succeeds the resulting value produced is set to null and
the waiting parties are signaled.
|
abstract void |
sync()
Waits for a response to some Provider requested operation.
|
abstract boolean |
sync(long amount,
TimeUnit unit)
Timed wait for a response to a Provider operation.
|
protected final ProviderSynchronization synchronization
protected static final int INCOMPLETE
protected static final int COMPLETING
protected static final int SUCCESS
protected static final int FAILURE
protected static final AtomicIntegerFieldUpdater<ProviderFuture> STATE_FIELD_UPDATER
protected ProviderException error
protected int waiting
public ProviderFuture()
public ProviderFuture(ProviderSynchronization synchronization)
public boolean isComplete()
AsyncResultisComplete in interface AsyncResultpublic void onFailure(ProviderException result)
AsyncResultonFailure in interface AsyncResultresult - The error that resulted in this asynchronous operation failing.public void onSuccess()
AsyncResultonSuccess in interface AsyncResultpublic abstract void sync()
throws ProviderException
ProviderException - if an error occurs while waiting for the response.public abstract boolean sync(long amount,
TimeUnit unit)
throws ProviderException
amount - The amount of time to wait before abandoning the wait.unit - The unit to use for this wait period.ProviderException - if an error occurs while waiting for the response.protected void failOnError()
throws ProviderException
ProviderExceptionCopyright © 2013–2019 The Apache Software Foundation. All rights reserved.