user2997551
user2997551

Reputation: 109

Access beans defined in spring context files of other osgi bundles

How can we access beans defined in Spring context files of one bundle into another?

Example might be ActiveMQ poolable connection factory: it doesn't make sense to define ActiveMQ connection factory in all the bundles.

One solution is to use OSGI service but Spring DM is decommissioned.

Upvotes: 0

Views: 276

Answers (1)

Martin Baumgartner
Martin Baumgartner

Reputation: 3652

I guess you are looking for Gemini Blueprint: https://www.eclipse.org/gemini/blueprint/documentation/reference/1.0.2.RELEASE/html/index.html

Publish a service:

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

Fetch a service:

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

Upvotes: 1

Related Questions