ThreadPools.scheduler). If scheduling is not used, then only the
thread group is special, which can just as well be obtained by MMBaseContext.getThreadGroup().public class DaemonThread extends Thread implements DaemonTask
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_SLEEP_PERIOD
Deprecated.
Default sleep period for a daemon thread (one minute).
|
protected int |
sleepPeriod
Deprecated.
The threads sleep period.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
DaemonThread()
Deprecated.
Create a MMBase daemon thread (associated with this MMBase's threadgroup).
|
DaemonThread(Runnable target,
String name)
Deprecated.
Create a MMBase daemon thread (associated with this MMBase's threadgroup).
|
DaemonThread(String name)
Deprecated.
Create a MMBase daemon thread (associated with this MMBase's threadgroup).
|
| Modifier and Type | Method and Description |
|---|---|
void |
executeTask()
Deprecated.
Defines a task that need be run by a daemon thread's run() method.
|
int |
getSleepPeriod()
Deprecated.
Returns this task's sleep period.
|
DaemonTask |
getTask()
Deprecated.
Returns the task this thread runs when started.
|
void |
interrupt()
Deprecated.
|
boolean |
isRunning()
Deprecated.
|
void |
run()
Deprecated.
Default behavior (when no target is specified) is to run continuously until interrupted.
|
void |
setTask(DaemonTask task)
Deprecated.
Sets the task this thread should run when started.
|
void |
start()
Deprecated.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yieldpublic static final int DEFAULT_SLEEP_PERIOD
protected int sleepPeriod
public DaemonThread()
public DaemonThread(String name)
name - the name of the threadpublic void setTask(DaemonTask task)
task - the task to runpublic DaemonTask getTask()
public int getSleepPeriod()
DaemonTaskgetSleepPeriod in interface DaemonTaskpublic boolean isRunning()
public void executeTask()
DaemonTaskexecuteTask in interface DaemonTaskMMBase 1.9-SNAPSHOT - ${javadoctimestamp}