private ServiceRegistration publishServerAsAService(StandardService server) {
Properties props = new Properties();
// put some extra properties to easily identify the service
props.put(Constants.SERVICE_VENDOR, "Spring Dynamic Modules");
props.put(Constants.SERVICE_DESCRIPTION, ServerInfo.getServerInfo());
props.put(Constants.BUNDLE_VERSION, ServerInfo.getServerNumber());
props.put(Constants.BUNDLE_NAME, bundleContext.getBundle().getSymbolicName());
// spring-dm specific property
props.put("org.springframework.osgi.bean.name", "tomcat-server");
// publish just the interfaces and the major classes (server/handlerWrapper)
String[] classes = new String[] { StandardService.class.getName(), Service.class.getName(),
MBeanRegistration.class.getName(), Lifecycle.class.getName() };
return bundleContext.registerService(classes, server, props);
}
Activator.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:spring-osgi
作者:
评论列表
文章目录