public class BackoffScheduler extends Object implements FastRecoveryObserver, ReschedulingObserver, org.mule.runtime.api.lifecycle.Disposable
BackoffRunnables.| Constructor and Description |
|---|
BackoffScheduler(ScheduledExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose() |
FastRecoveryObserver |
fastRecoveryAbort(BackoffRunnable runnable)
Notifies the fast recovery
BackoffRunnable is now with Error. |
FastRecoveryObserver |
fastRecoveryStable(BackoffRunnable runnable,
FastRecoveryConfiguration configuration)
Notifies the fast recovery
BackoffRunnable is now Stable. |
FastRecoveryObserver |
fastRecoveryUnstable(BackoffRunnable runnable,
FastRecoveryConfiguration configuration)
Notifies the fast recovery
BackoffRunnable is still Unstable. |
ReschedulingObserver |
reschedule(BackoffRunnable runnable,
SchedulingConfiguration configuration)
Notifies the
BackoffRunnable must be rescheduled with defined SchedulingConfiguration. |
void |
schedule(BackoffRunnable runnable,
SchedulingConfiguration configuration,
FastRecoveryObserver... recoveryObservers)
Schedules a task in fast recovery mode:
BackoffRunnable will be executed until its first success. |
void |
scheduleWithFixedDelay(BackoffRunnable runnable,
SchedulingConfiguration configuration)
Schedules a task in rescheduling mode:
BackoffRunnable will be indefinitely scheduled, but with different paces
depending on each execution status. |
public BackoffScheduler(ScheduledExecutorService executorService)
public void schedule(BackoffRunnable runnable, SchedulingConfiguration configuration, FastRecoveryObserver... recoveryObservers)
BackoffRunnable will be executed until its first success.runnable - BackoffRunnable to be executed.configuration - configuration parameters.recoveryObservers - (optional) FastRecoveryObservers that will be notified on each execution.public void scheduleWithFixedDelay(BackoffRunnable runnable, SchedulingConfiguration configuration)
BackoffRunnable will be indefinitely scheduled, but with different paces
depending on each execution status.runnable - BackoffRunnable to be executed.configuration - configuration parameters.public FastRecoveryObserver fastRecoveryUnstable(BackoffRunnable runnable, FastRecoveryConfiguration configuration)
BackoffRunnable is still Unstable.
BackoffRunnable will be rescheduled given the new configuration. While this runnable remain Unstable this
process will be repeated.fastRecoveryUnstable in interface FastRecoveryObserverrunnable - the Unstable BackoffRunnable.configuration - the suggested delay and frequency if rescheduled along with its observers.public FastRecoveryObserver fastRecoveryStable(BackoffRunnable runnable, FastRecoveryConfiguration configuration)
BackoffRunnable is now Stable.
By not doing anything when BackoffRunnable is Stable, the BackoffScheduler will finish the retrying
process of a FastRecovery runnable.fastRecoveryStable in interface FastRecoveryObserverrunnable - the Stable BackoffRunnable.configuration - the suggested delay and frequency if rescheduled along with its observers.public FastRecoveryObserver fastRecoveryAbort(BackoffRunnable runnable)
BackoffRunnable is now with Error.
By not doing anything when BackoffRunnable is on Error, the BackoffScheduler will finish the retrying
process of a FastRecovery runnable.fastRecoveryAbort in interface FastRecoveryObserverrunnable - the BackoffRunnable with Error.public ReschedulingObserver reschedule(BackoffRunnable runnable, SchedulingConfiguration configuration)
BackoffRunnable must be rescheduled with defined SchedulingConfiguration.
BackoffRunnable is rescheduled with new configuration.reschedule in interface ReschedulingObserverrunnable - the BackoffRunnable to rescheduled.configuration - the defined period and frequency.public void dispose()
dispose in interface org.mule.runtime.api.lifecycle.DisposableCopyright © 2014–2021 MuleSoft, Inc.. All rights reserved.