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!
One way is to implement BundleContextAware, and the other is if you do not want to rely on DM and its mechanisms:
BundleContextAware
BundleContext bundleContext = FrameworkUtil.getBundle(this.getClass()).getBundleContext();
Spring DM , BundleContextAware, . , , - , , , Spring DMs, .