|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.excalibur.logger.decorator.LoggerManagerDecorator
This is the base class to create LoggerManager decorators. It passes all lifecycle and LoggerManagerc calls onto the wrapped object.
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 DisposableThis 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.
Field Summary | |
protected LoggerManager |
m_loggerManager
The wrapped-in LoggerManager. |
Fields inherited from interface org.apache.avalon.excalibur.logger.LoggerManager |
ROLE |
Constructor Summary | |
LoggerManagerDecorator(LoggerManager loggerManager)
|
Method Summary | |
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()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final LoggerManager m_loggerManager
Constructor Detail |
public LoggerManagerDecorator(LoggerManager loggerManager)
Method Detail |
public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
enableLogging
in interface org.apache.avalon.framework.logger.LogEnabled
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
org.apache.avalon.framework.context.ContextException
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
public void start() throws java.lang.Exception
start
in interface org.apache.avalon.framework.activity.Startable
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in interface org.apache.avalon.framework.activity.Startable
java.lang.Exception
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
public org.apache.avalon.framework.logger.Logger getLoggerForCategory(java.lang.String categoryName)
getLoggerForCategory
in interface LoggerManager
public org.apache.avalon.framework.logger.Logger getDefaultLogger()
getDefaultLogger
in interface LoggerManager
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |