Class OverridePostProcessor

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

    public class OverridePostProcessor
    extends Object
    implements org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.core.PriorityOrdered, org.springframework.beans.factory.BeanFactoryAware
    A link BeanPostProcessor that allows one to set and override bean properties in a flexible ways before the bean is initialized. This is similar to the functionality of PropertyOverrideConfigurer, except that it is a Spring bean post processor as opposed to a factory bean, which determines execution order in the application context construction lifecycle and allows one to use bean references for overriding bean properties as opposed to just string values. A simple example:
    <bean class="org.onebusaway.container.spring.OverridePostProcessor">
       <property name="map">
         <map>
           <entry key="beanName.beanProperty" value ="someOtherBeanName" />
         </map>
       </property>
     </bean>
    Author:
    bdferris
    • Constructor Detail

      • OverridePostProcessor

        public OverridePostProcessor()
    • Method Detail

      • setOrder

        public void setOrder​(int order)
      • getOrder

        public int getOrder()
        Specified by:
        getOrder in interface org.springframework.core.Ordered
      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
        Throws:
        org.springframework.beans.BeansException
      • postProcessBeforeInitialization

        public Object postProcessBeforeInitialization​(Object bean,
                                                      String beanName)
                                               throws org.springframework.beans.BeansException
        Specified by:
        postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException
      • postProcessAfterInitialization

        public Object postProcessAfterInitialization​(Object bean,
                                                     String beanName)
                                              throws org.springframework.beans.BeansException
        Specified by:
        postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
        Throws:
        org.springframework.beans.BeansException