|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.util.AlarmHeap
public class AlarmHeap
The alarm class provides a lightweight event scheduler. This allows an objects to schedule a timeout without creating a new thread.
A separate thread periodically tests the queue for alarms ready.
Constructor Summary | |
---|---|
AlarmHeap()
Create a new wakeup alarm with a designated listener as a callback. |
Method Summary | |
---|---|
void |
dequeue(Alarm alarm)
|
Alarm |
extractAlarm(long now)
Returns the next alarm ready to run |
boolean |
queueAt(Alarm alarm,
long wakeTime)
Queue the alarm for wakeup. |
Alarm[] |
toArray()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AlarmHeap()
Method Detail |
---|
public Alarm extractAlarm(long now)
public boolean queueAt(Alarm alarm, long wakeTime)
delta
- time in milliseconds to wakepublic void dequeue(Alarm alarm)
public Alarm[] toArray()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |