java.lang.Object
jreceiver.util.Daemon
jreceiver.util.ScheduledDaemon
- public abstract class ScheduledDaemon
- extends Daemon
Generic daemon to which clients can subscribe to status messages
and whose worker thread can be scheduled to run periodically.
- Version:
- $Revision: 1.1 $ $Date: 2002/07/20 03:18:07 $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
next_execution_time
protected java.util.Date next_execution_time
schedule_period
protected long schedule_period
timer
protected java.util.Timer timer
- for scheduling worker thread
log
protected static org.apache.commons.logging.Log log
- logging object
ScheduledDaemon
public ScheduledDaemon(java.lang.String thread_name)
- ctor
scheduleAtFixedRate
public void scheduleAtFixedRate(java.util.Date first_time,
long period)
- Schedules the daemon's worker thread for repeated
fixed-rate execution, beginning at the specified time.
Subsequent executions take place at approximately regular intervals,
separated by the specified period.
Calling this method will cancel any existing schedule
for the daemon.
Using this means of scheduling work is preferable when time spans
between runs are long where you don't want to keep resources (like
sockets) open.
scheduleCancel
public void scheduleCancel()
- cancel any existing schedule for the worker thread
getSchedule
public java.util.Date getSchedule()
- obtain the time the daemon will next run; null if disabled