本文整理汇总了Java中org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.close方法的典型用法代码示例。如果您正苦于以下问题:Java OsgiBundleXmlApplicationContext.close方法的具体用法?Java OsgiBundleXmlApplicationContext.close怎么用?Java OsgiBundleXmlApplicationContext.close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext
的用法示例。
在下文中一共展示了OsgiBundleXmlApplicationContext.close方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initApplicationContext
import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; //导入方法依赖的package包/类
protected void initApplicationContext() throws Exception {
OsgiBundleXmlApplicationContext ac = new OsgiBundleXmlApplicationContext();
try {
ac.setBundleContext(bundleContext());
ac.setPublishContextAsService(false);
String[] springConfigFiles = getSpringConfigFiles();
if (springConfigFiles != null && springConfigFiles.length > 0) {
ac.setConfigLocations(springConfigFiles);
}
// ac.refresh();
ac.normalRefresh();
ac.start();
} catch (Exception e) {
ac.close();
throw e;
}
this.applicationContext = ac;
}
示例2: testXmlOsgiContext
import org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext; //导入方法依赖的package包/类
public void testXmlOsgiContext() throws Exception {
OsgiBundleXmlApplicationContext context = new OsgiBundleXmlApplicationContext(
new String[] { "/org/springframework/osgi/iandt/context/no-op-context.xml" });
context.setBundleContext(bundleContext);
context.refresh();
checkedPublishedOSGiService(2);
context.close();
}