|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.muse.util.Timer
public class Timer
Timer is a wrapper class for the JDK java.util.Timer that makes it easy to reschedule timers using the same java.util.TimerTask. It also provides some extra convenience methods related to scheduling and execution. All real work is delegated to java.util.Timer.
Constructor Summary | |
---|---|
Timer()
|
Method Summary | |
---|---|
void |
cancel()
Cancels the timer. |
void |
executeNow()
Executes the timer's task whether the timer is scheduled or not. |
Date |
getScheduledTime()
|
TimerTask |
getTimerTask()
|
boolean |
isPastScheduledTime()
|
void |
reschedule(TimerTask task,
Date whenToFire)
Cancels the timer (if it is currently scheduled) and reschedules it for the given time. |
void |
schedule(TimerTask task,
Date whenToFire)
Sets the timer to fire at the given time, which will results in the timer's TimerTask being executed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Timer()
Method Detail |
---|
public final void cancel()
public final void executeNow()
public final Date getScheduledTime()
public final TimerTask getTimerTask()
public final boolean isPastScheduledTime()
public final void reschedule(TimerTask task, Date whenToFire)
task
- The code to run when the timer is up.whenToFire
- The new fire time for the timer.public final void schedule(TimerTask task, Date whenToFire)
task
- The code to run when the timer is up.whenToFire
- The time when the timer should fire.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |