Mar 1st, 2010, 06:43 PM
How to obtain a reference to a bean in a different bundle
I am new to Spring/OSGI and the question I have is:
Is there a programmatic way to obtain the reference of a bean declared in another bundle, given I know the bean name or the class name?
I know the way to invoke a service by using BundleContext and ServiceReference when the BundleContext is obtained via BundleContextAware Interface. I donít know how to do a similar thing when the bean is not a service.
Mar 3rd, 2010, 01:02 PM
By default spring application context was published as service, so your code could get a reference to the applicationContext and get whatever you want.
Mar 3rd, 2010, 04:38 PM
Don't know why this didn't occur to me. Thank for your response I would try this out.