org.apache.avalon.excalibur.thread.impl
Class SimpleWorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.apache.excalibur.thread.impl.WorkerThread
          extended by org.apache.avalon.excalibur.thread.impl.SimpleWorkerThread
All Implemented Interfaces:
java.lang.Runnable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.framework.logger.LogEnabled

 class SimpleWorkerThread
extends WorkerThread
implements org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.framework.logger.LogEnabled

This class extends the Thread class to add recyclable functionalities.

Author:
Avalon Development Team

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  org.apache.avalon.framework.logger.Logger m_detailLogger
          Log minor detail events like
private  org.apache.avalon.framework.logger.Logger m_logger
          Log major events like uncaught exceptions and worker creation and deletion.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected SimpleWorkerThread(AbstractThreadPool pool, java.lang.ThreadGroup group, java.lang.String name)
          Allocates a new Worker object.
 
Method Summary
protected  void debug(java.lang.String message)
          Used to log major events against the worker.
protected  void debug(java.lang.String message, java.lang.Throwable throwable)
          Used to log major events against the worker.
protected  void detailDebug(java.lang.String message)
          Used to log minor events against the worker.
protected  void detailDebug(java.lang.String message, java.lang.Throwable throwable)
          Used to log minor events against the worker.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
           
 
Methods inherited from class org.apache.excalibur.thread.impl.WorkerThread
clearInterruptFlag, dispose, execute, executeAndWait, postExecute, preExecute, recycleThread, run
 
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, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_logger

private org.apache.avalon.framework.logger.Logger m_logger
Log major events like uncaught exceptions and worker creation and deletion. Stuff that is useful to be able to see over long periods of time.


m_detailLogger

private org.apache.avalon.framework.logger.Logger m_detailLogger
Log minor detail events like

Constructor Detail

SimpleWorkerThread

protected SimpleWorkerThread(AbstractThreadPool pool,
                             java.lang.ThreadGroup group,
                             java.lang.String name)
Allocates a new Worker object.

Method Detail

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled

debug

protected void debug(java.lang.String message)
Used to log major events against the worker. Creation, deletion, uncaught exceptions etc.

Overrides:
debug in class WorkerThread
Parameters:
message - Message to log.

debug

protected void debug(java.lang.String message,
                     java.lang.Throwable throwable)
Used to log major events against the worker. Creation, deletion, uncaught exceptions etc.

Overrides:
debug in class WorkerThread
Parameters:
message - Message to log.
throwable - Throwable to log with the message.

detailDebug

protected void detailDebug(java.lang.String message)
Used to log minor events against the worker. Start and stop of individual pieces of work etc. Separated from the major events so that they are not lost in a sea of minor events.

Overrides:
detailDebug in class WorkerThread
Parameters:
message - Message to log.

detailDebug

protected void detailDebug(java.lang.String message,
                           java.lang.Throwable throwable)
Used to log minor events against the worker. Start and stop of individual pieces of work etc. Separated from the major events so that they are not lost in a sea of minor events.

Overrides:
detailDebug in class WorkerThread
Parameters:
message - Message to log.
throwable - Throwable to log with the message.