在其他osgi包的spring上下文文件中定义的访问bean

时间:2014-06-04 00:38:55

标签: spring osgi osgi-bundle jbossfuse apache-servicemix

我们如何将一个bundle的Spring上下文文件中定义的bean访问到另一个?

示例可能是ActiveMQ poolable连接工厂:在所有捆绑包中定义ActiveMQ连接工厂没有意义。

一种解决方案是使用OSGI服务,但Spring DM已退役。

1 个答案:

答案 0 :(得分:1)

我猜您正在寻找双子座蓝图:https://www.eclipse.org/gemini/blueprint/documentation/reference/1.0.2.RELEASE/html/index.html

发布服务:

<osgi:service id="myService" ref="simpleService"                          
  interface="org.xyz.MyService" />

获取服务:

<osgi:reference id="myService" interface="org.xyz.MyService"/>