org.springframework.config.java.listener.aop
Class SpringAdviceConfigurationListener

java.lang.Object
  extended by org.springframework.config.java.listener.ConfigurationListenerSupport
      extended by org.springframework.config.java.listener.aop.AbstractAopConfigurationListener
          extended by org.springframework.config.java.listener.aop.SpringAdviceConfigurationListener
All Implemented Interfaces:
ConfigurationListener

public class SpringAdviceConfigurationListener
extends AbstractAopConfigurationListener

Configuration class to create a Spring Advisor containing an AspectJ pointcut and the Spring advice returned by the method.

Usage:

  @SpringAdvice("expression")
 protected Advice returnsSpringAdvice() { ... }
 

It is possible to specify an advice that will match everything as follows:

  @SpringAdvice(matchAll=true)
 protected Advice returnsSpringAdvice() { ... }
 

Author:
Rod Johnson

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.config.java.listener.ConfigurationListener
ConfigurationListener.BeanDefinitionRegistration
 
Field Summary
 
Fields inherited from class org.springframework.config.java.listener.ConfigurationListenerSupport
log
 
Constructor Summary
SpringAdviceConfigurationListener()
           
 
Method Summary
 int beanCreationMethod(ConfigurationListener.BeanDefinitionRegistration beanDefinitionRegistration, org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, org.springframework.beans.factory.support.DefaultListableBeanFactory childBeanFactory, java.lang.String configurerBeanName, java.lang.Class configurerClass, java.lang.reflect.Method m, Bean beanAnnotation)
          React to the BeanDefinition and possibly customize it or change its name
protected  org.springframework.aop.Pointcut createSpringPointcut(SpringAdvice ann, java.lang.reflect.Method method)
           
 
Methods inherited from class org.springframework.config.java.listener.aop.AbstractAopConfigurationListener
addAdvice, addAdvice, processBeanMethodReturnValue
 
Methods inherited from class org.springframework.config.java.listener.ConfigurationListenerSupport
configurationClass, otherMethod, understands
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpringAdviceConfigurationListener

public SpringAdviceConfigurationListener()
Method Detail

beanCreationMethod

public int beanCreationMethod(ConfigurationListener.BeanDefinitionRegistration beanDefinitionRegistration,
                              org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                              org.springframework.beans.factory.support.DefaultListableBeanFactory childBeanFactory,
                              java.lang.String configurerBeanName,
                              java.lang.Class configurerClass,
                              java.lang.reflect.Method m,
                              Bean beanAnnotation)
Description copied from interface: ConfigurationListener
React to the BeanDefinition and possibly customize it or change its name

Specified by:
beanCreationMethod in interface ConfigurationListener
Overrides:
beanCreationMethod in class ConfigurationListenerSupport
Parameters:
beanDefinitionRegistration - bean definition registration information
beanFactory - factory owning the configuration class. This method will be called before beans are instantiated, so other objects may not be available.
childBeanFactory - child bean factory available for internal use, such as for registering infrastructural beans
configurerBeanName - bean name of the configurer class
configurerClass - configurer class
m - configuration method
beanAnnotation - bean annotation on the configuration method, which will not be null.
Returns:
number of additional bean definitions created for the existing one. The value should be different from zero if wrapping bean definitions are created besides the normal @Bean discovery process

createSpringPointcut

protected org.springframework.aop.Pointcut createSpringPointcut(SpringAdvice ann,
                                                                java.lang.reflect.Method method)


Copyright © 2005-2007 Spring Framework. All Rights Reserved.