org.objectweb.util.monolog.wrapper.log4jMini
Class MonologCategory

java.lang.Object
  extended byorg.objectweb.util.monolog.wrapper.log4jMini.MonologCategory
All Implemented Interfaces:
Handler, Logger, TopicalLogger

public class MonologCategory
extends java.lang.Object
implements TopicalLogger


Nested Class Summary
 class MonologCategory.OwPriority
           
 
Field Summary
protected  org.apache.log4j.Category category
           
protected  boolean enable
           
protected  java.util.Hashtable handlers
           
protected  MonologCategory.OwPriority interPriority
           
 
Fields inherited from interface org.objectweb.util.monolog.api.Handler
APPEND_MODE_ATTRIBUTE, CONSOLE_HANDLER_TYPE, FILE_HANDLER_TYPE, FILE_NUMBER_ATTRIBUTE, GENERIC_HANDLER_TYPE, LOGGER_HANDLER_TYPE, MAX_SIZE_ATTRIBUTE, OUTPUT_ATTRIBUTE, PATTERN_ATTRIBUTE, ROLLING_FILE_HANDLER_TYPE
 
Constructor Summary
MonologCategory(org.apache.log4j.Category category)
           
 
Method Summary
 void addHandler(Handler h)
          Add a handler in the Handler list of the topicalLogger
 void addTopic(java.lang.String topic)
          Add a topic to the topicalLogger
 boolean getAdditivity()
          It retrieves the additivity flag for this logger instance.
 java.lang.Object getAttribute(java.lang.String name)
          It retrieves the value of an attribute value of the handler.
 java.lang.String[] getAttributeNames()
          It retrieves the attributes of the handler
 int getCurrentIntLevel()
          Return the current Level of the logger
 Level getCurrentLevel()
          Returns the current level value under the Level format
 Handler[] getHandler()
          It returns the list of the handler associated to this logger.
 Handler getHandler(java.lang.String hn)
          It returns the handler which the name is equals to the parameter
 java.lang.String getName()
          It retrieves the name of the handler
 java.lang.String[] getTopic()
          This method allows getting a topic list of this TopicalLogger.
 java.util.Enumeration getTopics()
          Returns the list of the different names of the topicalLogger
 byte getType()
          It retrieves the Handler type
 boolean isLoggable(int level)
          Check if the level parameter are not filtered by the logger
 boolean isLoggable(Level l)
          Check if a message of the given level would actually be logged by this logger.
 boolean isOn()
          Is the handler enabled
 void log(int level, java.lang.Object o)
          Log an object with a specific level.
 void log(int level, java.lang.Object o, java.lang.Object location, java.lang.Object method)
          Log an object and a trowable with a specific level.
 void log(int level, java.lang.Object o, java.lang.Throwable t)
          Log an object and a trowable with a specific level.
 void log(int level, java.lang.Object o, java.lang.Throwable t, java.lang.Object location, java.lang.Object method)
          Log an object and a trowable with a specific level.
 void log(Level l, java.lang.Object o)
          Log a message, with no arguments.
 void log(Level l, java.lang.Object o, java.lang.Object location, java.lang.Object method)
          Log a message, with a location and method arguments.
 void log(Level l, java.lang.Object o, java.lang.Throwable t)
          Log a message, with a throwable arguments which can represent an error or a context..
 void log(Level l, java.lang.Object o, java.lang.Throwable t, java.lang.Object location, java.lang.Object method)
          Log a message, with a location, method and throwable arguments.
 void removeAllHandlers()
          A TopicalLogger manages a list of Handler instances.
 void removeHandler(Handler h)
          Remove a handler from the Handler list of the topicalLogger
 void removeTopic(java.lang.String topic)
          Remove a topic from the topicalLogger
 void setAdditivity(boolean a)
          It assigns the additivity flag for this logger instance.
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
          It assigns an attributte to the handler.
 void setIntLevel(int level)
          Set the current level of the logger
 void setLevel(Level l)
          Permits to set the level with a Level instance.
 void setName(java.lang.String name)
          It assigns the name of the handler
 void turnOff()
          Disable the handler
 void turnOn()
          Enable the handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handlers

protected java.util.Hashtable handlers

enable

protected boolean enable

category

protected org.apache.log4j.Category category

interPriority

protected MonologCategory.OwPriority interPriority
Constructor Detail

MonologCategory

public MonologCategory(org.apache.log4j.Category category)
Method Detail

setIntLevel

public void setIntLevel(int level)
Set the current level of the logger

Specified by:
setIntLevel in interface Logger

setLevel

public void setLevel(Level l)
Description copied from interface: Logger
Permits to set the level with a Level instance.

Specified by:
setLevel in interface Logger

getCurrentIntLevel

public int getCurrentIntLevel()
Return the current Level of the logger

Specified by:
getCurrentIntLevel in interface Logger

getCurrentLevel

public Level getCurrentLevel()
Description copied from interface: Logger
Returns the current level value under the Level format

Specified by:
getCurrentLevel in interface Logger

isLoggable

public boolean isLoggable(int level)
Check if the level parameter are not filtered by the logger

Specified by:
isLoggable in interface Logger

isLoggable

public boolean isLoggable(Level l)
Description copied from interface: Logger
Check if a message of the given level would actually be logged by this logger.

Specified by:
isLoggable in interface Logger

isOn

public boolean isOn()
Is the handler enabled

Specified by:
isOn in interface Logger

log

public void log(int level,
                java.lang.Object o)
Log an object with a specific level. If the level parameter is loggable the object is handled.

Specified by:
log in interface Logger

log

public void log(Level l,
                java.lang.Object o)
Description copied from interface: Logger
Log a message, with no arguments. If the logger is currently enabled for the given message level then the given message is treated

Specified by:
log in interface Logger

log

public void log(int level,
                java.lang.Object o,
                java.lang.Throwable t)
Log an object and a trowable with a specific level.

Specified by:
log in interface Logger

log

public void log(Level l,
                java.lang.Object o,
                java.lang.Throwable t)
Description copied from interface: Logger
Log a message, with a throwable arguments which can represent an error or a context..

Specified by:
log in interface Logger

log

public void log(int level,
                java.lang.Object o,
                java.lang.Object location,
                java.lang.Object method)
Log an object and a trowable with a specific level. This method permits to specify an object instance and a method.

Specified by:
log in interface Logger

log

public void log(Level l,
                java.lang.Object o,
                java.lang.Object location,
                java.lang.Object method)
Description copied from interface: Logger
Log a message, with a location and method arguments. The location parameter can be the object instance which logs the event, or a string representation of the object. The method argument can be a java.lang.reflect.Method or a string which represents the method name.

Specified by:
log in interface Logger

log

public void log(int level,
                java.lang.Object o,
                java.lang.Throwable t,
                java.lang.Object location,
                java.lang.Object method)
Log an object and a trowable with a specific level. This method permits to specify an object instance and a method.

Specified by:
log in interface Logger

log

public void log(Level l,
                java.lang.Object o,
                java.lang.Throwable t,
                java.lang.Object location,
                java.lang.Object method)
Description copied from interface: Logger
Log a message, with a location, method and throwable arguments. The location parameter can be the object instance which logs the event, or a string representation of the object.. The method argument can be a java.lang.reflect.Method or a string which represents the method name. The throwable parameter permits to log an Exception.

Specified by:
log in interface Logger

turnOn

public void turnOn()
Enable the handler

Specified by:
turnOn in interface Logger

turnOff

public void turnOff()
Disable the handler

Specified by:
turnOff in interface Logger

getHandler

public Handler[] getHandler()
Description copied from interface: TopicalLogger
It returns the list of the handler associated to this logger.

Specified by:
getHandler in interface TopicalLogger
Returns:
an array of Handler or an empty array.

getName

public java.lang.String getName()
Description copied from interface: Handler
It retrieves the name of the handler

Specified by:
getName in interface Handler

getHandler

public Handler getHandler(java.lang.String hn)
Description copied from interface: TopicalLogger
It returns the handler which the name is equals to the parameter

Specified by:
getHandler in interface TopicalLogger
Returns:
an Handler or a null value.

setName

public void setName(java.lang.String name)
Description copied from interface: Handler
It assigns the name of the handler

Specified by:
setName in interface Handler

removeAllHandlers

public void removeAllHandlers()
                       throws java.lang.Exception
Description copied from interface: TopicalLogger
A TopicalLogger manages a list of Handler instances. This method allows removing all handler.

Specified by:
removeAllHandlers in interface TopicalLogger
Throws:
java.lang.Exception

getType

public byte getType()
Description copied from interface: Handler
It retrieves the Handler type

Specified by:
getType in interface Handler

setAdditivity

public void setAdditivity(boolean a)
Description copied from interface: TopicalLogger
It assigns the additivity flag for this logger instance.

Specified by:
setAdditivity in interface TopicalLogger

getAttributeNames

public java.lang.String[] getAttributeNames()
Description copied from interface: Handler
It retrieves the attributes of the handler

Specified by:
getAttributeNames in interface Handler

getAdditivity

public boolean getAdditivity()
Description copied from interface: TopicalLogger
It retrieves the additivity flag for this logger instance.

Specified by:
getAdditivity in interface TopicalLogger

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface: Handler
It retrieves the value of an attribute value of the handler.

Specified by:
getAttribute in interface Handler

getTopic

public java.lang.String[] getTopic()
Description copied from interface: TopicalLogger
This method allows getting a topic list of this TopicalLogger.

Specified by:
getTopic in interface TopicalLogger

setAttribute

public java.lang.Object setAttribute(java.lang.String name,
                                     java.lang.Object value)
Description copied from interface: Handler
It assigns an attributte to the handler.

Specified by:
setAttribute in interface Handler
Parameters:
value - is the attribute value
Returns:
the old value is the attribute was already defined

addHandler

public void addHandler(Handler h)
                throws java.lang.Exception
Add a handler in the Handler list of the topicalLogger

Specified by:
addHandler in interface TopicalLogger
Throws:
java.lang.Exception

addTopic

public void addTopic(java.lang.String topic)
              throws java.lang.Exception
Add a topic to the topicalLogger

Specified by:
addTopic in interface TopicalLogger
Throws:
java.lang.Exception

getTopics

public java.util.Enumeration getTopics()
Returns the list of the different names of the topicalLogger

Specified by:
getTopics in interface TopicalLogger

removeHandler

public void removeHandler(Handler h)
                   throws java.lang.Exception
Remove a handler from the Handler list of the topicalLogger

Specified by:
removeHandler in interface TopicalLogger
Throws:
java.lang.Exception

removeTopic

public void removeTopic(java.lang.String topic)
                 throws java.lang.Exception
Remove a topic from the topicalLogger

Specified by:
removeTopic in interface TopicalLogger
Throws:
java.lang.Exception