org.apache.cocoon.ojb.components
Class LoggerImpl

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.ojb.components.LoggerImpl
All Implemented Interfaces:
Serializable, Initializable, Component, LogEnabled, ThreadSafe, org.apache.ojb.broker.util.configuration.Configurable, org.apache.ojb.broker.util.logging.Logger

public class LoggerImpl
extends AbstractLogEnabled
implements Component, ThreadSafe, Initializable, org.apache.ojb.broker.util.logging.Logger

OJB logger implementation delegating to the Avalon logger.

This class has two faces to it:

Avalon Component
Instance of the class created and managed by Avalon container. When instance is initialized, it obtains logger instance to be used by OJB.
OJB Managed Class
Instances of the class are created and managed by OJB, as defined in the OJB OJB.properties file. Each OJB managed instance of the class will have access to the logger object initialized by Avalon managed instance of the class.
It is important that Avalon component is initialized before any access to OJB API is made.

Version:
$Id: LoggerImpl.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Vadim Gritsenko
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.util.logging.Logger
DEBUG, ERROR, FATAL, INFO, serialVersionUID, WARN
 
Constructor Summary
LoggerImpl()
          Constructor used by Container
LoggerImpl(String name)
          Constructor used by OJB 1.0 to create a logger instance
LoggerImpl(String name, org.apache.ojb.broker.util.logging.LoggingConfiguration config)
          Constructor used by OJB 1.1 to create a logger instance
 
Method Summary
 void configure(org.apache.ojb.broker.util.configuration.Configuration config)
           
 void debug(Object message)
           
 void debug(Object message, Throwable t)
           
 void error(Object message)
           
 void error(Object message, Throwable t)
           
 void fatal(Object message)
           
 void fatal(Object message, Throwable t)
           
protected  int getLevel()
           
 String getName()
           
 void info(Object message)
           
 void info(Object message, Throwable t)
           
 void initialize()
          Set root logger instance which will be used by OJB
 boolean isDebugEnabled()
           
 boolean isEnabledFor(int priority)
           
 void safeDebug(String message, Object obj)
           
 void safeDebug(String message, Object obj, Throwable t)
           
 void safeError(String message, Object obj)
           
 void safeError(String message, Object obj, Throwable t)
           
 void safeFatal(String message, Object obj)
           
 void safeFatal(String message, Object obj, Throwable t)
           
 void safeInfo(String message, Object obj)
           
 void safeInfo(String message, Object obj, Throwable t)
           
 void safeWarn(String message, Object obj)
           
 void safeWarn(String message, Object obj, Throwable t)
           
 void warn(Object message)
           
 void warn(Object message, Throwable t)
           
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggerImpl

public LoggerImpl()
Constructor used by Container


LoggerImpl

public LoggerImpl(String name)
Constructor used by OJB 1.0 to create a logger instance


LoggerImpl

public LoggerImpl(String name,
                  org.apache.ojb.broker.util.logging.LoggingConfiguration config)
Constructor used by OJB 1.1 to create a logger instance

Method Detail

initialize

public void initialize()
Set root logger instance which will be used by OJB

Specified by:
initialize in interface Initializable

getLevel

protected int getLevel()

getName

public String getName()
Specified by:
getName in interface org.apache.ojb.broker.util.logging.Logger

debug

public void debug(Object message)
Specified by:
debug in interface org.apache.ojb.broker.util.logging.Logger

debug

public void debug(Object message,
                  Throwable t)
Specified by:
debug in interface org.apache.ojb.broker.util.logging.Logger

safeDebug

public void safeDebug(String message,
                      Object obj)
Specified by:
safeDebug in interface org.apache.ojb.broker.util.logging.Logger

safeDebug

public void safeDebug(String message,
                      Object obj,
                      Throwable t)
Specified by:
safeDebug in interface org.apache.ojb.broker.util.logging.Logger

info

public void info(Object message)
Specified by:
info in interface org.apache.ojb.broker.util.logging.Logger

info

public void info(Object message,
                 Throwable t)
Specified by:
info in interface org.apache.ojb.broker.util.logging.Logger

safeInfo

public void safeInfo(String message,
                     Object obj)
Specified by:
safeInfo in interface org.apache.ojb.broker.util.logging.Logger

safeInfo

public void safeInfo(String message,
                     Object obj,
                     Throwable t)
Specified by:
safeInfo in interface org.apache.ojb.broker.util.logging.Logger

warn

public void warn(Object message)
Specified by:
warn in interface org.apache.ojb.broker.util.logging.Logger

warn

public void warn(Object message,
                 Throwable t)
Specified by:
warn in interface org.apache.ojb.broker.util.logging.Logger

safeWarn

public void safeWarn(String message,
                     Object obj)
Specified by:
safeWarn in interface org.apache.ojb.broker.util.logging.Logger

safeWarn

public void safeWarn(String message,
                     Object obj,
                     Throwable t)
Specified by:
safeWarn in interface org.apache.ojb.broker.util.logging.Logger

error

public void error(Object message)
Specified by:
error in interface org.apache.ojb.broker.util.logging.Logger

error

public void error(Object message,
                  Throwable t)
Specified by:
error in interface org.apache.ojb.broker.util.logging.Logger

safeError

public void safeError(String message,
                      Object obj)
Specified by:
safeError in interface org.apache.ojb.broker.util.logging.Logger

safeError

public void safeError(String message,
                      Object obj,
                      Throwable t)
Specified by:
safeError in interface org.apache.ojb.broker.util.logging.Logger

fatal

public void fatal(Object message)
Specified by:
fatal in interface org.apache.ojb.broker.util.logging.Logger

fatal

public void fatal(Object message,
                  Throwable t)
Specified by:
fatal in interface org.apache.ojb.broker.util.logging.Logger

safeFatal

public void safeFatal(String message,
                      Object obj)
Specified by:
safeFatal in interface org.apache.ojb.broker.util.logging.Logger

safeFatal

public void safeFatal(String message,
                      Object obj,
                      Throwable t)
Specified by:
safeFatal in interface org.apache.ojb.broker.util.logging.Logger

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface org.apache.ojb.broker.util.logging.Logger

isEnabledFor

public boolean isEnabledFor(int priority)
Specified by:
isEnabledFor in interface org.apache.ojb.broker.util.logging.Logger

configure

public void configure(org.apache.ojb.broker.util.configuration.Configuration config)
               throws org.apache.ojb.broker.util.configuration.ConfigurationException
Specified by:
configure in interface org.apache.ojb.broker.util.configuration.Configurable
Specified by:
configure in interface org.apache.ojb.broker.util.logging.Logger
Throws:
org.apache.ojb.broker.util.configuration.ConfigurationException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.