|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.asyncobjects.AsyncUnicastServer<ATimer> net.sf.asyncobjects.util.timer.TimerWrapper
public class TimerWrapper
A timer wrapper. It uses Timer
class to implement ATimer
interface. Closing the timer has the same effect as Timer.cancel()
.
However the close()
opertaion on the timer might be disabled by
passing a false value to
TimerWrapper(Timer, boolean, boolean)
constructor. In that case it
is still possible to use forceClose()
method to close the timer.
Constructor Summary | |
---|---|
TimerWrapper(Timer timer)
A constructor |
|
TimerWrapper(Timer timer,
boolean isCloseable,
boolean isPurgeable)
A constructor |
Method Summary | |
---|---|
Promise<Void> |
close()
Close resource |
void |
forceClose()
This method is intentionally not exported on the asynchronous facet interface. |
Promise<Integer> |
purge()
Remove all tasks from the timer |
Promise<ACallable<Boolean>> |
schedule(Date time,
ATimerTask task)
Schedule task at specified time |
Promise<ACallable<Boolean>> |
schedule(Date firstTime,
long period,
ATimerTask task)
Schedule task after specfied time with specified period |
Promise<ACallable<Boolean>> |
schedule(long delay,
ATimerTask task)
Schedule task after specified delay |
Promise<ACallable<Boolean>> |
schedule(long delay,
long period,
ATimerTask task)
Schedule task after specfied delay with specified period |
Promise<ACallable<Boolean>> |
scheduleAtFixedRate(Date firstTime,
long period,
ATimerTask task)
Schedule task after specfied time with fixed rage |
Promise<ACallable<Boolean>> |
scheduleAtFixedRate(long delay,
long period,
ATimerTask task)
Schedule task after specfied delay with fixed rate |
Methods inherited from class net.sf.asyncobjects.AsyncUnicastServer |
---|
dereference, export, isImmediate, myVat, promise |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.asyncobjects.AsyncObject |
---|
dereference, isImmediate |
Constructor Detail |
---|
public TimerWrapper(Timer timer, boolean isCloseable, boolean isPurgeable)
timer
- a timer to useisCloseable
- if true, the timer might be closedisPurgeable
- if true, the timer might be purgedpublic TimerWrapper(Timer timer)
timer
- a timer to useMethod Detail |
---|
public Promise<Integer> purge()
ATimer
purge
in interface ATimer
ATimer.purge()
public Promise<ACallable<Boolean>> schedule(long delay, ATimerTask task)
ATimer
schedule
in interface ATimer
delay
- a delaytask
- a taks to schedule.
ATimer.schedule(long,
net.sf.asyncobjects.util.timer.ATimerTask)
public Promise<ACallable<Boolean>> schedule(Date time, ATimerTask task)
ATimer
schedule
in interface ATimer
time
- a time to schedule attask
- a taks to schedule.
ATimer.schedule(java.util.Date,
net.sf.asyncobjects.util.timer.ATimerTask)
public Promise<ACallable<Boolean>> schedule(long delay, long period, ATimerTask task)
ATimer
schedule
in interface ATimer
delay
- a delayperiod
- a periodtask
- a taks to schedule.
ATimer.schedule(long, long,
net.sf.asyncobjects.util.timer.ATimerTask)
public Promise<ACallable<Boolean>> schedule(Date firstTime, long period, ATimerTask task)
ATimer
schedule
in interface ATimer
firstTime
- a first time the task is executedperiod
- a periodtask
- a taks to schedule.
ATimer.schedule(java.util.Date, long,
net.sf.asyncobjects.util.timer.ATimerTask)
public Promise<ACallable<Boolean>> scheduleAtFixedRate(long delay, long period, ATimerTask task)
ATimer
scheduleAtFixedRate
in interface ATimer
delay
- a delayperiod
- a periodtask
- a taks to schedule.
ATimer.scheduleAtFixedRate(long,
long, net.sf.asyncobjects.util.timer.ATimerTask)
public Promise<ACallable<Boolean>> scheduleAtFixedRate(Date firstTime, long period, ATimerTask task)
ATimer
scheduleAtFixedRate
in interface ATimer
firstTime
- a first time the task is executedperiod
- a periodtask
- a taks to schedule.
ATimer.scheduleAtFixedRate(java.util.Date,
long, net.sf.asyncobjects.util.timer.ATimerTask)
public Promise<Void> close()
ACloseable
close
in interface ACloseable
ACloseable.close()
,
Timer.cancel()
public void forceClose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |