【问题标题】:Access beans defined in spring context files of other osgi bundles访问其他osgi包的spring上下文文件中定义的bean
【发布时间】:2014-07-24 11:59:39
【问题描述】:

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

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

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

【问题讨论】:

  • Eclipse Virgo 并不是 Spring DM 的所在。此外,您应该仍然可以自己注册和使用 OSGi 服务,尽管这需要您自己做更多的工作。

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


【解决方案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"/>

【讨论】:

    猜你喜欢
    • 2011-04-16
    • 2011-10-08
    • 2011-12-16
    • 1970-01-01
    • 1970-01-01
    • 2011-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多