예제 #1
0
파일: TheBeanFactory.java 프로젝트: cer/pia
 public static ApplicationContext getApplicationContext(String selector, String factoryKey) {
   if (selector == null) selector = "configurations/default-spring-context.xml";
   if (factoryKey == null) factoryKey = "spring-context.xml";
   BeanFactoryReference reference =
       ContextSingletonBeanFactoryLocator.getInstance(
               System.getProperty("spring.configuration", selector))
           .useBeanFactory(factoryKey);
   BeanFactory beanFactory = reference.getFactory();
   return (ApplicationContext) beanFactory;
 }
예제 #2
0
파일: TheBeanFactory.java 프로젝트: cer/pia
 public static Object getBean(String selector, String factoryKey, String name, Class type) {
   if (selector == null) selector = "configurations/default-spring-context.xml";
   if (factoryKey == null) factoryKey = "spring-context.xml";
   BeanFactoryReference reference =
       ContextSingletonBeanFactoryLocator.getInstance(
               System.getProperty("spring.configuration", selector))
           .useBeanFactory(factoryKey);
   BeanFactory beanFactory = reference.getFactory();
   return beanFactory.getBean(name, type);
 }