public class SimpleRetryPolicy extends Object implements RetryPolicy
| Modifier and Type | Class and Description |
|---|---|
protected static class |
SimpleRetryPolicy.RetryCounter |
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
protected SimpleRetryPolicy.RetryCounter |
retryCounter |
| Constructor and Description |
|---|
SimpleRetryPolicy(long frequency,
int retryCount) |
| Modifier and Type | Method and Description |
|---|---|
<T> org.reactivestreams.Publisher<T> |
applyPolicy(org.reactivestreams.Publisher<T> publisher,
Predicate<Throwable> shouldRetry,
Consumer<Throwable> onExhausted)
Applies the retry policy in a non blocking manner by transforming
the given
publisher into one configured to apply the retry
logic. |
PolicyStatus |
applyPolicy(Throwable cause)
Applies the retry policy by performing a blocking action.
|
protected boolean |
isApplicableTo(Throwable cause)
Indicates if the policy is applicable for the cause that caused the policy invocation.
|
protected boolean |
isExhausted()
Determines if the policy is exhausted or not comparing the original configuration against the current state.
|
protected static final org.slf4j.Logger logger
protected SimpleRetryPolicy.RetryCounter retryCounter
public <T> org.reactivestreams.Publisher<T> applyPolicy(org.reactivestreams.Publisher<T> publisher,
Predicate<Throwable> shouldRetry,
Consumer<Throwable> onExhausted)
RetryPolicypublisher into one configured to apply the retry
logic.applyPolicy in interface RetryPolicyT - the generic type of the publisher's contentpublisher - a publisher with the items which might failshouldRetry - a predicate which evaluates each item to know if it should be retried or notonExhausted - an action to perform when the retry action has been exhaustedPublisher configured with the retry policy.public PolicyStatus applyPolicy(Throwable cause)
RetryPolicyapplyPolicy in interface RetryPolicycause - the failure which causes the retryPolicyStatusprotected boolean isApplicableTo(Throwable cause)
protected boolean isExhausted()
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.