|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatg.nucleus.logging.VariableArgumentApplicationLoggingImpl
atg.nucleus.GenericService
atg.nucleus.logging.QueueingLogger
public class QueueingLogger
The QueueingLogger is made to sit on top of a single LogListener, queueing log events so they don't actually get written out to the LogListener until a more convenient time. This is done by putting the log events into a GovernorQueue. A single underlying LogListener for writing queued log events is used instead of using the list of LogListeners added via the addLogEventListener() method because QueueingLogger messages may not necessarily want to be written directly out, but queued as well. Adding a QueueingLogger to it's own list of log event listeners is a valid (and probably desirous) configuration. For convenient's sake, the QueueingLogger also has a switch for turning the queue on and off. When off, the log events will be written straight through to the underlying LogListener, bypassing the queue.
GovernorQueue
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
LogListener |
mFinalLogListener
The underlying LogListener. |
LoggingQueue |
mQueue
The logging queue. |
boolean |
mQueueing
Whether or not log events should be queued. |
int |
mQueueMaxNormalSize
The queue size threshold at which the thread ceases to run at its normal priority and becomes active. |
int |
mQueueMinActiveSize
The queue size threshold at which the thread ceases to be active. |
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
QueueingLogger()
Constructs an uninitialized QueueingLogger. |
Method Summary | |
---|---|
void |
doStartService()
This is called after the service has been created, added to the Registry, and configured. |
void |
doStopService()
This is called when the service is to be stopped. |
LogListener |
getFinalLogListener()
Returns the underlying LogListener to which queued log events are being written to. |
boolean |
getQueueing()
Returns whether queueing on or off. |
int |
getQueueMaxNormalSize()
Returns the queue size threshold at which the thread ceases to run at its normal priority and becomes active. |
int |
getQueueMinActiveSize()
Returns the queue size threshold at which the thread ceases to be active. |
void |
logEvent(LogEvent pLogEvent)
Logs the given log event. |
void |
setFinalLogListener(LogListener pLogListener)
Sets the underlying LogListener to which queued log events will be written to. |
void |
setQueueing(boolean pQueueing)
Turn queueing on or off. |
void |
setQueueMaxNormalSize(int pQueueMaxNormalSize)
Sets the queue size threshold at which the thread ceases to run at its normal priority and becomes active. |
void |
setQueueMinActiveSize(int pQueueMinActiveSize)
Sets the queue size threshold at which the thread ceases to be active. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
public boolean mQueueing
public int mQueueMinActiveSize
public int mQueueMaxNormalSize
public LogListener mFinalLogListener
public LoggingQueue mQueue
Constructor Detail |
---|
public QueueingLogger()
Method Detail |
---|
public void setQueueing(boolean pQueueing)
pQueueing
- flag if queuing is onpublic void setQueueMinActiveSize(int pQueueMinActiveSize)
pQueueMinActiveSize
- the minimum threshholdpublic void setQueueMaxNormalSize(int pQueueMaxNormalSize)
pQueueMaxNormalSize
- the maximum threshholdpublic void setFinalLogListener(LogListener pLogListener)
pLogListener
- the log listenerpublic boolean getQueueing()
public int getQueueMinActiveSize()
public int getQueueMaxNormalSize()
public LogListener getFinalLogListener()
public void doStartService() throws ServiceException
doStartService
in class GenericService
ServiceException
- if an error occurred during the operationpublic void doStopService() throws ServiceException
doStopService
in class GenericService
ServiceException
- if an error occurred during the operationpublic void logEvent(LogEvent pLogEvent)
logEvent
in interface LogListener
pLogEvent
- the log event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |