JBoss LogManager 1.1.0.CR6

org.jboss.logmanager.handlers
Class AsyncHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by org.jboss.logmanager.ExtHandler
          extended by org.jboss.logmanager.handlers.AsyncHandler
All Implemented Interfaces:
Flushable

public class AsyncHandler
extends ExtHandler

An asycnhronous log handler which is used to write to a handler or group of handlers which are "slow" or introduce some degree of latency.


Nested Class Summary
static class AsyncHandler.OverflowAction
           
 
Field Summary
 
Fields inherited from class org.jboss.logmanager.ExtHandler
handlers, handlersUpdater
 
Constructor Summary
AsyncHandler()
          Construct a new instance.
AsyncHandler(int queueLength)
          Construct a new instance.
AsyncHandler(int queueLength, ThreadFactory threadFactory)
          Construct a new instance.
AsyncHandler(ThreadFactory threadFactory)
          Construct a new instance.
 
Method Summary
 void close()
          
protected  void doPublish(ExtLogRecord record)
          Do the actual work of publication; the record will have been filtered already.
 void flush()
          
 AsyncHandler.OverflowAction getOverflowAction()
          Get the overflow action.
 void setOverflowAction(AsyncHandler.OverflowAction overflowAction)
          Set the overflow action.
 
Methods inherited from class org.jboss.logmanager.ExtHandler
addHandler, checkAccess, clearHandlers, getHandlers, isAutoFlush, publish, publish, removeHandler, setAutoFlush, setHandlers
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsyncHandler

public AsyncHandler(int queueLength,
                    ThreadFactory threadFactory)
Construct a new instance.

Parameters:
queueLength - the queue length
threadFactory - the thread factory to use to construct the handler thread

AsyncHandler

public AsyncHandler(ThreadFactory threadFactory)
Construct a new instance.

Parameters:
threadFactory - the thread factory to use to construct the handler thread

AsyncHandler

public AsyncHandler(int queueLength)
Construct a new instance.

Parameters:
queueLength - the queue length

AsyncHandler

public AsyncHandler()
Construct a new instance.

Method Detail

getOverflowAction

public AsyncHandler.OverflowAction getOverflowAction()
Get the overflow action.

Returns:
the overflow action

setOverflowAction

public void setOverflowAction(AsyncHandler.OverflowAction overflowAction)
Set the overflow action.

Parameters:
overflowAction - the overflow action

doPublish

protected void doPublish(ExtLogRecord record)
Do the actual work of publication; the record will have been filtered already. The default implementation does nothing except to flush if the autoFlush property is set to true; if this behavior is to be preserved in a subclass then this method should be called after the record is physically written.

Overrides:
doPublish in class ExtHandler
Parameters:
record - the log record to publish

flush

public void flush()

Specified by:
flush in interface Flushable
Specified by:
flush in class Handler

close

public void close()
           throws SecurityException

Specified by:
close in class Handler
Throws:
SecurityException

JBoss LogManager 1.1.0.CR6

Copyright © 2009 JBoss, a division of Red Hat, Inc.