@NotThreadSafe final class DelayableLimitedRescheduler extends java.lang.Object implements Rescheduler
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Callable<java.lang.Void> |
callable |
private int |
delayInMillis |
private java.util.concurrent.ScheduledExecutorService |
executor |
private int |
maxReschedules |
private int |
reschedulesCounter |
Constructor and Description |
---|
DelayableLimitedRescheduler(java.util.concurrent.ScheduledExecutorService executor) |
Modifier and Type | Method and Description |
---|---|
private boolean |
isExpired() |
java.util.concurrent.ScheduledFuture<java.lang.Void> |
reschedule() |
void |
setCallable(java.util.concurrent.Callable<java.lang.Void> callable) |
void |
setDelayInMillis(int delayInMillis) |
void |
setMaxReschedules(int maxReschedules) |
private final java.util.concurrent.ScheduledExecutorService executor
private java.util.concurrent.Callable<java.lang.Void> callable
private int maxReschedules
private int delayInMillis
private int reschedulesCounter
@Inject public DelayableLimitedRescheduler(java.util.concurrent.ScheduledExecutorService executor)
public void setMaxReschedules(int maxReschedules)
setMaxReschedules
in interface Rescheduler
public void setDelayInMillis(int delayInMillis)
setDelayInMillis
in interface Rescheduler
public java.util.concurrent.ScheduledFuture<java.lang.Void> reschedule() throws java.util.concurrent.RejectedExecutionException
reschedule
in interface Rescheduler
java.util.concurrent.RejectedExecutionException
private boolean isExpired()
public void setCallable(java.util.concurrent.Callable<java.lang.Void> callable)
setCallable
in interface Rescheduler