How can I get a BundleContext in Spring DM?

I am recently on Spring DM and I would like to access the bundlecontext. My problem is that I have a package with Activator, but it does not have an xml configuration file. I cannot touch this package, then I need to access the BundleContext and serviceReference in order to get the service in my package. I am using Spring DM in my kit. So how can I get a BundleContext?

Thank!

Hello!

+5
source share
2 answers

One way is to implement BundleContextAware, and the other is if you do not want to rely on DM and its mechanisms:

BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
+8
source

Spring DM , BundleContextAware, . , , - , , , Spring DMs, .

0

All Articles