public class Scheduler extends Thread
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
Scheduler()
Create new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
changePeriod(Job job,
long newPeriod)
Change the period of a job.
|
boolean |
delete(Job job)
Delete the given job.
|
void |
run()
Run scheduler.
|
void |
schedule(Job job,
long desiredTime)
Schedule a
Job for execution at system time given by
the desiredTime parameter. |
void |
schedule(Job job,
long desiredTime,
long period)
Schedule a
Job for execution at system time given by
the desiredTime parameter. |
void |
shutdown()
Shut down scheduler.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public boolean delete(Job job)
job
- job.public void schedule(Job job, long desiredTime)
Job
for execution at system time given by
the desiredTime
parameter.job
- job to schedule.desiredTime
- desired time of execution.public void schedule(Job job, long desiredTime, long period)
Job
for execution at system time given by
the desiredTime
parameter.
The job will be rescheduled. It will execute with a frequency determined
by the period parameter.job
- job to schedule.desiredTime
- desired time of execution.period
- repeat period.public boolean changePeriod(Job job, long newPeriod)
job
- job.newPeriod
- new repeat period.public void shutdown()
Copyright © 2002-2017 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.