public class RetryOnFailureXSiteCommand extends Object
RetryOnFailureXSiteCommand.RetryPolicy
to retry the command in case of an exception. The RetryOnFailureXSiteCommand.RetryPolicy
has the exception to decide if it should retry or not.Modifier and Type | Class and Description |
---|---|
static class |
RetryOnFailureXSiteCommand.MaxRetriesPolicy |
static interface |
RetryOnFailureXSiteCommand.RetryPolicy |
Modifier and Type | Field and Description |
---|---|
static RetryOnFailureXSiteCommand.RetryPolicy |
NO_RETRY |
Modifier and Type | Method and Description |
---|---|
void |
execute(RpcManager rpcManager,
long waitTimeBetweenRetries,
TimeUnit unit)
Invokes remotely the command using the
Transport 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.
|
String |
toString() |
public static final RetryOnFailureXSiteCommand.RetryPolicy NO_RETRY
public void execute(RpcManager rpcManager, long waitTimeBetweenRetries, TimeUnit unit) throws Throwable
Transport
passed as parameter.rpcManager
- the RpcManager
to use.waitTimeBetweenRetries
- the waiting time if the command fails before retrying it.unit
- the TimeUnit
of the waiting time.Throwable
- if the maximum retries is reached (defined by the RetryOnFailureXSiteCommand.RetryPolicy
,
the last exception occurred is thrown.public static RetryOnFailureXSiteCommand newInstance(XSiteBackup backup, XSiteReplicateCommand command, RetryOnFailureXSiteCommand.RetryPolicy retryPolicy)
backup
- the destination site.command
- the command to invoke remotely.retryPolicy
- the retry policy.NullPointerException
- if any parameter is null
Copyright © 2021 JBoss by Red Hat. All rights reserved.