Package com.sun.solaris.service.timer
Class SimpleRecurringEventTimer
- java.lang.Object
-
- com.sun.solaris.service.timer.SimpleRecurringEventTimer
-
- All Implemented Interfaces:
RecurringEventTimer
public class SimpleRecurringEventTimer extends java.lang.Object implements RecurringEventTimer
A recurring event timer. Like all Java time consumers, which rely on wall time, adjustments to the time of day will adversely affect the accuracy of the period.
-
-
Field Summary
Fields Modifier and Type Field Description static int
SEC
Multiplier to convert seconds to milliseconds.
-
Constructor Summary
Constructors Constructor Description SimpleRecurringEventTimer(long period)
Establishes a timer which will fire every 'period' milliseconds starting from now.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
waitUntilNextFiring()
Cause the current thread to wait until at least the time of the next event, as near as possible, unless interrupted.
-
-
-
Field Detail
-
SEC
public static final int SEC
Multiplier to convert seconds to milliseconds.- See Also:
- Constant Field Values
-
-
Method Detail
-
waitUntilNextFiring
public void waitUntilNextFiring() throws java.lang.InterruptedException
Cause the current thread to wait until at least the time of the next event, as near as possible, unless interrupted.- Specified by:
waitUntilNextFiring
in interfaceRecurringEventTimer
- Throws:
java.lang.InterruptedException
- if the thread is interrupted while waiting for the next firing. Subsequent calls to this method will wait for the same firing.
-
-