|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.resilientedge.util.logger.LoggerWorker
A LoggerWorker object represents a unit of logging work that is to be performed asynchronously. Essentially, a unit of logging work means "the processing by each of a Logger's handlers of a single logRecord."
A LoggerWorker can be used as follows: A Logger should establish a WorkerPool where the LogWorker is identified in the WorkPool's init(). Once the WorkerPool is properly created, the logger can call the pools doWork() method, passing doWork() the logRecord to be asynchronously processed.
Work
,
WorkerPool
Constructor Summary | |
LoggerWorker()
Default constructor. |
Method Summary | |
void |
dispose()
This is called when the object is being removed from the worker pool. |
java.lang.Object |
doWork(java.lang.Object obj)
This is invoked through the worker pool to perform a unit of work on a secondary thread. |
protected void |
forwardToHandlers(LogRecord logRecord)
This method forwards a LogRecord to each of the Logger's Handlers for processing and exporting. |
void |
init()
Initialization is invoked after the object is instantiated, and before it is added to a worker pool. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LoggerWorker()
Method Detail |
public void init()
init
in interface Work
public void dispose()
dispose
in interface Work
public java.lang.Object doWork(java.lang.Object obj)
doWork
in interface Work
obj
- the LogRecord that is to be processed by the handlers.protected void forwardToHandlers(LogRecord logRecord)
logRecord
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |