|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.caucho.util.Alarm
com.caucho.util.WeakAlarm
public class WeakAlarm
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.
You should use Cron for slow requests. Alarm is only appropriate for very short jobs.
Constructor Summary | |
---|---|
WeakAlarm(AlarmListener listener)
Create a new wakeup alarm with a designated listener as a callback. |
|
WeakAlarm(AlarmListener listener,
long delta)
Creates a new alarm and schedules its wakeup. |
|
WeakAlarm(java.lang.String name,
AlarmListener listener)
Create a new wakeup alarm with a designated listener as a callback. |
|
WeakAlarm(java.lang.String name,
AlarmListener listener,
long delta)
Creates a named alarm and schedules its wakeup. |
Method Summary | |
---|---|
java.lang.ClassLoader |
getContextLoader()
Sets the alarm's context loader |
AlarmListener |
getListener()
Return the alarm's listener. |
void |
setContextLoader(java.lang.ClassLoader loader)
Sets the class loader. |
void |
setListener(AlarmListener listener)
Sets the alarm's listener. |
Methods inherited from class com.caucho.util.Alarm |
---|
addEnvironmentListener, classLoaderDestroy, classLoaderInit, close, dequeue, getName, getWakeTime, isPriority, isQueued, queue, queueAt, run, setName, setPriority, setWakeTime, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public WeakAlarm(AlarmListener listener)
public WeakAlarm(java.lang.String name, AlarmListener listener)
public WeakAlarm(java.lang.String name, AlarmListener listener, long delta)
name
- the object prepared to receive the callbacklistener
- the object prepared to receive the callbackdelta
- the time in milliseconds to wake uppublic WeakAlarm(AlarmListener listener, long delta)
listener
- the object prepared to receive the callbackdelta
- the time in milliseconds to wake upMethod Detail |
---|
public AlarmListener getListener()
getListener
in class Alarm
public void setListener(AlarmListener listener)
setListener
in class Alarm
public java.lang.ClassLoader getContextLoader()
Alarm
getContextLoader
in class Alarm
public void setContextLoader(java.lang.ClassLoader loader)
setContextLoader
in class Alarm
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |