atg.nucleus.logging
Class LoggingQueue

java.lang.Object
  extended by java.lang.Thread
      extended by atg.nucleus.logging.LoggingQueue
All Implemented Interfaces:
java.lang.Runnable

public class LoggingQueue
extends java.lang.Thread

This is a simple thread that contains a GovernorQueue. It accepts LogEvents which it adds to the queue and writes out the log events as allowed.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 LogListener mListener
          The listener queued events are written to.
 int mMaxNormalSize
          The queue size threshold at which the thread ceases to run at its normal priority and becomes active.
 int mMinActiveSize
          The queue size threshold at which the thread ceases to be active.
 atg.core.util.GovernorQueue mQueue
          The actual queue.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
LoggingQueue(LogListener pListener, int pMinActiveSize, int pMaxNormalSize)
          Constructs a LoggingQueue.
 
Method Summary
 void flush()
          Flush all entries from the queue.
 void processQueueEntry()
          Gets a log event out of the queue and writes it to the listener.
 void queueLogEvent(LogEvent pLogEvent)
          Adds the given log event to the queue.
 void run()
          Asynchronous thread that collects log entries and writes them.
 
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

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mMinActiveSize

public int mMinActiveSize
The queue size threshold at which the thread ceases to be active.


mMaxNormalSize

public int mMaxNormalSize
The queue size threshold at which the thread ceases to run at its normal priority and becomes active.


mQueue

public atg.core.util.GovernorQueue mQueue
The actual queue.


mListener

public LogListener mListener
The listener queued events are written to.

Constructor Detail

LoggingQueue

public LoggingQueue(LogListener pListener,
                    int pMinActiveSize,
                    int pMaxNormalSize)
Constructs a LoggingQueue.

Parameters:
pListener - the listener
pMinActiveSize - the minimum active size
pMaxNormalSize - the maximum active size
Method Detail

run

public void run()
Asynchronous thread that collects log entries and writes them.

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

queueLogEvent

public void queueLogEvent(LogEvent pLogEvent)
Adds the given log event to the queue.

Parameters:
pLogEvent - the log event

processQueueEntry

public void processQueueEntry()
Gets a log event out of the queue and writes it to the listener.


flush

public void flush()
Flush all entries from the queue.