org.objectweb.util.monolog.wrapper.remote.lib
Class MonologFactoryMBeanImpl

java.lang.Object
  extended byorg.objectweb.util.monolog.wrapper.remote.lib.MonologFactoryMBeanImpl
All Implemented Interfaces:
MonologFactoryMBean

public class MonologFactoryMBeanImpl
extends java.lang.Object
implements MonologFactoryMBean

Author:
S.Chassande-Barrioz

Constructor Summary
MonologFactoryMBeanImpl()
           
MonologFactoryMBeanImpl(MonologFactory mf)
           
 
Method Summary
 void addHandlerToLogger(java.lang.String handlername, java.lang.String loggerName)
          A TopicalLogger manages a list of Handler instances.
 void addTopicToLogger(java.lang.String topic, java.lang.String loggerName)
          This method allows adding a topic to a TopicalLogger.
 int compareTo(java.lang.String levelname1, java.lang.String levelname2)
          Compares two levels.
 boolean createHandler(java.lang.String hn, java.lang.String handlertype)
          Creates a new handler
 boolean defineLevel(java.lang.String name, int value)
          It defines a new Level with a name and an integer value.
 boolean defineLevel(java.lang.String name, java.lang.String value)
          It defines a new Level with a name and a string value.
 java.util.Map getAllHandlerAttributes()
          It retrieves the attributes of all handlers
 java.util.Map getHandlerAttributes(java.lang.String handlername)
          It retrieves the attributes of an handler
 java.lang.String[] getHandlerNames()
          It retrieves name of all handler managed by this factory.
 Level getLevel(int value)
          It retrieves a Level instance which the integer value is equals to the parameter.
 Level getLevel(java.lang.String name)
          It retrieves a Level instance which the name is equals to the parameter.
 Level[] getLevels()
          It retrieves all Level instances defined in this manager.
 LoggerInfo getLogger(java.lang.String loggername)
          Creates a logger if it does not exist.
 LoggerInfo getLogger(java.lang.String loggername, java.lang.String resourceBundleName)
          Creates a logger if it does not exist.
 LoggerInfo[] getLoggers()
          It retrieves a list of all loggers.
 java.util.Properties getMonologProperties()
           
 java.lang.String getResourceBundleName()
          Accessors to a resource bundle name associated to a LoggerFactory.
 void removeAllHandlersFromLogger(java.lang.String loggerName)
          A TopicalLogger manages a list of Handler instances.
 boolean removeHandler(java.lang.String handlername)
          It removes the handler which the name is specified by the parameter
 void removeHandlerFromLogger(java.lang.String handlerName, java.lang.String loggerName)
          A TopicalLogger manages a list of Handler instances.
 void removeLevel(java.lang.String name)
          It removes a Level instance to this manager.
 void removeTopicFromLogger(java.lang.String topic, java.lang.String loggerName)
          This method allows removing a topic to a TopicalLogger.
 void setAdditivity(boolean a, java.lang.String loggerName)
          It assigns the additivity flag for this logger instance.
 void setHandlerAttribute(java.lang.String handlername, java.lang.String attributeName, java.lang.String value)
          Assignes a value to an handler attribute.
 void setResourceBundleName(java.lang.String resourceBundleName)
          Accessors to a resource bundle name associated to a LoggerFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MonologFactoryMBeanImpl

public MonologFactoryMBeanImpl()

MonologFactoryMBeanImpl

public MonologFactoryMBeanImpl(MonologFactory mf)
Method Detail

defineLevel

public boolean defineLevel(java.lang.String name,
                           int value)
Description copied from interface: MonologFactoryMBean
It defines a new Level with a name and an integer value.

Specified by:
defineLevel in interface MonologFactoryMBean
Parameters:
name - is the name of the new level
value - is the integer value of the new level
Returns:
true if the level has been created.

defineLevel

public boolean defineLevel(java.lang.String name,
                           java.lang.String value)
Description copied from interface: MonologFactoryMBean
It defines a new Level with a name and a string value. The string value is analyzed to obtain the integer value.

Specified by:
defineLevel in interface MonologFactoryMBean
Parameters:
name - is the name of the new level
value - is the string value of the new level
Returns:
true if the level has been created.

removeLevel

public void removeLevel(java.lang.String name)
Description copied from interface: MonologFactoryMBean
It removes a Level instance to this manager.

Specified by:
removeLevel in interface MonologFactoryMBean

getLevel

public Level getLevel(java.lang.String name)
Description copied from interface: MonologFactoryMBean
It retrieves a Level instance which the name is equals to the parameter.

Specified by:
getLevel in interface MonologFactoryMBean
Parameters:
name - is the name of request Level
Returns:
a Leve instance or a null value if the level does not exist.

getLevel

public Level getLevel(int value)
Description copied from interface: MonologFactoryMBean
It retrieves a Level instance which the integer value is equals to the parameter.

Specified by:
getLevel in interface MonologFactoryMBean
Parameters:
value - is the integer value of request Level
Returns:
a Leve instance or a null value if the level does not exist. As it is possible to define several Levels which have the same integer value this methods returns the Level instance of first name found in the list.

getLevels

public Level[] getLevels()
Description copied from interface: MonologFactoryMBean
It retrieves all Level instances defined in this manager.

Specified by:
getLevels in interface MonologFactoryMBean

compareTo

public int compareTo(java.lang.String levelname1,
                     java.lang.String levelname2)
Description copied from interface: MonologFactoryMBean
Compares two levels.

Specified by:
compareTo in interface MonologFactoryMBean
Parameters:
levelname1 - is the name of the first level
levelname2 - is the name of the second level

createHandler

public boolean createHandler(java.lang.String hn,
                             java.lang.String handlertype)
