Package kilim.timerservice
Class Timer
- java.lang.Object
-
- kilim.timerservice.Timer
-
-
Field Summary
Fields Modifier and Type Field Description EventSubscriberesintindexprivate longnextExecutionTimebooleanonHeapVolatileBooleanonQueuestatic intTIMED_OUTstatic EventtimedOut
-
Constructor Summary
Constructors Constructor Description Timer(EventSubscriber es)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcancel()intcompareTo(Timer o)longgetExecutionTime()voidsetLiteral(long value)set the timer value explicitly, ie not relative to the current timevoidsetTimer(long timeoutMillis)set the timer relative to the current time, ie set a delay (in milliseconds)
-
-
-
Field Detail
-
nextExecutionTime
private volatile long nextExecutionTime
-
onQueue
public VolatileBoolean onQueue
-
onHeap
public volatile boolean onHeap
-
TIMED_OUT
public static final int TIMED_OUT
- See Also:
- Constant Field Values
-
timedOut
public static final Event timedOut
-
index
public int index
-
es
public EventSubscriber es
-
-
Constructor Detail
-
Timer
public Timer(EventSubscriber es)
-
-
Method Detail
-
compareTo
public int compareTo(Timer o)
- Specified by:
compareToin interfacejava.lang.Comparable<Timer>
-
setTimer
public void setTimer(long timeoutMillis)
set the timer relative to the current time, ie set a delay (in milliseconds)
-
setLiteral
public void setLiteral(long value)
set the timer value explicitly, ie not relative to the current time
-
cancel
public void cancel()
-
getExecutionTime
public long getExecutionTime()
-
-