【发布时间】:2014-12-10 22:56:44
【问题描述】:
谁能解释一下如何将 OSGI DS 配置为单例? 我使用 Equinox 作为 OSGi 容器。
SCR 组件
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Simple Dictionary">
<implementation class="foo.bar.services.DictionaryImpl"/>
<service>
<provide interface="foo.bar.services.Dictionary"/>
</service>
</scr:component>
OSGI 控制台输出
osgi> 服务 (objectClass=foo.bar.services*)
{foo.bar.services.Dictionary}={
component.name=简单字典,
组件.id=0,
service.id=51,
service.bundleid=7,
service.scope=bundle
}
“由捆绑注册:” foo.bar.services_1.0.0.qualifier [7]
“没有使用服务的捆绑包。”
【问题讨论】:
标签: java osgi declarative-services