Runnable according
to the next execution time suggested by a given Trigger.
Necessary because a native ScheduledExecutorService supports
delay-driven execution only. The flexibility of the Trigger interface
will be translated onto a delay for the next execution time (repeatedly).
| Modifier and Type | Field and Description |
|---|---|
| private ScheduledFuture | |
| private final ScheduledExecutorService | |
| private Instant | |
| private final Trigger | |
| private final SimpleTriggerContext | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| public | ReschedulingRunnable(Runnable delegate, Trigger trigger, Clock clock, ScheduledExecutorService executor, ErrorHandler errorHandler)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | cancel(boolean
true if the thread
executing this task should be interrupted (if the thread is
known to the implementation); otherwise, in-progress tasks are
allowed to completeImplements java. Attempts to cancel execution of this task. |
| public int | compareTo(Delayed
the object to be compared. other)Implements java. Compares this object with the specified object for order. |
| public Object | get()
Implements java. Waits if necessary for the computation to complete, and then retrieves its result. |
| public Object | get(long
the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Implements java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available. |
| public long | getDelay(TimeUnit
the time unit unit)Implements java. Returns the remaining delay associated with this object, in the given time unit. |
| public boolean | isCancelled()
Implements java. Returns |
| public boolean | |
| private ScheduledFuture | |
| public void | run()
Overrides org. Implements java. Runs this operation. |
| public ScheduledFuture |
| currentFuture | back to summary |
|---|---|
| private ScheduledFuture<?> currentFuture
| |
| executor | back to summary |
|---|---|
| private final ScheduledExecutorService executor | |
| scheduledExecutionTime | back to summary |
|---|---|
| private Instant scheduledExecutionTime
| |
| trigger | back to summary |
|---|---|
| private final Trigger trigger | |
| triggerContext | back to summary |
|---|---|
| private final SimpleTriggerContext triggerContext | |
| triggerContextMonitor | back to summary |
|---|---|
| private final Object triggerContextMonitor | |
| ReschedulingRunnable | back to summary |
|---|---|
| public ReschedulingRunnable(Runnable delegate, Trigger trigger, Clock clock, ScheduledExecutorService executor, ErrorHandler errorHandler) | |
| cancel | back to summary |
|---|---|
| public boolean cancel(boolean mayInterruptIfRunning) Implements java. Doc from java. Attempts to cancel execution of this task. This method has no
effect if the task is already completed or cancelled, or could
not be cancelled for some other reason. Otherwise, if this
task has not started when The return value from this method does not necessarily
indicate whether the task is now cancelled; use
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(Delayed other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| get | back to summary |
|---|---|
| public Object get() throws InterruptedException, ExecutionException Implements java. Doc from java. Waits if necessary for the computation to complete, and then retrieves its result.
| |
| get | back to summary |
|---|---|
| public Object get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException Implements java. Doc from java. Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
| |
| getDelay | back to summary |
|---|---|
| public long getDelay(TimeUnit unit) Implements java. Doc from java. Returns the remaining delay associated with this object, in the given time unit. | |
| isCancelled | back to summary |
|---|---|
| public boolean isCancelled() Implements java. Doc from java. Returns
| |
| isDone | back to summary |
|---|---|
| public boolean isDone() Implements java. Doc from java. Returns
| |
| obtainCurrentFuture | back to summary |
|---|---|
| private ScheduledFuture | |
| run | back to summary |
|---|---|
| public void run() Overrides org. Implements java. Doc from java. Runs this operation.
| |
| schedule | back to summary |
|---|---|
public ScheduledFuture
| |