public class ExecutionConfig extends Object
Modifier and Type | Field and Description |
---|---|
static ExecutionConfig |
NON_TERMINATING |
static ExecutionConfig |
TERMINATING |
Constructor and Description |
---|
ExecutionConfig() |
Modifier and Type | Method and Description |
---|---|
ExecutionBehavior |
getExecutionBehavior() |
int |
getRetryCount() |
Duration |
getRetryDelay() |
ExecutionConfig |
immediateRetrying(int count) |
boolean |
isImmediatelyRetrying() |
boolean |
isNonTerminating() |
boolean |
isScheduledRetrying() |
boolean |
isTerminating() |
ExecutionConfig |
nonTerminating() |
ExecutionConfig |
scheduledRetrying(int count,
Duration delay) |
boolean |
shouldRetry(int currentCount) |
ExecutionConfig |
terminating() |
void |
validate()
Does basic validation to make sure object is valid
|
public static final ExecutionConfig TERMINATING
public static final ExecutionConfig NON_TERMINATING
public ExecutionConfig nonTerminating()
ExecutionConfig
representing non-terminating execution behaviorpublic ExecutionConfig terminating()
ExecutionConfig
representing terminating execution behaivorpublic ExecutionConfig immediateRetrying(int count)
count
- number of times retry should happenExecutionConfig
representing immediate retry execution behaivorpublic ExecutionConfig scheduledRetrying(int count, Duration delay)
count
- the number of times retry should happendelay
- the delayExecutionConfig
representing scheduled retry terminating execution behaivorpublic ExecutionBehavior getExecutionBehavior()
public int getRetryCount()
public Duration getRetryDelay()
public boolean isTerminating()
true
if the ExecutionBehavior
is TERMINATING
false
otherwisepublic boolean isNonTerminating()
true
if the ExecutionBehavior
is NON_TERMINATING
false
otherwisepublic boolean isImmediatelyRetrying()
true
if the ExecutionBehavior
is IMMEDIATE_RETRY_TERMINATING
false
otherwisepublic boolean isScheduledRetrying()
true
if the ExecutionBehavior
is SCHEDULED_RETRY_TERMINATING
false
otherwisepublic boolean shouldRetry(int currentCount)
currentCount
- the current counttrue
if a retry should be attempted, based on current retries already happened.
false
otherwisepublic void validate()
Copyright © 2016 Dexecutor. All rights reserved.