public class WeakAlarm extends Alarm
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 and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addEnvironmentListener, classLoaderDestroy, classLoaderInit, close, dequeue, getName, getWakeTime, isPriority, isQueued, queue, queueAt, run, setName, setPriority, setWakeTime, toString
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 uppublic 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