0

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.

рüффп
  • 5,172
  • 34
  • 67
  • 113
user2997551
  • 109
  • 1
  • 7
  • Eclipse Virgo isn't which is where Spring DM went. Also you should still be able to register and consume an OSGi service yourself, although it would require some more work by yourself. – M. Deinum Jun 04 '14 at 05:58

1 Answers1

1

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"/>
Martin Baumgartner
  • 3,524
  • 3
  • 20
  • 31