如何在osgi container之外调用osgi bundle的对象和方法
来源:互联网 发布:算法流程图模板 编辑:程序博客网 时间:2024/05/21 17:55
环境为Jboss7 + felix osgi
已经在jboss7中部署了一个osgi bundle, web应用没有打包成osgi,依然是普通的war,现在要解决的是想在war中调用这个osgi bundle的对象和方法。
解决方案:
bundle为BUNDLENAME-1.0.jar,注意Dependencies里要在名字BUNDLENAME前面加上deployment. 后面加上:1.0.0 (不是1.0!)
这样,在web应用里可以像引用普通jar里的对象方法一样来引用这个bundle里的对象方法。
pom.xml里做一下配置,这段配置的作用是在生成的war里面的META-INF/MANIFEST.MF中添加上Dependencies: BUNDLENAME:1.0.0这个header
<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-war-plugin</artifactId><version>2.1.1</version><configuration> <failOnMissingWebXml>false</failOnMissingWebXml> <archive> <addMavenDescriptor>false</addMavenDescriptor><manifestEntries> <Dependencies>deployment.BUNDLENAME:1.0.0</Dependencies> </manifestEntries> </archive> <webResources><resource> <directory>src/main/webapps</directory> <excludes><!-- exclude>**/*.jar</exclude --> </excludes></resource> </webResources> <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes></configuration> </plugin>
- 如何在osgi container之外调用osgi bundle的对象和方法
- 如何在eclipse中基于maven创建osgi的bundle
- 在OSGi container中运行bundle时无法获取derby的数据库连接
- OSGI bundle的打包方法及注意事项
- OSGI bundle的知识
- OSGi介绍及OSGi的Bundle应用
- OSGi介绍及OSGi的Bundle应用
- OSGI BUNDLE
- 补充 OSGI bundle的知识
- 浅析OSGI的bundle依赖
- OSGI的bundle监听类
- JBPM5服务端Bundle在OSGI平台上问题的分析和处理
- osgi中org.osgi.service.cm bundle组件的使用
- 在Eclipse中开发OSGi Bundle
- ServiceMix中部署:OSGi Bundle和Feature
- OSGi起步(3):bundle之间的依赖
- OSGi Bundle的构建策略及实践
- OSGi Bundle的构建策略及实践
- Invalid node name 1PTBAK-DB1 entered in an input argument--rac安装之hotsname命名
- RingtoneManager——铃声设置相关
- PreparedStatement 查询大容量数据内存溢出解决 .
- 注册表增改删 设置IE主页
- 【Service】使用有道翻译API构建翻译服务
- 如何在osgi container之外调用osgi bundle的对象和方法
- sqlldr时候Field in data file exceeds maximum length
- ebook中的购物车
- svn检出的时候报 Unable to connect to a repository at URL错误
- 【构建Android缓存模块】(一)吐槽与原理分析
- Android 编程下 Touch 事件的分发和消费机制
- 编译Linphone-android补充说明
- 【学习记录】关于Pin Tools的学习记录
- 统计服务器AYSAUX使用空间过多的问题