Class FailoverProvider.FailoverRequest
java.lang.Object
org.apache.qpid.jms.provider.WrappedAsyncResult
org.apache.qpid.jms.provider.failover.FailoverProvider.FailoverRequest
- All Implemented Interfaces:
Runnable,AsyncResult
- Direct Known Subclasses:
FailoverProvider.CreateConnectionRequest
- Enclosing class:
- FailoverProvider
protected abstract class FailoverProvider.FailoverRequest
extends WrappedAsyncResult
implements Runnable
For all requests that are dispatched from the FailoverProvider to a connected
Provider instance an instance of FailoverRequest is used to handle errors that
occur during processing of that request and trigger a reconnect.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFailoverRequest(AsyncResult watcher) FailoverRequest(AsyncResult watcher, long requestTimeout) -
Method Summary
Modifier and TypeMethodDescriptionprotected ProviderExceptionprotected ProviderExceptionabstract voidCalled to execute the specific task that was requested.booleanWhen the transport is not connected should this request automatically fail.booleanvoidonFailure(ProviderException error) 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.voidrun()booleanShould the request just succeed when the Provider is not connected.Methods inherited from class org.apache.qpid.jms.provider.WrappedAsyncResult
getWrappedRequest, isComplete
-
Field Details
-
id
protected final long id -
activeProvider
-
-
Constructor Details
-
FailoverRequest
-
FailoverRequest
-
-
Method Details
-
run
public void run() -
onFailure
Description copied from interface:AsyncResultIf the operation fails this method is invoked with the Exception that caused the failure.- Specified by:
onFailurein interfaceAsyncResult- Overrides:
onFailurein classWrappedAsyncResult- Parameters:
error- 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- Overrides:
onSuccessin classWrappedAsyncResult
-
doTask
Called to execute the specific task that was requested.- Parameters:
provider- The provider instance to use when performing this action.- Throws:
ProviderException- if an error occurs during task execution.
-
succeedsWhenOffline
public boolean succeedsWhenOffline()Should the request just succeed when the Provider is not connected.- Returns:
- true if the request is marked as successful when not connected.
-
failureWhenOffline
public boolean failureWhenOffline()When the transport is not connected should this request automatically fail.- Returns:
- true if the task should fail when the Provider is not connected.
-
isExpired
public boolean isExpired()- Returns:
- true if the request has a configured expiration time.
-
createTimedOutException
-
createOfflineFailureException
-