org.objectweb.util.monolog.wrapper.javaLog
Class GenericHandler

java.lang.Object
  extended byjava.util.logging.Handler
      extended byorg.objectweb.util.monolog.wrapper.javaLog.GenericHandler
All Implemented Interfaces:
Handler

public class GenericHandler
extends java.util.logging.Handler
implements Handler


Field Summary
 java.util.logging.Handler handler
           
protected  java.lang.String name
           
protected  byte type
           
 
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
GenericHandler(java.lang.String name, byte type)
           
GenericHandler(java.lang.String name, java.util.logging.Handler h)
           
GenericHandler(java.lang.String name, java.util.logging.Handler h, byte type)
           
 
Method Summary
 void close()
          Close the Handler and free all associated resources.
 void flush()
          Flush any buffered output.
 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
 java.lang.String getEncoding()
          Return the character encoding for this Handler.
 java.util.logging.Filter getFilter()
          Get the current Filter for this Handler.
 java.util.logging.Formatter getFormatter()
          Return the Formatter for this Handler.
 java.util.logging.Level getLevel()
          Get the log level specifying which messages will be logged by this Handler.
 java.lang.String getName()
          It retrieves the name of the handler
 byte getType()
          It retrieves the Handler type
 boolean isLoggable(java.util.logging.LogRecord record)
          Check if this Handler would actually log a given LogRecord.
 void publish(java.util.logging.LogRecord record)
          Publish a LogRecord.
 java.lang.Object setAttribute(java.lang.String name, java.lang.Object value)
          It assigns an attributte to the handler.
 void setEncoding(java.lang.String encoding)
          Set the character encoding used by this Handler.
protected  void setException(java.lang.Exception exception)
          Set the most recent IO exception.
 void setFilter(java.util.logging.Filter newFilter)
          Set a Filter to control output on this Handler.
 void setFormatter(java.util.logging.Formatter newFormatter)
          Set a Formatter.
 void setLevel(java.util.logging.Level newLevel)
          Set the log level specifying which message levels will be logged by this Handler.
 void setName(java.lang.String name)
          It assigns the name of the handler
 
Methods inherited from class java.util.logging.Handler
getErrorManager, reportError, setErrorManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handler

public java.util.logging.Handler handler

type

protected byte type

name

protected java.lang.String name
Constructor Detail

GenericHandler

public GenericHandler(java.lang.String name,
                      byte type)

GenericHandler

public GenericHandler(java.lang.String name,
                      java.util.logging.Handler h,
                      byte type)

GenericHandler

public GenericHandler(java.lang.String name,
                      java.util.logging.Handler h)
Method Detail

getName

public java.lang.String getName()
It retrieves the name of the handler

Specified by:
getName in interface Handler

setName

public void setName(java.lang.String name)
It assigns the name of the handler

Specified by:
setName in interface Handler

getType

public byte getType()
It retrieves the Handler type

Specified by:
getType in interface Handler

getAttributeNames

public java.lang.String[] getAttributeNames()
It retrieves the attributes of the handler

Specified by:
getAttributeNames in interface Handler

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
It retrieves the value of an attribute value of the handler.

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

setAttribute

public java.lang.Object setAttribute(java.lang.String name,
                                     java.lang.Object value)
It assigns an attributte to the handler.

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

close

public void close()
Close the Handler and free all associated resources.


flush

public void flush()
Flush any buffered output.


getEncoding

public java.lang.String getEncoding()
Return the character encoding for this Handler.


getFilter

public java.util.logging.Filter getFilter()
Get the current Filter for this Handler.


getFormatter

public java.util.logging.Formatter getFormatter()
Return the Formatter for this Handler.


getLevel

public java.util.logging.Level getLevel()
Get the log level specifying which messages will be logged by this Handler.


isLoggable

public boolean isLoggable(java.util.logging.LogRecord record)
Check if this Handler would actually log a given LogRecord.


publish

public void publish(java.util.logging.LogRecord record)
Publish a LogRecord.


setEncoding

public void setEncoding(java.lang.String encoding)
                 throws java.lang.SecurityException,
                        java.io.UnsupportedEncodingException
Set the character encoding used by this Handler.

Throws:
java.lang.SecurityException
java.io.UnsupportedEncodingException

setException

protected void setException(java.lang.Exception exception)
Set the most recent IO exception.


setFilter

public void setFilter(java.util.logging.Filter newFilter)
Set a Filter to control output on this Handler.


setFormatter

public void setFormatter(java.util.logging.Formatter newFormatter)
Set a Formatter.


setLevel

public void setLevel(java.util.logging.Level newLevel)
Set the log level specifying which message levels will be logged by this Handler.