Package org.springframework.beans.factory.config

Examples of org.springframework.beans.factory.config.BeanPostProcessor


    DispatcherCallback callback;
   
    @Before
    public void prepareCallback() throws Exception {
        callback = EasyMock.createMock(DispatcherCallback.class);
        applicationContext.getBeanFactory().addBeanPostProcessor(new BeanPostProcessor() {
           
            public Object postProcessBeforeInitialization(Object bean, String beanName)
                    throws BeansException {
                if ("testCallback".equals(beanName)) {
                    return callback;
View Full Code Here


  /**
   * Register the given BeanPostProcessor beans.
   */
  private void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, List postProcessors) {
    for (Iterator it = postProcessors.iterator(); it.hasNext();) {
      BeanPostProcessor postProcessor = (BeanPostProcessor) it.next();
      beanFactory.addBeanPostProcessor(postProcessor);
    }
  }
View Full Code Here

    Bundle bundle = bundleContext.getBundle();
    try {
      // Try and load the annotation code using the bundle classloader
      Class annotationBppClass = bundle.loadClass(ANNOTATION_BPP_CLASS);
      // instantiate the class
      final BeanPostProcessor annotationBeanPostProcessor = (BeanPostProcessor) BeanUtils.instantiateClass(annotationBppClass);

      // everything went okay so configure the BPP and add it to the BF
      ((BeanFactoryAware) annotationBeanPostProcessor).setBeanFactory(beanFactory);
      ((BeanClassLoaderAware) annotationBeanPostProcessor).setBeanClassLoader(beanFactory.getBeanClassLoader());
      ((BundleContextAware) annotationBeanPostProcessor).setBundleContext(bundleContext);
View Full Code Here

TOP

Related Classes of org.springframework.beans.factory.config.BeanPostProcessor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.