public abstract class LoggerManagerDecorator extends java.lang.Object implements LoggerManager, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Startable, org.apache.avalon.framework.activity.Disposable
Decorators are expected to be slim - be able to run for instance both with and without having their enableLogging() method called.
This constraint is imposed to allow decorators to be applicable to an object both at its burth, like
C c = new C(); DecoratorX d = new DecoratorX( c ); x.enableLogging( logger );and after the object has been completely configured
C c = (C)manager.lookup( C.ROLE ); DecoratorX d = new DecoratorX( c );If this constrianed is not obeyed this should be clearly stated in the javadocs. For instance, LogToSelfDecorator _only_ makes sense if it passes the
enableLogging
call through it.
This implementation is incomplete,
it passes only those calls that are needed in
org.apache.avalon.excalibur.logger.decorator.* and
org.apache.avalon.excalibur.logger.adapter.*:
LogEnabled
Contextualizable
Configurable
Startable
Disposable
This object differes from LoggerManagerTee by being abstract,
by absence of addTee() public method and by implementation.
LoggerManagerTee might be used instead of this but maintaining
it as a separate class seemed cleaner.| Modifier and Type | Field and Description |
|---|---|
protected LoggerManager |
m_loggerManager
The wrapped-in LoggerManager.
|
ROLE| Constructor and Description |
|---|
LoggerManagerDecorator(LoggerManager loggerManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration) |
void |
contextualize(org.apache.avalon.framework.context.Context context) |
void |
dispose() |
void |
enableLogging(org.apache.avalon.framework.logger.Logger logger) |
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.
|
void |
start() |
void |
stop() |
protected final LoggerManager m_loggerManager
public LoggerManagerDecorator(LoggerManager loggerManager)
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging in interface org.apache.avalon.framework.logger.LogEnabledpublic void contextualize(org.apache.avalon.framework.context.Context context)
throws org.apache.avalon.framework.context.ContextException
contextualize in interface org.apache.avalon.framework.context.Contextualizableorg.apache.avalon.framework.context.ContextExceptionpublic void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableorg.apache.avalon.framework.configuration.ConfigurationExceptionpublic void start()
throws java.lang.Exception
start in interface org.apache.avalon.framework.activity.Startablejava.lang.Exceptionpublic void stop()
throws java.lang.Exception
stop in interface org.apache.avalon.framework.activity.Startablejava.lang.Exceptionpublic void dispose()
dispose in interface org.apache.avalon.framework.activity.Disposablepublic org.apache.avalon.framework.logger.Logger getLoggerForCategory(java.lang.String categoryName)
getLoggerForCategory in interface LoggerManagerpublic org.apache.avalon.framework.logger.Logger getDefaultLogger()
getDefaultLogger in interface LoggerManager