org.springframework.config.java.listener
Class ConfigurationListenerSupport

java.lang.Object
  extended by org.springframework.config.java.listener.ConfigurationListenerSupport
All Implemented Interfaces:
ConfigurationListener
Direct Known Subclasses:
AbstractAopConfigurationListener, AutoBeanConfigurationListener, HotSwapConfigurationListener, ScopedProxyConfigurationListener, SpringAdvisorConfigurationListener

public class ConfigurationListenerSupport
extends java.lang.Object
implements ConfigurationListener

Convenient base class for implementation of the ConfigurationListener interface, offer no op implementations of all methods.

Author:
Rod Johnson

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.springframework.config.java.listener.ConfigurationListener
ConfigurationListener.BeanDefinitionRegistration
 
Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
ConfigurationListenerSupport()
           
 
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
 int configurationClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, org.springframework.beans.factory.support.DefaultListableBeanFactory childBeanFactory, java.lang.String configurerBeanName, java.lang.Class configurerClass)
          React to the given configuration class.
 int otherMethod(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)
          React to the encountering of a non bean definition method on the configurer class.
 boolean processBeanMethodReturnValue(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory, org.springframework.beans.factory.support.DefaultListableBeanFactory childBeanFactory, java.lang.Object originallyCreatedBean, java.lang.reflect.Method method, org.springframework.aop.framework.ProxyFactory pf)
          Help to process the return value of a bean definition.
 boolean understands(java.lang.Class<?> configurerClass)
          Does this configurer understand the given configuration class, which isn't a regular configuration class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final org.apache.commons.logging.Log log
Constructor Detail

ConfigurationListenerSupport

public ConfigurationListenerSupport()
Method Detail

understands

public boolean understands(java.lang.Class<?> configurerClass)
Description copied from interface: ConfigurationListener
Does this configurer understand the given configuration class, which isn't a regular configuration class.

Specified by:
understands in interface ConfigurationListener
Parameters:
configurerClass - candidate configuration class
Returns:
whether this class is understood by this configurer

configurationClass

public int configurationClass(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                              org.springframework.beans.factory.support.DefaultListableBeanFactory childBeanFactory,
                              java.lang.String configurerBeanName,
                              java.lang.Class configurerClass)
Description copied from interface: ConfigurationListener
React to the given configuration class.

Specified by:
configurationClass in interface ConfigurationListener
Returns:
number of bean definitions created

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
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

otherMethod

public int otherMethod(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)
Description copied from interface: ConfigurationListener
React to the encountering of a non bean definition method on the configurer class. Non bean definition methods (with Bean annotations) may be significant to some configuration classes.

Specified by:
otherMethod in interface ConfigurationListener
Parameters:
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 - method on configurer class
Returns:
number of newly bean definitions created

processBeanMethodReturnValue

public boolean processBeanMethodReturnValue(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory,
                                            org.springframework.beans.factory.support.DefaultListableBeanFactory childBeanFactory,
                                            java.lang.Object originallyCreatedBean,
                                            java.lang.reflect.Method method,
                                            org.springframework.aop.framework.ProxyFactory pf)
Description copied from interface: ConfigurationListener
Help to process the return value of a bean definition.

Specified by:
processBeanMethodReturnValue in interface ConfigurationListener
pf - simply don't modify it if necessary
Returns:
whether or not the proxy was changed. If all listeners return false, the return value may not need to be proxied.


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