|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.mmbase.core.util.DaemonThread
Defines a daemon thread that runs in the threadgroup belonging to this MMBase context.
| Field Summary | |
static int |
DEFAULT_SLEEP_PERIOD
Default sleep period for a daemon thread (one minute). |
protected int |
sleepPeriod
The threads sleep period. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
DaemonThread()
Create a MMBase daemon thread (associated with this MMBase's threadgroup). |
|
DaemonThread(Runnable target,
String name)
Create a MMBase daemon thread (associated with this MMBase's threadgroup). |
|
DaemonThread(String name)
Create a MMBase daemon thread (associated with this MMBase's threadgroup). |
|
| Method Summary | |
void |
executeTask()
Defines a task that need be run by a daemon thread's run() method. |
int |
getSleepPeriod()
Returns this task's sleep period. |
DaemonTask |
getTask()
Returns the task this thread runs when started. |
void |
interrupt()
|
boolean |
isRunning()
|
void |
run()
Default behavior (when no target is specified) is to run continuously until interrupted. |
void |
setTask(DaemonTask task)
Sets the task this thread should run when started. |
void |
start()
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DEFAULT_SLEEP_PERIOD
protected int sleepPeriod
| Constructor Detail |
public DaemonThread()
public DaemonThread(String name)
name - the name of the thread
public DaemonThread(Runnable target,
String name)
target - the target threadname - the name of the thread| Method Detail |
public void setTask(DaemonTask task)
task - the task to runpublic DaemonTask getTask()
public int getSleepPeriod()
DaemonTask
getSleepPeriod in interface DaemonTaskpublic void start()
public void interrupt()
public boolean isRunning()
public void executeTask()
DaemonTask
executeTask in interface DaemonTaskpublic void run()
run in interface Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||