Top Description Fields Constructors Methods
org.apache.avalon.framework.logger

public abstract Class AbstractLoggable

extends Object
implements Loggable
Class Inheritance
All Implemented Interfaces
org.apache.avalon.framework.logger.Loggable

Deprecated

Use AbstractLogEnabled instead.

Utility class to allow construction of easy components that will perform logging.
Author
Avalon Development Team
Version
$Id: AbstractLoggable.java 506231 2007-02-12 02:36:54Z crossley $

Field Summary

Modifier and TypeField and Description
private Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected final Logger

Returns:

the Logger
getLogger
()

Helper method to allow sub-classes to aquire logger.

public void
setLogger(final Logger
the logger
logger
)

Implements org.apache.avalon.framework.logger.Loggable.setLogger.

Set the components logger.
protected void
setupLogger(final Object
the component to pass logger object to
component
)

Helper method to setup other components with same logger.

protected void
setupLogger(final Object
the component to pass logger object to
component
,
final String
the subcategory to use (may be null)
subCategory
)

Helper method to setup other components with logger.

protected void
setupLogger(final Object
the component to pass logger object to
component
,
final Logger
the Logger
logger
)

Helper method to setup other components with logger.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_loggerback to summary
private Logger m_logger

Constructor Detail

AbstractLoggableback to summary
public AbstractLoggable()

Method Detail

getLoggerback to summary
protected final Logger getLogger()

Helper method to allow sub-classes to aquire logger. This method exists rather than exposing a member variable because it protects other users against future changes. It also means they do not have to use our naming convention.

There is no performance penalty as this is a final method and will be inlined by the JVM.

Returns:Logger

the Logger

setLoggerback to summary
public void setLogger(final Logger logger)

Implements org.apache.avalon.framework.logger.Loggable.setLogger.

Set the components logger.

Parameters
logger:Logger

the logger

setupLoggerback to summary
protected void setupLogger(final Object component)

Helper method to setup other components with same logger.

Parameters
component:Object

the component to pass logger object to

setupLoggerback to summary
protected void setupLogger(final Object component, final String subCategory)

Helper method to setup other components with logger. The logger has the subcategory of this components logger.

Parameters
component:Object

the component to pass logger object to

subCategory:String

the subcategory to use (may be null)

setupLoggerback to summary
protected void setupLogger(final Object component, final Logger logger)

Helper method to setup other components with logger.

Parameters
component:Object

the component to pass logger object to

logger:Logger

the Logger