public class TimeScheduler
extends java.util.Timer
Modifier and Type | Class and Description |
---|---|
static interface |
TimeScheduler.CancellableTask |
static interface |
TimeScheduler.Task
The interface that submitted tasks must implement
|
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
TimeScheduler() |
TimeScheduler(boolean isDaemon) |
Modifier and Type | Method and Description |
---|---|
void |
add(TimeScheduler.Task t)
Add a task for execution at adjustable intervals
|
void |
add(TimeScheduler.Task task,
boolean relative)
Add a task for execution at adjustable intervals
|
void |
cancel() |
java.lang.String |
dumpTaskQueue() |
void |
schedule(java.util.TimerTask task,
java.util.Date time) |
void |
schedule(java.util.TimerTask task,
java.util.Date firstTime,
long period) |
void |
schedule(java.util.TimerTask task,
long delay) |
void |
schedule(java.util.TimerTask task,
long delay,
long period) |
void |
scheduleAtFixedRate(java.util.TimerTask task,
java.util.Date firstTime,
long period) |
void |
scheduleAtFixedRate(java.util.TimerTask task,
long delay,
long period) |
int |
size()
Returns the number of tasks currently scheduled.
|
void |
start()
Start the scheduler, if it's suspended or stopped
|
void |
stop()
Stop the scheduler if it's running.
|
public TimeScheduler()
public TimeScheduler(boolean isDaemon)
public java.lang.String dumpTaskQueue()
public void add(TimeScheduler.Task task, boolean relative)
task
- the task to executerelative
- scheduling scheme:
true:public void add(TimeScheduler.Task t)
t
- the task to executepublic void schedule(java.util.TimerTask task, long delay)
schedule
in class java.util.Timer
public void schedule(java.util.TimerTask task, long delay, long period)
schedule
in class java.util.Timer
public void schedule(java.util.TimerTask task, java.util.Date firstTime, long period)
schedule
in class java.util.Timer
public void schedule(java.util.TimerTask task, java.util.Date time)
schedule
in class java.util.Timer
public void scheduleAtFixedRate(java.util.TimerTask task, long delay, long period)
scheduleAtFixedRate
in class java.util.Timer
public void scheduleAtFixedRate(java.util.TimerTask task, java.util.Date firstTime, long period)
scheduleAtFixedRate
in class java.util.Timer
public void cancel()
cancel
in class java.util.Timer
public int size()
public void start()
public void stop() throws java.lang.InterruptedException
java.lang.InterruptedException
- if interrupted while waiting for thread
to returnCopyright ? 1998-2006 Bela Ban. All Rights Reserved.