Package org.springframework.context.support

Examples of org.springframework.context.support.AbstractRefreshableConfigApplicationContext


    return bean;
  }
  private <T> void register(Class<T> clazz) {
    if (this.applicationContext instanceof AbstractRefreshableConfigApplicationContext) {
      BeanDefinition beanDefinition = BeanDefinitionBuilder.rootBeanDefinition(clazz).getBeanDefinition();
      AbstractRefreshableConfigApplicationContext ac = (AbstractRefreshableConfigApplicationContext) this.applicationContext;
      DefaultListableBeanFactory bf = (DefaultListableBeanFactory) ac.getBeanFactory();
      bf.registerBeanDefinition(clazz.getName(), beanDefinition);
    } else if (this.applicationContext instanceof GenericApplicationContext) {
      BeanDefinition beanDefinition = BeanDefinitionBuilder.genericBeanDefinition(clazz).getBeanDefinition();
      GenericApplicationContext ac = (GenericApplicationContext) this.applicationContext;
      ac.registerBeanDefinition(clazz.getName(), beanDefinition);
    } else {
      throw new NoSuchBeanDefinitionException(clazz);
    }
  }
View Full Code Here

TOP

Related Classes of org.springframework.context.support.AbstractRefreshableConfigApplicationContext

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.