Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

jreceiver.util
Class Daemon  view Daemon download Daemon.java

java.lang.Object
  extended byjreceiver.util.Daemon
Direct Known Subclasses:
ScheduledDaemon

public abstract class Daemon
extends java.lang.Object

Generic daemon to which clients can subscribe to status messages.

Version:
$Revision: 1.6 $ $Date: 2003/05/16 04:47:22 $

Field Summary
private static boolean keep_running
          used to smoothly stop a thread
protected static org.apache.commons.logging.Log log
          logging object
protected  java.lang.String thread_name
          a name for the worker thread
protected  java.lang.Thread worker_thread
          a handle to the worker thread
 
Constructor Summary
Daemon(java.lang.String thread_name)
          ctor
 
Method Summary
protected abstract  void doWork()
          the work done in the worker thread
protected  java.lang.Thread makeThread()
           
protected  void sleep(int n)
          sleep for n milliseconds, or until the thread is interrupted.
 void start()
          Commence doing stuff
 void stop()
          Cease doing stuff
protected  boolean stopping()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

worker_thread

protected java.lang.Thread worker_thread
a handle to the worker thread


thread_name

protected java.lang.String thread_name
a name for the worker thread


keep_running

private static volatile boolean keep_running
used to smoothly stop a thread


log

protected static org.apache.commons.logging.Log log
logging object

Constructor Detail

Daemon

public Daemon(java.lang.String thread_name)
ctor

Method Detail

doWork

protected abstract void doWork()
the work done in the worker thread


start

public void start()
Commence doing stuff


stop

public void stop()
Cease doing stuff


stopping

protected boolean stopping()

makeThread

protected java.lang.Thread makeThread()

sleep

protected void sleep(int n)
sleep for n milliseconds, or until the thread is interrupted.