org.safs.staf.service.logging
Class SLSLogFacility.WorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.safs.staf.service.logging.SLSLogFacility.WorkerThread
All Implemented Interfaces:
java.lang.Runnable
Enclosing class:
SLSLogFacility

protected abstract class SLSLogFacility.WorkerThread
extends java.lang.Thread

This is the worker thread that fulfills the log message request received by this log facility. This thread constantly checks the request queue for incoming log message requests and carries them out. It only exits the run method if an EXIT request is found on the queue.

Subclass of SLSLogFacility should derive its worker thread class from this class and implement the log method.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
SLSLogFacility.WorkerThread()
           
 
Method Summary
protected abstract  void log(SLSLogFacility.WorkerRequest r)
          Fulfills the logging request.
 void run()
          Runs in a indefinite loop checking for queued request.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SLSLogFacility.WorkerThread

public SLSLogFacility.WorkerThread()
Method Detail

run

public void run()
Runs in a indefinite loop checking for queued request. The interval of the loop is acutally quite long. It assumes that the log facility will interrupt this thread when a new request is queued. This method exits when an EXIT request is found.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

log

protected abstract void log(SLSLogFacility.WorkerRequest r)
Fulfills the logging request.

Parameters:
r - the LOG request from the queue.