| |
|
| java.lang.Object java.lang.Thread org.mmbase.core.util.DaemonThread
All known Subclasses: org.mmbase.module.ModuleProbe,
DaemonThread | public class DaemonThread extends Thread implements DaemonTask(Code) | | Defines a daemon thread that runs in the threadgroup belonging to this MMBase context.
since: MMBase-1.8 author: Pierre van Rooden version: $Id: DaemonThread.java,v 1.2 2005/12/10 11:45:02 michiel Exp $ |
Field Summary | |
final public static int | DEFAULT_SLEEP_PERIOD Default sleep period for a daemon thread (one minute). | protected int | sleepPeriod The threads sleep period. |
Constructor Summary | |
public | DaemonThread() Create a MMBase daemon thread (associated with this MMBase's threadgroup). | public | DaemonThread(String name) Create a MMBase daemon thread (associated with this MMBase's threadgroup). | public | DaemonThread(Runnable target, String name) Create a MMBase daemon thread (associated with this MMBase's threadgroup). |
DEFAULT_SLEEP_PERIOD | final public static int DEFAULT_SLEEP_PERIOD(Code) | | Default sleep period for a daemon thread (one minute).
|
sleepPeriod | protected int sleepPeriod(Code) | | The threads sleep period.
This period is used when a Daemonthread runs on its own (that is, without an assigned task)
When a DaemonThread is assigned a task, it uses the sleep period of that task.
|
DaemonThread | public DaemonThread()(Code) | | Create a MMBase daemon thread (associated with this MMBase's threadgroup).
|
DaemonThread | public DaemonThread(String name)(Code) | | Create a MMBase daemon thread (associated with this MMBase's threadgroup).
Parameters: name - the name of the thread |
DaemonThread | public DaemonThread(Runnable target, String name)(Code) | | Create a MMBase daemon thread (associated with this MMBase's threadgroup).
Parameters: target - the target thread Parameters: name - the name of the thread |
executeTask | public void executeTask()(Code) | | |
getSleepPeriod | public int getSleepPeriod()(Code) | | |
getTask | public DaemonTask getTask()(Code) | | Returns the task this thread runs when started.
|
interrupt | public void interrupt()(Code) | | |
isRunning | public boolean isRunning()(Code) | | |
run | public void run()(Code) | | Default behavior (when no target is specified) is to run continuously until interrupted.
|
setTask | public void setTask(DaemonTask task)(Code) | | Sets the task this thread should run when started.
Parameters: task - the task to run |
start | public void start()(Code) | | |
|
|
|