随笔分类 -  OSGI

解决启动bundle后Activitor中的方法不执行
摘要:此文章限于用Maven 构建的Osgi(felix)写好一个例子,并用maven已经编译好,将其在外部运行,如图所示但是start之后并不执行各个bundle中的Activator(Activator中都有输出语句)原来是在MANIFETS.MF中没有指定ActivatorBundle-Activator: com.demo.Activator如何指定?可以在eclipse中的pom.xml中添加属性:<properties> <Bundle-Activator>com.demo.use.Activator</Bundle-Activator></pr 阅读全文
posted @ 2012-04-18 10:28 haoxx 阅读(982) 评论(2) 推荐(1)
the jar is empty
摘要:又犯了一个愚蠢的错误,今天利用maven来构建OSGI,创建一个父工程之后,接着创建mavevn module 在pom.xml中添加了代码 <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.1.0</version> <extensions>true</extensions> 阅读全文
posted @ 2012-04-10 16:55 haoxx 阅读(416) 评论(0) 推荐(0)
OSGI API
摘要:I ServiceFactory的講解 一、首先我們實現一個繼承ServiceFactory接口聽服務Bean.如下:public class HelloServiceFactory implementsServiceFactory{ private int usageCounter = 0; public Object getService(Bundle bundle, ServiceRegistration registration) { System.out.println("Create object of HelloService for " + bundle.. 阅读全文
posted @ 2012-04-10 13:56 haoxx 阅读(664) 评论(0) 推荐(0)