| Modifier and Type | Field and Description |
|---|---|
| private final Runnable | |
| private final Executor | |
| private ScheduledFuture | |
| private final TriFunction | |
| private long | |
| private final long | |
| private final TimeUnit |
| Access | Constructor and Description |
|---|---|
| private | ScheduledExecutorServiceTimer(Duration timeout, Runnable action, TriFunction<Long, TimeUnit, Runnable, ScheduledFuture<?>> scheduler, Executor eventThreadExecutor)
|
| Modifier and Type | Method and Description |
|---|---|
| public static Timer | create(Duration timeout, Runnable action, ScheduledExecutorService scheduler, Executor eventThreadExecutor)
|
| public static Timer | createPeriodic(Duration timeout, Runnable action, ScheduledExecutorService scheduler, Executor eventThreadExecutor)
|
| public final void | restart()
Implements org. Schedules the associated action to be executed after the associated delay. |
| public final void | stop()
Implements org. If the associated action has been scheduled for execution but not yet executed, this method prevents it from being executed at all. |
| action | back to summary |
|---|---|
| private final Runnable action | |
| eventThreadExecutor | back to summary |
|---|---|
| private final Executor eventThreadExecutor | |
| pendingTimer | back to summary |
|---|---|
| private ScheduledFuture<?> pendingTimer | |
| scheduler | back to summary |
|---|---|
| private final TriFunction<Long, TimeUnit, Runnable, ScheduledFuture<?>> scheduler | |
| seq | back to summary |
|---|---|
| private long seq | |
| timeout | back to summary |
|---|---|
| private final long timeout | |
| unit | back to summary |
|---|---|
| private final TimeUnit unit | |
| ScheduledExecutorServiceTimer | back to summary |
|---|---|
| private ScheduledExecutorServiceTimer(Duration timeout, Runnable action, TriFunction<Long, TimeUnit, Runnable, ScheduledFuture<?>> scheduler, Executor eventThreadExecutor) | |
| create | back to summary |
|---|---|
| public static Timer create(Duration timeout, Runnable action, ScheduledExecutorService scheduler, Executor eventThreadExecutor) | |
| createPeriodic | back to summary |
|---|---|
| public static Timer createPeriodic(Duration timeout, Runnable action, ScheduledExecutorService scheduler, Executor eventThreadExecutor) | |
| restart | back to summary |
|---|---|
| public final void restart() Implements org. Doc from org. Schedules the associated action to be executed after the associated delay. If the action is already scheduled but hasn't been executed yet, the timeout is reset, so that the action won't be executed before the full delay from now.
| |
| stop | back to summary |
|---|---|
| public final void stop() Implements org. Doc from org. If the associated action has been scheduled for execution but not yet
executed, this method prevents it from being executed at all. This is
also true in case the timer's timeout has already expired, but the
associated action hasn't had a chance to be executed on the associated
thread. Note that this is a stronger guarantee than the one given by
In contrast, using the FxTimer, the action is guaranteed not to
be executed after stop():
| |