Class RetryOnFailureXSiteCommand
- java.lang.Object
-
- org.infinispan.remoting.transport.RetryOnFailureXSiteCommand
-
public class RetryOnFailureXSiteCommand extends java.lang.Object
Invokes a command in a remote site. This class allows to set aRetryOnFailureXSiteCommand.RetryPolicy
to retry the command in case of an exception. TheRetryOnFailureXSiteCommand.RetryPolicy
has the exception to decide if it should retry or not.- Since:
- 7.0
- Author:
- Pedro Ruivo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RetryOnFailureXSiteCommand.MaxRetriesPolicy
static interface
RetryOnFailureXSiteCommand.RetryPolicy
-
Field Summary
Fields Modifier and Type Field Description static RetryOnFailureXSiteCommand.RetryPolicy
NO_RETRY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(RpcManager rpcManager, long waitTimeBetweenRetries, java.util.concurrent.TimeUnit unit)
Invokes remotely the command using theTransport
passed as parameter.static RetryOnFailureXSiteCommand
newInstance(XSiteBackup backup, XSiteReplicateCommand command, RetryOnFailureXSiteCommand.RetryPolicy retryPolicy)
It builds a new instance with the destination site, the command and the retry policy.java.lang.String
toString()
-
-
-
Field Detail
-
NO_RETRY
public static final RetryOnFailureXSiteCommand.RetryPolicy NO_RETRY
-
-
Method Detail
-
execute
public void execute(RpcManager rpcManager, long waitTimeBetweenRetries, java.util.concurrent.TimeUnit unit) throws java.lang.Throwable
Invokes remotely the command using theTransport
passed as parameter.- Parameters:
rpcManager
- theRpcManager
to use.waitTimeBetweenRetries
- the waiting time if the command fails before retrying it.unit
- theTimeUnit
of the waiting time.- Throws:
java.lang.Throwable
- if the maximum retries is reached (defined by theRetryOnFailureXSiteCommand.RetryPolicy
, the last exception occurred is thrown.
-
newInstance
public static RetryOnFailureXSiteCommand newInstance(XSiteBackup backup, XSiteReplicateCommand command, RetryOnFailureXSiteCommand.RetryPolicy retryPolicy)
It builds a new instance with the destination site, the command and the retry policy.- Parameters:
backup
- the destination site.command
- the command to invoke remotely.retryPolicy
- the retry policy.- Returns:
- the new instance.
- Throws:
java.lang.NullPointerException
- if any parameter isnull
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-