Description copied from interface: MonologFactoryMBean
Creates a new handler

Specified by:
createHandler in interface MonologFactoryMBean
Parameters:
hn - is the name of the handler to create
handlertype - is the type of the parameter. The possible value are defined in this interface by the XXX_HANDLER_TYPE constants.
Returns:
true if the handler has been created

removeHandler

public boolean removeHandler(java.lang.String handlername)
Description copied from interface: MonologFactoryMBean
It removes the handler which the name is specified by the parameter

Specified by:
removeHandler in interface MonologFactoryMBean
Parameters:
handlername - is the name of the handler
Returns:
true if the handler has been removed.

getHandlerNames

public java.lang.String[] getHandlerNames()
Description copied from interface: MonologFactoryMBean
It retrieves name of all handler managed by this factory.

Specified by:
getHandlerNames in interface MonologFactoryMBean

getHandlerAttributes

public java.util.Map getHandlerAttributes(java.lang.String handlername)
Description copied from interface: MonologFactoryMBean
It retrieves the attributes of an handler

Specified by:
getHandlerAttributes in interface MonologFactoryMBean
Parameters:
handlername - is the name of the handler
Returns:
a map containing the association between an attribute name (String) and an attribute value (String).

getAllHandlerAttributes

public java.util.Map getAllHandlerAttributes()
Description copied from interface: MonologFactoryMBean
It retrieves the attributes of all handlers

Specified by:
getAllHandlerAttributes in interface MonologFactoryMBean
Returns:
Map( String handlername, Map(String attributename, String attributevalue) )

setHandlerAttribute

public void setHandlerAttribute(java.lang.String handlername,
                                java.lang.String attributeName,
                                java.lang.String value)
Description copied from interface: MonologFactoryMBean
Assignes a value to an handler attribute.

Specified by:
setHandlerAttribute in interface MonologFactoryMBean
Parameters:
handlername - is the name of the handler
attributeName - is the name of the attribute
value - is the new value of the attribute

getLogger

public LoggerInfo getLogger(java.lang.String loggername)
Description copied from interface: MonologFactoryMBean
Creates a logger if it does not exist.

Specified by:
getLogger in interface MonologFactoryMBean
Parameters:
loggername - is the name of the logger

getLogger

public LoggerInfo getLogger(java.lang.String loggername,
                            java.lang.String resourceBundleName)
Description copied from interface: MonologFactoryMBean
Creates a logger if it does not exist.

Specified by:
getLogger in interface MonologFactoryMBean
Parameters:
resourceBundleName - allows specifying the name of a resource bundle in order to internationalise the logging.

getResourceBundleName

public java.lang.String getResourceBundleName()
Description copied from interface: MonologFactoryMBean
Accessors to a resource bundle name associated to a LoggerFactory.

Specified by:
getResourceBundleName in interface MonologFactoryMBean

setResourceBundleName

public void setResourceBundleName(java.lang.String resourceBundleName)
Description copied from interface: MonologFactoryMBean
Accessors to a resource bundle name associated to a LoggerFactory.

Specified by:
setResourceBundleName in interface MonologFactoryMBean

getLoggers

public LoggerInfo[] getLoggers()
Description copied from interface: MonologFactoryMBean
It retrieves a list of all loggers.

Specified by:
getLoggers in interface MonologFactoryMBean

addHandlerToLogger

public void addHandlerToLogger(java.lang.String handlername,
                               java.lang.String loggerName)
Description copied from interface: MonologFactoryMBean
A TopicalLogger manages a list of Handler instances. This method allows adding a handler to this list. The addHandler method returns true only if the Handler did not exist

Specified by:
addHandlerToLogger in interface MonologFactoryMBean

removeHandlerFromLogger

public void removeHandlerFromLogger(java.lang.String handlerName,
                                    java.lang.String loggerName)
Description copied from interface: MonologFactoryMBean
A TopicalLogger manages a list of Handler instances. This method allows removing a handler to this list.

Specified by:
removeHandlerFromLogger in interface MonologFactoryMBean

removeAllHandlersFromLogger

public void removeAllHandlersFromLogger(java.lang.String loggerName)
Description copied from interface: MonologFactoryMBean
A TopicalLogger manages a list of Handler instances. This method allows removing all handler.

Specified by:
removeAllHandlersFromLogger in interface MonologFactoryMBean

setAdditivity

public void setAdditivity(boolean a,
                          java.lang.String loggerName)
Description copied from interface: MonologFactoryMBean
It assigns the additivity flag for this logger instance.

Specified by:
setAdditivity in interface MonologFactoryMBean

addTopicToLogger

public void addTopicToLogger(java.lang.String topic,
                             java.lang.String loggerName)
Description copied from interface: MonologFactoryMBean
This method allows adding a topic to a TopicalLogger. This actions change the hierarchical structure, but also the list of handlers. The list of handlers of a TopicalLogger is composed of its handlers and all handlers inherited from its parents. Adding a topic changes the inherited handlers list.

Specified by:
addTopicToLogger in interface MonologFactoryMBean

removeTopicFromLogger

public void removeTopicFromLogger(java.lang.String topic,
                                  java.lang.String loggerName)
Description copied from interface: MonologFactoryMBean
This method allows removing a topic to a TopicalLogger. This actions change the hierarchical structure, but also the list of handlers. The list of handlers of a TopicalLogger is composed of its handlers and all handlers inherited from its parents. Removing a topic changes the inherited handlers list.

Specified by:
removeTopicFromLogger in interface MonologFactoryMBean

getMonologProperties

public java.util.Properties getMonologProperties()
Specified by:
getMonologProperties in interface MonologFactoryMBean