raccoon.core.log
Class AbsLogComponent

java.lang.Object
  extended by raccoon.core.types.AbsComponent
      extended by raccoon.core.types.AbsLoadable
          extended by raccoon.core.types.AbsConfigurableLoadable
              extended by raccoon.core.log.AbsLogComponent
All Implemented Interfaces:
ILogger, IBaseComponent, IConfigurable, ILoadable, ILogable
Direct Known Subclasses:
Jdk14Proxy, Log4jProxy

public abstract class AbsLogComponent
extends AbsConfigurableLoadable
implements ILogger

Contains common logic for all the implementing classes of ILogger contained in this package.

Since:
Raccoon v0.5, refactored in Raccoon v0.8
Version:
$Id: AbsLogComponent.java,v 1.1 2004/08/08 20:19:17 crouvrais Exp $
Author:
Cedric ROUVRAIS

Field Summary
static java.lang.String LOGGER_NAME
          The string constant representing the logger name.
(package private)  java.lang.String mLoggerName
          The name of the current logger.
(package private)  java.lang.String mPropertyFileName
          The property file name that is used to configure this instance.
static java.lang.String PROPERTY_FILE_NAME
          The string constant representing the property file name.
 
Fields inherited from class raccoon.core.types.AbsConfigurableLoadable
mConfigurableManager
 
Fields inherited from class raccoon.core.types.AbsLoadable
mIsLoaded
 
Fields inherited from class raccoon.core.types.AbsComponent
mIsInError
 
Fields inherited from interface raccoon.api.log.ILogger
LEVEL_DEBUG, LEVEL_ERROR, LEVEL_INFO, LEVEL_WARN, PTY_LOGGER
 
Constructor Summary
AbsLogComponent()
          Default constructor required for dynamic instanciation.
 
Method Summary
abstract  java.lang.String debugLevelToString()
          The debug level as a string.
abstract  java.lang.String errorLevelToString()
          The error level as a string.
static int getCallingClassLevel()
          Undocumented method inserted for tutorial purposes.
 java.lang.String getCategoryName()
          Deprecated. As of Raccoon v0.8
 java.lang.String getLoggerName()
          The logger under which this component is logging the information.
protected abstract  void getLogInstance()
          Instanciates the logging element.
 java.lang.String getPropertyFileName()
          Retrieve the name of the property file used to configure Log4j.
abstract  java.lang.String infoLevelToString()
          The info level as a string.
 void load()
          Invoked by the service manager to start this component once it has been configured.
protected abstract  void loadLoggers()
          Loads the various loggers required to function.
static void setCallingClassLevel(int pCallingClassLevel)
          Undocumented method inserted for tutorial purposes.
 void setCategoryName(java.lang.String pCategoryName)
          Deprecated. As of Raccoon v0.8
 void setLoggerName(java.lang.String pLoggerName)
          Defines the logger under which this component should log the information.
 void setPropertyFileName(java.lang.String pPropertyFileName)
          Defines the property file name to be used in order to configure Log4j.
abstract  java.lang.String warnLevelToString()
          The warn level as a string.
 
Methods inherited from class raccoon.core.types.AbsConfigurableLoadable
configureParameters, isStable, setConfigurableManager, setLogger
 
Methods inherited from class raccoon.core.types.AbsLoadable
getLog, isInError, isInitialised, isRunning, unload
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface raccoon.api.log.ILogger
debug, debug, debug, debug, error, error, error, error, info, info, info, info, isDebugEnabled, isErrorEnabled, isInfoEnabled, isWarnEnabled, warn, warn, warn, warn
 

Field Detail

mPropertyFileName

java.lang.String mPropertyFileName
The property file name that is used to configure this instance.


PROPERTY_FILE_NAME

public static final java.lang.String PROPERTY_FILE_NAME
The string constant representing the property file name.

See Also:
Constant Field Values

mLoggerName

java.lang.String mLoggerName
The name of the current logger.


LOGGER_NAME

public static final java.lang.String LOGGER_NAME
The string constant representing the logger name.

See Also:
Constant Field Values
Constructor Detail

AbsLogComponent

public AbsLogComponent()
Default constructor required for dynamic instanciation.

Method Detail

getCallingClassLevel

public static int getCallingClassLevel()
Undocumented method inserted for tutorial purposes.

Returns:
some value of no interest.

setCallingClassLevel

public static void setCallingClassLevel(int pCallingClassLevel)
Undocumented method inserted for tutorial purposes.

Parameters:
pCallingClassLevel - some value of no interest

getPropertyFileName

public final java.lang.String getPropertyFileName()
Retrieve the name of the property file used to configure Log4j.

Returns:
the name of the property file used by this instance.

setPropertyFileName

public final void setPropertyFileName(java.lang.String pPropertyFileName)
                               throws ResourceNotFoundException
Defines the property file name to be used in order to configure Log4j.

Parameters:
pPropertyFileName - the name of the property file that is located within the class path.
Throws:
ResourceNotFoundException

getCategoryName

public final java.lang.String getCategoryName()
Deprecated. As of Raccoon v0.8

The category under which this component is logging the information.

Specified by:
getCategoryName in interface ILogger
Returns:
the Log4j category name of the current instance.

setCategoryName

public final void setCategoryName(java.lang.String pCategoryName)
Deprecated. As of Raccoon v0.8

Defines the category under which this component should log the information.

Specified by:
setCategoryName in interface ILogger
Parameters:
pCategoryName - the Log4j category to use for this session.

getLoggerName

public final java.lang.String getLoggerName()
The logger under which this component is logging the information.

Specified by:
getLoggerName in interface ILogger
Returns:
the Log4j logger name of the current instance.

setLoggerName

public final void setLoggerName(java.lang.String pLoggerName)
Defines the logger under which this component should log the information.

Specified by:
setLoggerName in interface ILogger
Parameters:
pLoggerName - the Log4j logger to use for this session.

load

public final void load()
                throws LoadableException
Invoked by the service manager to start this component once it has been configured. When extended bare in mind that the member variable mIsInitialised should be set to false and then set to true once all the init code has been performed.

Specified by:
load in interface ILoadable
Overrides:
load in class AbsConfigurableLoadable
Throws:
LoadableException - if this component isn't initialisable or is already running.

getLogInstance

protected abstract void getLogInstance()
Instanciates the logging element.


loadLoggers

protected abstract void loadLoggers()
                             throws LoadableException
Loads the various loggers required to function.

Throws:
LoadableException - if the loggers couldn't be correctly loaded.

debugLevelToString

public abstract java.lang.String debugLevelToString()
The debug level as a string.

Returns:
debug string representation

infoLevelToString

public abstract java.lang.String infoLevelToString()
The info level as a string.

Returns:
info string representation

warnLevelToString

public abstract java.lang.String warnLevelToString()
The warn level as a string.

Returns:
warn string representation

errorLevelToString

public abstract java.lang.String errorLevelToString()
The error level as a string.

Returns:
error string representation


Copyright null null. All Rights Reserved.