Package org.cache2k.core.timing
Interface Timer
-
- All Superinterfaces:
NeedsClose
- All Known Implementing Classes:
DefaultTimer
public interface Timer extends NeedsClose
Timer for triggering expiry or refresh.- Author:
- Jens Wilke
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(TimerTask t)Cancel the timer task.voidcancelAll()Terminates all timer tasks currently pending.longgetLagMillis()The lag time tasks may lag behind.voidschedule(TimerTask task, long time)Schedule the specified timer task for execution at the specified time, in milliseconds.-
Methods inherited from interface org.cache2k.core.api.NeedsClose
close
-
-
-
-
Method Detail
-
schedule
void schedule(TimerTask task, long time)
Schedule the specified timer task for execution at the specified time, in milliseconds. If the execution time is reached already the task is executed immediately in a separate thread.- Parameters:
time- the time when the task should be run. must be positive or 0.
-
cancel
void cancel(TimerTask t)
Cancel the timer task.
-
cancelAll
void cancelAll()
Terminates all timer tasks currently pending.
-
getLagMillis
long getLagMillis()
The lag time tasks may lag behind.
-
-