Package org.apache.jena.atlas.lib
Class AlarmClock
- java.lang.Object
-
- org.apache.jena.atlas.lib.AlarmClock
-
public class AlarmClock extends java.lang.ObjectAn AlarmClock is an object that will make a callback (with a value) at a preset time. Simple abstraction of add/reset/cancel of a Runnable. Currently, backed byScheduledThreadPoolExecutor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Alarmadd(java.lang.Runnable task, long delay)Add a task to be called after a delay (in milliseconds)voidcancel(Alarm alarm)Cancel a taskstatic AlarmClockget()Global singleton for general usevoidrelease()Clean upAlarmreset(Alarm alarm, long delay)Reschedule a task to now run after a different delay from now (in milliseconds)
-
-
-
Method Detail
-
get
public static AlarmClock get()
Global singleton for general use
-
add
public Alarm add(java.lang.Runnable task, long delay)
Add a task to be called after a delay (in milliseconds)
-
reset
public Alarm reset(Alarm alarm, long delay)
Reschedule a task to now run after a different delay from now (in milliseconds)
-
cancel
public void cancel(Alarm alarm)
Cancel a task
-
release
public void release()
Clean up
-
-