Package dev.failsafe.internal
Class RetryPolicyImpl<R>
- java.lang.Object
-
- dev.failsafe.internal.RetryPolicyImpl<R>
-
- Type Parameters:
R
- result type
- All Implemented Interfaces:
Policy<R>
,RetryPolicy<R>
,DelayablePolicy<R>
,FailurePolicy<R>
public class RetryPolicyImpl<R> extends java.lang.Object implements RetryPolicy<R>, FailurePolicy<R>, DelayablePolicy<R>
ARetryPolicy
implementation.- See Also:
RetryPolicyBuilder
-
-
Field Summary
Fields Modifier and Type Field Description private RetryPolicyConfig<R>
config
-
Constructor Summary
Constructors Constructor Description RetryPolicyImpl(RetryPolicyConfig<R> config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RetryPolicyConfig<R>
getConfig()
Returns theRetryPolicyConfig
that the RetryPolicy was built with.boolean
isAbortable(R result, java.lang.Throwable failure)
Returns whether an execution result can be aborted given the configured abort conditions.PolicyExecutor<R>
toExecutor(int policyIndex)
Returns aPolicyExecutor
capable of handling an execution for the Policy.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface dev.failsafe.spi.DelayablePolicy
computeDelay
-
Methods inherited from interface dev.failsafe.spi.FailurePolicy
isFailure
-
-
-
-
Field Detail
-
config
private final RetryPolicyConfig<R> config
-
-
Constructor Detail
-
RetryPolicyImpl
public RetryPolicyImpl(RetryPolicyConfig<R> config)
-
-
Method Detail
-
getConfig
public RetryPolicyConfig<R> getConfig()
Description copied from interface:RetryPolicy
Returns theRetryPolicyConfig
that the RetryPolicy was built with.- Specified by:
getConfig
in interfaceDelayablePolicy<R>
- Specified by:
getConfig
in interfaceFailurePolicy<R>
- Specified by:
getConfig
in interfacePolicy<R>
- Specified by:
getConfig
in interfaceRetryPolicy<R>
-
isAbortable
public boolean isAbortable(R result, java.lang.Throwable failure)
Returns whether an execution result can be aborted given the configured abort conditions.- See Also:
RetryPolicyBuilder.abortOn(Class...)
,RetryPolicyBuilder.abortOn(List)
,RetryPolicyBuilder.abortOn(CheckedPredicate)
,RetryPolicyBuilder.abortIf(CheckedBiPredicate)
,RetryPolicyBuilder.abortIf(CheckedPredicate)
,RetryPolicyBuilder#abortWhen(R)
-
toExecutor
public PolicyExecutor<R> toExecutor(int policyIndex)
Description copied from interface:Policy
Returns aPolicyExecutor
capable of handling an execution for the Policy.- Specified by:
toExecutor
in interfacePolicy<R>
-
-