|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
net.spy.SpyThread
net.spy.cron.Cron
public final class Cron
Watches a JobQueue and invokes the Jobs when they're ready.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary |
|---|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
Cron(JobQueue jq)
Get a new Cron instance operating on the given queue. |
|
Cron(java.lang.String name,
JobQueue jq)
Get a new Cron instance with a name, JobQueue and the default thread pool. |
|
Cron(java.lang.String name,
JobQueue jq,
ThreadPool tp)
Get a new Cron object operating on the given queue. |
|
| Method Summary | |
|---|---|
JobQueue |
getJobQueue()
Get the current job queue. |
boolean |
isRunning()
True if this Cron instance is still running. |
static void |
main(java.lang.String[] args)
Run a Cron instance against a FileJobQueue. |
void |
run()
Do the run thing. |
void |
setMaxIdleTime(long maxIdleTime)
Set the maximum amount of time the cron thread will continue running with no jobs. |
void |
shutdown()
Shut down the queue. |
java.lang.String |
toString()
String me. |
| Methods inherited from class net.spy.SpyThread |
|---|
getLogger |
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, 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, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Cron(JobQueue jq)
jq - the job queue to watch
public Cron(java.lang.String name,
JobQueue jq)
name - name of the cron instancejq - the queue to watch
public Cron(java.lang.String name,
JobQueue jq,
ThreadPool tp)
name - thread namejq - job queue to watchtp - the thread pool| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Threadpublic JobQueue getJobQueue()
public void shutdown()
public boolean isRunning()
public void run()
run in interface java.lang.Runnablerun in class java.lang.Threadpublic void setMaxIdleTime(long maxIdleTime)
maxIdleTime - maximum amount of time in milliseconds
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||