protected abstract class FailoverProvider.FailoverRequest extends WrappedAsyncResult implements Runnable
| Modifier and Type | Field and Description |
|---|---|
protected Provider |
activeProvider |
protected long |
id |
| Constructor and Description |
|---|
FailoverRequest(AsyncResult watcher) |
FailoverRequest(AsyncResult watcher,
long requestTimeout) |
| Modifier and Type | Method and Description |
|---|---|
protected ProviderException |
createOfflineFailureException(ProviderException error) |
protected ProviderException |
createTimedOutException() |
abstract void |
doTask(Provider provider)
Called to execute the specific task that was requested.
|
boolean |
failureWhenOffline()
When the transport is not connected should this request automatically fail.
|
boolean |
isExpired() |
void |
onFailure(ProviderException error)
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.
|
void |
run() |
boolean |
succeedsWhenOffline()
Should the request just succeed when the Provider is not connected.
|
getWrappedRequest, isCompleteprotected final long id
protected Provider activeProvider
public FailoverRequest(AsyncResult watcher)
public FailoverRequest(AsyncResult watcher, long requestTimeout)
public void onFailure(ProviderException error)
AsyncResultonFailure in interface AsyncResultonFailure in class WrappedAsyncResulterror - The error that resulted in this asynchronous operation failing.public void onSuccess()
AsyncResultonSuccess in interface AsyncResultonSuccess in class WrappedAsyncResultpublic abstract void doTask(Provider provider) throws ProviderException
provider - The provider instance to use when performing this action.ProviderException - if an error occurs during task execution.public boolean succeedsWhenOffline()
public boolean failureWhenOffline()
public boolean isExpired()
protected ProviderException createTimedOutException()
protected ProviderException createOfflineFailureException(ProviderException error)
Copyright © 2013–2019 The Apache Software Foundation. All rights reserved.