org.alfresco.repo.module
Class LoggerModuleComponent

java.lang.Object
  extended by org.alfresco.repo.module.AbstractModuleComponent
      extended by org.alfresco.repo.module.LoggerModuleComponent
All Implemented Interfaces:
ModuleComponent, org.springframework.beans.factory.BeanNameAware

public class LoggerModuleComponent
extends AbstractModuleComponent

Module component that logs a message on startup. The log category used will be the ID of the module that contains the component and the name of the component itself. For example:

 log4j.logger.org.alfresco.modules.MyModule.DumpMessageComponent=INFO
 

Since:
2.1

Field Summary
 
Fields inherited from class org.alfresco.repo.module.AbstractModuleComponent
authenticationComponent, moduleService, serviceRegistry
 
Constructor Summary
LoggerModuleComponent()
           
 
Method Summary
protected  void checkProperties()
          Checks for the presence of all generally-required properties.
protected  void executeInternal()
          The method that performs the actual work.
 void setLogLevel(java.lang.String logLevel)
          Set the level at which the bean must log the message.
 void setMessage(java.lang.String message)
          Set the message that must be logged.
 
Methods inherited from class org.alfresco.repo.module.AbstractModuleComponent
equals, execute, getAppliesFromVersionNumber, getAppliesToVersionNumber, getDependsOn, getDescription, getModuleId, getName, getSinceVersionNumber, hashCode, init, isExecuteOnceOnly, setAppliesFromVersion, setAppliesToVersion, setAuthenticationComponent, setBeanName, setDependsOn, setDescription, setExecuteOnceOnly, setModuleId, setModuleService, setName, setServiceRegistry, setSinceVersion, setTenantAdminService, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LoggerModuleComponent

public LoggerModuleComponent()
Method Detail

setLogLevel

public void setLogLevel(java.lang.String logLevel)
Set the level at which the bean must log the message.

Parameters:
logLevel - One of the values. The default is LogLevel#INFO.

setMessage

public void setMessage(java.lang.String message)
Set the message that must be logged. This can be a message string or an ID of an internationalized string.

Parameters:
message - a message to log at the log level

checkProperties

protected void checkProperties()
Description copied from class: AbstractModuleComponent
Checks for the presence of all generally-required properties.

Overrides:
checkProperties in class AbstractModuleComponent

executeInternal

protected void executeInternal()
                        throws java.lang.Throwable
Description copied from class: AbstractModuleComponent
The method that performs the actual work. For the most part, derived classes will only have to override this method to be fully functional.

Specified by:
executeInternal in class AbstractModuleComponent
Throws:
java.lang.Throwable - any problems, just throw them


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.