org.objectweb.util.monolog.wrapper.log4j
Class JMXHandler

java.lang.Object
  extended by org.apache.log4j.AppenderSkeleton
      extended by org.objectweb.util.monolog.wrapper.log4j.JMXHandler
All Implemented Interfaces:
NotificationBroadcaster, NotificationEmitter, org.apache.log4j.Appender, org.apache.log4j.spi.OptionHandler, Handler

public class JMXHandler
extends org.apache.log4j.AppenderSkeleton
implements NotificationEmitter, Handler

Author:
Sebastien Chassande-Barrioz

Field Summary
protected  HashMap prop
          This fields contains the properties of the Handler
 
Fields inherited from class org.apache.log4j.AppenderSkeleton
closed, errorHandler, headFilter, layout, name, tailFilter, threshold
 
Fields inherited from interface org.objectweb.util.monolog.api.Handler
APPEND_MODE_ATTRIBUTE, BUFFER_ATTRIBUTE, CONSOLE_HANDLER_TYPE, FILE_HANDLER_TYPE, FILE_NUMBER_ATTRIBUTE, GENERIC_HANDLER_TYPE, JMX_HANDLER_TYPE, LEVEL_ATTRIBUTE, LOGGER_HANDLER_TYPE, MAX_SIZE_ATTRIBUTE, OUTPUT_ATTRIBUTE, PATTERN_ATTRIBUTE, ROLLING_FILE_HANDLER_TYPE
 
Constructor Summary
JMXHandler()
           
JMXHandler(String name)
          It Builds a new JMXHandler.
 
Method Summary
 void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
protected  void append(org.apache.log4j.spi.LoggingEvent event)
           
 void close()
           
 void doAppend(org.apache.log4j.spi.LoggingEvent event)
           
 Object getAttribute(String key)
           
 String[] getAttributeNames()
           
 Map getAttributes()
           
 MBeanNotificationInfo[] getNotificationInfo()
           
 String getType()
           
 void removeNotificationListener(NotificationListener listener)
           
 void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback)
           
 boolean requiresLayout()
           
 Object setAttribute(String key, Object value)
           
 void setAttributes(Map attributes)
           
 
Methods inherited from class org.apache.log4j.AppenderSkeleton
activateOptions, addFilter, clearFilters, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.util.monolog.api.Handler
getName, setName
 

Field Detail

prop

protected HashMap prop
This fields contains the properties of the Handler

Constructor Detail

JMXHandler

public JMXHandler()

JMXHandler

public JMXHandler(String name)
It Builds a new JMXHandler.

Parameters:
name - is the handler name.
Method Detail

addNotificationListener

public void addNotificationListener(NotificationListener listener,
                                    NotificationFilter filter,
                                    Object handback)
                             throws IllegalArgumentException
Specified by:
addNotificationListener in interface NotificationBroadcaster
Throws:
IllegalArgumentException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationBroadcaster
Throws:
ListenerNotFoundException

removeNotificationListener

public void removeNotificationListener(NotificationListener listener,
                                       NotificationFilter filter,
                                       Object handback)
                                throws ListenerNotFoundException
Specified by:
removeNotificationListener in interface NotificationEmitter
Throws:
ListenerNotFoundException

getNotificationInfo

public MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface NotificationBroadcaster

getAttributes

public Map getAttributes()

setAttributes

public void setAttributes(Map attributes)

getType

public String getType()
Specified by:
getType in interface Handler

getAttributeNames

public String[] getAttributeNames()
Specified by:
getAttributeNames in interface Handler

getAttribute

public Object getAttribute(String key)
Specified by:
getAttribute in interface Handler

setAttribute

public Object setAttribute(String key,
                           Object value)
Specified by:
setAttribute in interface Handler

doAppend

public void doAppend(org.apache.log4j.spi.LoggingEvent event)
Specified by:
doAppend in interface org.apache.log4j.Appender
Overrides:
doAppend in class org.apache.log4j.AppenderSkeleton

append

protected void append(org.apache.log4j.spi.LoggingEvent event)
Specified by:
append in class org.apache.log4j.AppenderSkeleton

close

public void close()
Specified by:
close in interface org.apache.log4j.Appender

requiresLayout

public boolean requiresLayout()
Specified by:
requiresLayout in interface org.apache.log4j.Appender


Copyright © 2012 OW2 Consortium. All Rights Reserved.