net.sf.mmm.util.component.base
Class AbstractLoggableComponent
java.lang.Object
net.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
- Direct Known Subclasses:
- AbstractCliParserBuilder, AbstractDataResourceFactory, AbstractDataResourceProvider, AbstractDetectorStreamProvider, AbstractEventSource, AbstractGenericContextFactory, AbstractGenericValueConverter, AbstractHyphenator, AbstractHyphenatorBuilder, AbstractLineWrapper, AbstractNlsFormatter, AbstractNlsFormatterManager, AbstractNlsMessageFactory, AbstractNlsTemplateResolver, AbstractPojoDescriptorBuilder, AbstractPojoDescriptorBuilderFactory, AbstractPojoPathFunction, AbstractPojoPathNavigator, AbstractSimpleValueConverter, AbstractValueConverter, AbstractValueValidator, CollectionFactoryManagerImpl, CollectionReflectionUtilImpl, DefaultNlsResourceLocator, DefaultPojoDescriptorEnhancer, DomUtilImpl, EncodingUtilImpl, FileUtilImpl, JustificationBuilderImpl, MathUtilImpl, NlsFormatterMap, PeriodicRefresherImpl, ProcessUtilImpl, ReflectionUtilImpl, SimplePojoFactory, StaxUtilImpl, StreamUtilImpl, SystemUtilImpl, XmlBeanMapper
public abstract class AbstractLoggableComponent
- extends AbstractComponent
This is the abstract base class for a component that needs a
logger
.
- Since:
- 2.0.0 (renamed, 1.0.1)
- Author:
- Joerg Hohwiller (hohwille at users.sourceforge.net)
Field Summary |
private org.slf4j.Logger |
logger
|
Method Summary |
protected void |
doInitialize()
This method performs the actual initialization . |
protected org.slf4j.Logger |
getLogger()
This method gets the logger for this component. |
void |
setLogger(org.slf4j.Logger logger)
This method allows to inject the logger instance for
this component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
private org.slf4j.Logger logger
- See Also:
getLogger()
AbstractLoggableComponent
public AbstractLoggableComponent()
- The constructor.
getLogger
protected org.slf4j.Logger getLogger()
throws NotInitializedException
- This method gets the
logger
for this component. It should
only be invoked after the component has been initialized
.
This method is NOT public because the logger should only be used by the
component itself and NOT externally.
- Returns:
- the logger to be used by this component.
- Throws:
NotInitializedException
- if this component has NOT yet been
initialized
.
setLogger
public void setLogger(org.slf4j.Logger logger)
throws AlreadyInitializedException
- This method allows to inject the
logger
instance for
this component. This is an optional operation that has to be invoked before
the component has been initialized
.
- Parameters:
logger
- is the logger
to set.
- Throws:
AlreadyInitializedException
- if this component has already been
initialized
.
doInitialize
protected void doInitialize()
- This method performs the actual
initialization
. It is
called when AbstractComponent.initialize()
is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a
super.AbstractComponent.doInitialize()
.
- Overrides:
doInitialize
in class AbstractComponent
Copyright © 2001-2010 mmm-Team. All Rights Reserved.