|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jalios.jdring.AlarmWaiter
public class AlarmWaiter
This class manages the thread which sleeps until the next alarm. Methods are synchronized to prevent interference from the AlarmWaiter thread and external threads.
Field Summary | |
---|---|
protected AlarmManager |
mgr
|
static String |
REVISION
|
protected Thread |
thread
|
Constructor Summary | |
---|---|
AlarmWaiter(AlarmManager mgr,
boolean isDaemon,
String waiterName)
Creates a new AlarmWaiter. |
Method Summary | |
---|---|
void |
restart(long sleepUntil)
Restarts the thread for a new time to sleep until. |
void |
run()
|
void |
stop()
Stops (destroy) the thread. |
void |
triggerNow()
Trigger the next alarm now. |
void |
update(long sleepUntil)
Updates the time to sleep. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String REVISION
protected AlarmManager mgr
protected Thread thread
Constructor Detail |
---|
public AlarmWaiter(AlarmManager mgr, boolean isDaemon, String waiterName)
mgr
- the Alarm ManagerisDaemon
- true if the waiter thread should run as a daemon.waiterName
- the name of the waiter threadMethod Detail |
---|
public void update(long sleepUntil)
sleepUntil
- the new time to sleep until.public void triggerNow()
public void restart(long sleepUntil)
sleepUntil
- the new time to sleep until.public void stop()
public void run()
run
in interface Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |