org.objectweb.util.monolog.wrapper.config
Class BasicHandler

java.lang.Object
  extended by org.objectweb.util.monolog.wrapper.config.BasicHandler
All Implemented Interfaces:
java.io.Serializable, Handler

public class BasicHandler
extends java.lang.Object
implements Handler, java.io.Serializable

This class is a basic implementation the Handler interface. It is not linked to any underlying log system. Therefore all attributes are stored into internal struture.

Author:
Sebastien Chassande-Barrioz
See Also:
Serialized Form

Field Summary
protected  java.util.HashMap attributes
          The attributes of the handler are listed by this field.
protected  java.lang.String name
          The name of the handler
protected  java.lang.String type
          The type of the handler
 
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
BasicHandler(java.lang.String n, java.lang.String t)
           
 
Method Summary
 java.lang.Object getAttribute(java.lang.String key)
          It retrieves the value of an attribute value of the handler.
 java.lang.String[] getAttributeNames()
          It retrieves the attributes of the handler
 java.util.Map getAttributes()
           
 java.lang.String getName()
          It retrieves the name of the handler
 java.lang.String getType()
          It retrieves the Handler type
 java.lang.Object setAttribute(java.lang.String key, java.lang.Object value)
          It assigns an attributte to the handler.
 void setAttributes(java.util.Map properties)
           
 void setName(java.lang.String n)
          It assigns the name of the handler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
The name of the handler


attributes

protected java.util.HashMap attributes
The attributes of the handler are listed by this field. key = atribute name value = attribute value


type

protected java.lang.String type
The type of the handler

Constructor Detail

BasicHandler

public BasicHandler(java.lang.String n,
                    java.lang.String t)
Method Detail

getAttributes

public java.util.Map getAttributes()

setAttributes

public void setAttributes(java.util.Map properties)

getName

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

Specified by:
getName in interface Handler

setName

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

Specified by:
setName in interface Handler

getType

public java.lang.String getType()
Description copied from interface: Handler
It retrieves the Handler type

Specified by:
getType in interface Handler

getAttributeNames

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

Specified by:
getAttributeNames in interface Handler

getAttribute

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

Specified by:
getAttribute in interface Handler
Parameters:
key - is an attribute name

setAttribute

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

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