當前位置: 首頁>>代碼示例>>Java>>正文


Java GenericXmlApplicationContext.setParent方法代碼示例

本文整理匯總了Java中org.springframework.context.support.GenericXmlApplicationContext.setParent方法的典型用法代碼示例。如果您正苦於以下問題:Java GenericXmlApplicationContext.setParent方法的具體用法?Java GenericXmlApplicationContext.setParent怎麽用?Java GenericXmlApplicationContext.setParent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.context.support.GenericXmlApplicationContext的用法示例。


在下文中一共展示了GenericXmlApplicationContext.setParent方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSubContext

import org.springframework.context.support.GenericXmlApplicationContext; //導入方法依賴的package包/類
public AbstractApplicationContext createSubContext(final AbstractApplicationContext parent, final String path, final boolean allowBeanOverride) {
  final GenericXmlApplicationContext subContext = new GenericXmlApplicationContext();
  subContext.setParent(parent);
  subContext.setAllowBeanDefinitionOverriding(allowBeanOverride);
  subContext.load(path);
  subContext.refresh();
  return subContext;
}
 
開發者ID:outbrain,項目名稱:ob1k,代碼行數:9,代碼來源:SpringContextBuilder.java

示例2: deploy

import org.springframework.context.support.GenericXmlApplicationContext; //導入方法依賴的package包/類
@Override
public Promise<String> deploy(String springTemplate) {
    Resource templateResource = new ByteArrayResource(springTemplate.getBytes());
    GenericXmlApplicationContext appContext = new GenericXmlApplicationContext();
    appContext.setParent(applicationContext);
    appContext.load(templateResource);
    appContext.refresh();
    ApplicationStack applicationStack = appContext.getBean("applicationStack", ApplicationStack.class);
    applicationStack.deploy();
    return applicationStack.getUrl();
}
 
開發者ID:pedropaulovc,項目名稱:aws-flow-maven-eclipse-samples,代碼行數:12,代碼來源:DeploymentWorkflowImpl.java

示例3: createContext

import org.springframework.context.support.GenericXmlApplicationContext; //導入方法依賴的package包/類
/**
 * @param springConfig
 */
public void createContext(final String springConfig) {

  // Detect whether this app is configured with an XML or @Configuration.
  if (springConfig.endsWith(".xml")) {
    context = new GenericXmlApplicationContext();
    context.setParent(parent);

    ((GenericXmlApplicationContext) context).load(springConfig);
  }
  else {
    context = new AnnotationConfigApplicationContext();
    context.setParent(parent);

    try {
      Class<?> c = Class.forName(springConfig);
      ((AnnotationConfigApplicationContext) context).register(c);
    } catch (ClassNotFoundException e) {
      throw new IllegalArgumentException(e);
    }
  }

  if (!listeners.isEmpty()) {
    for (ApplicationListener<?> listener : listeners) {
      context.addApplicationListener(listener);
    }
    listeners.clear();
  }

  ConfigurableListableBeanFactory factory = context.getBeanFactory();

  BeanPostProcessor vertxSupportProcessor = new VertxAwareBeanPostProcessor(vertx);
  factory.addBeanPostProcessor(vertxSupportProcessor);

  BeanPostProcessor containerSupportProcessor = new ContainerAwareBeanPostProcessor(container);
  factory.addBeanPostProcessor(containerSupportProcessor);
}
 
開發者ID:chipat,項目名稱:mod-lang-spring-updated,代碼行數:40,代碼來源:VertxApplicationContext.java


注:本文中的org.springframework.context.support.GenericXmlApplicationContext.setParent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。