public class DxTimer extends Object
ScheduledExecutorService.
Used one thread to process Runnable tasks. There are two modes of operation, a single launch with delay time
in the millis and daily periodic work in LocalTime. There is no guarantee of the exact launch time.| Modifier and Type | Class and Description |
|---|---|
static interface |
DxTimer.Cancellable
The result is triggered by the
DxTimer, used only to cancel the scheduled task. |
| Modifier and Type | Method and Description |
|---|---|
static DxTimer |
getInstance()
Lazy creation of a singleton instance
DxTimer |
DxTimer.Cancellable |
runDaily(Runnable action,
LocalTime localTime)
Run periodic
Runnable task that will start every day in LocalTime |
DxTimer.Cancellable |
runOnce(Runnable action,
long delayMillis)
Run one-time delayed
Runnable task |
public static DxTimer getInstance()
DxTimerDxTimer instancepublic DxTimer.Cancellable runOnce(Runnable action, long delayMillis)
Runnable taskaction - Runnable taskdelayMillis - delay time in millisCancellablepublic DxTimer.Cancellable runDaily(Runnable action, LocalTime localTime)
Runnable task that will start every day in LocalTimeaction - Runnable tasklocalTime - periodic daily invoke timeCancellableCopyright © 2002–2025 Devexperts LLC. All rights reserved.