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.longgetLagTicks()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. The value 9223372036854775807L is illegal since this would represent eternal timer and does not need to be scheduled.
-
cancel
void cancel(TimerTask t)
Cancel the timer task.
-
cancelAll
void cancelAll()
Terminates all timer tasks currently pending. This does not mark the timer tasks as cancelled, just drops all tasks from the timer data structure.
-
getLagTicks
long getLagTicks()
The lag time tasks may lag behind.
-
-