org.springbyexample.util.log
Class AnnotationLoggerBeanPostProcessor

java.lang.Object
  extended by org.springbyexample.util.log.LoggerBeanPostProcessor
      extended by org.springbyexample.util.log.AnnotationLoggerBeanPostProcessor
All Implemented Interfaces:
BeanPostProcessor, Ordered

public class AnnotationLoggerBeanPostProcessor
extends LoggerBeanPostProcessor

Injects loggers into new bean instances based on fields marked with AutowiredLogger annotation.

Author:
David Winterfeldt

Field Summary
 
Fields inherited from class org.springbyexample.util.log.LoggerBeanPostProcessor
hLoggerFactories, methodName
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AnnotationLoggerBeanPostProcessor()
           
 
Method Summary
protected  Class<? extends Annotation> getAutowiredAnnotationType()
          Gets autowired logger annotation type.
protected  void processLogger(Object bean, String methodName)
          Processes a beans fields for injection if it has a AutowiredLogger annotation.
 void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType)
          Sets autowired logger annotation type.
 
Methods inherited from class org.springbyexample.util.log.LoggerBeanPostProcessor
getLogger, getOrder, injectMethod, postProcessAfterInitialization, postProcessBeforeInitialization, setLoggerFactoryMap, setMethodName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationLoggerBeanPostProcessor

public AnnotationLoggerBeanPostProcessor()
Method Detail

getAutowiredAnnotationType

protected Class<? extends Annotation> getAutowiredAnnotationType()
Gets autowired logger annotation type. Defaults to AutowiredLogger.


setAutowiredAnnotationType

public void setAutowiredAnnotationType(Class<? extends Annotation> autowiredAnnotationType)
Sets autowired logger annotation type. Defaults to AutowiredLogger.


processLogger

protected void processLogger(Object bean,
                             String methodName)

Processes a beans fields for injection if it has a AutowiredLogger annotation.

Note: Method name isn't used by this implementation.

Overrides:
processLogger in class LoggerBeanPostProcessor


Copyright © 2008-2009 Spring by Example. All Rights Reserved.