org.apache.avalon.excalibur.logger.decorator
Class CachingDecorator
java.lang.Object
org.apache.avalon.excalibur.logger.decorator.LoggerManagerDecorator
org.apache.avalon.excalibur.logger.decorator.CachingDecorator
- All Implemented Interfaces:
- LoggerManager, org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled
public class CachingDecorator
- extends LoggerManagerDecorator
This class implements LoggerManager interface by
passing all the job to a wrapped LoggerManager,
but the returened Loggers are cached.
All operations of this class are synchronized via
a single lock. As the LoggerManager
is
not expected to be a performance bottleneck probably
this design will be good enough.
- Since:
- 4.0
- Version:
- CVS $Revision: 1.3 $ $Date: 2004/03/10 13:54:50 $
- Author:
- Avalon Development Team
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager |
ROLE |
Method Summary |
org.apache.avalon.framework.logger.Logger |
getDefaultLogger()
Return the default Logger. |
org.apache.avalon.framework.logger.Logger |
getLoggerForCategory(java.lang.String categoryName)
Return the Logger for the specified category. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CachingDecorator
public CachingDecorator(LoggerManager loggerManager)
- Creates a
CachingDecorator
instance.
getLoggerForCategory
public org.apache.avalon.framework.logger.Logger getLoggerForCategory(java.lang.String categoryName)
- Return the Logger for the specified category.
- Specified by:
getLoggerForCategory
in interface LoggerManager
- Overrides:
getLoggerForCategory
in class LoggerManagerDecorator
getDefaultLogger
public org.apache.avalon.framework.logger.Logger getDefaultLogger()
- Return the default Logger. Although it is expected
that the wrapped loggerManager will return the same
as getLoggerForCategory("") we cache the value separtely.
- Specified by:
getDefaultLogger
in interface LoggerManager
- Overrides:
getDefaultLogger
in class LoggerManagerDecorator
Copyright © 1997-2009 Apache Software Foundation. All Rights Reserved.