Log4j 1.3alpha-3

org.apache.log4j.chainsaw
Class ChainsawAppenderHandler

java.lang.Object
  |
  +--org.apache.log4j.AppenderSkeleton
        |
        +--org.apache.log4j.chainsaw.ChainsawAppenderHandler
All Implemented Interfaces:
Appender, OptionHandler

public class ChainsawAppenderHandler
extends AppenderSkeleton

A handler class that either extends a particular appender hierarchy or can be bound into the Log4j appender framework, and queues events, to be later dispatched to registered/interested parties.

Author:
Scott Deboy , Paul Smith

Field Summary
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Constructor Summary
ChainsawAppenderHandler()
           
ChainsawAppenderHandler(ChainsawAppender appender)
           
 
Method Summary
 void activateOptions()
          Derived appenders should override this method if option structure requires it.
 void addCustomEventBatchListener(java.lang.String identifier, EventBatchListener l)
           
 void addEventBatchListener(EventBatchListener l)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 void append(LoggingEvent event)
          Subclasses of AppenderSkeleton should implement this method to perform actual logging.
 void close()
          Release any resources allocated within the appender such as file handles, network connections, etc.
 double getDataRate()
          Exposes the current Data rate calculated.
 java.lang.String getIdentifierExpression()
           
 int getQueueInterval()
           
static void main(java.lang.String[] args)
          A little test bed
 void removeEventBatchListener(EventBatchListener l)
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 boolean requiresLayout()
           
 void setIdentifierExpression(java.lang.String identifierExpression)
           
 void setQueueInterval(int interval)
           
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
addFilter, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getLogger, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainsawAppenderHandler

public ChainsawAppenderHandler(ChainsawAppender appender)

ChainsawAppenderHandler

public ChainsawAppenderHandler()
Method Detail

setIdentifierExpression

public void setIdentifierExpression(java.lang.String identifierExpression)

getIdentifierExpression

public java.lang.String getIdentifierExpression()

addCustomEventBatchListener

public void addCustomEventBatchListener(java.lang.String identifier,
                                        EventBatchListener l)
                                 throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException

addEventBatchListener

public void addEventBatchListener(EventBatchListener l)

removeEventBatchListener

public void removeEventBatchListener(EventBatchListener l)

append

public void append(LoggingEvent event)
Description copied from class: AppenderSkeleton
Subclasses of AppenderSkeleton should implement this method to perform actual logging. See also AppenderSkeleton.doAppend method.

Specified by:
append in class AppenderSkeleton

close

public void close()
Description copied from interface: Appender
Release any resources allocated within the appender such as file handles, network connections, etc.

It is a programming error to append to a closed appender.


activateOptions

public void activateOptions()
Description copied from class: AppenderSkeleton
Derived appenders should override this method if option structure requires it.

Specified by:
activateOptions in interface OptionHandler
Overrides:
activateOptions in class AppenderSkeleton

requiresLayout

public boolean requiresLayout()

getQueueInterval

public int getQueueInterval()

setQueueInterval

public void setQueueInterval(int interval)

main

public static void main(java.lang.String[] args)
                 throws java.lang.InterruptedException
A little test bed

Parameters:
args -
java.lang.InterruptedException

getDataRate

public double getDataRate()
Exposes the current Data rate calculated. This is periodically updated by an internal Thread as is the number of events that have been processed, and dispatched to all listeners since the last sample period divided by the number of seconds since the last sample period. This method fires a PropertyChange event so listeners can monitor the rate

Returns:
double # of events processed per second

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Parameters:
listener -

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Parameters:
propertyName -
listener -

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Parameters:
listener -

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Parameters:
propertyName -
listener -

Log4j 1.3alpha-3

Copyright 2000-2003 Apache Software Foundation.