Open mcculls opened 9 years ago
As Todor mentioned on the mailing list, just @Inject BundleContext wherever you need
it.
Reported by mcculls
on 2010-10-13 18:00:03
But what if I would like to refer to the BundleContext in the PeaberryActivationModule's
configure() method? It is before Guice @Inject the BundleContext object.
Reported by yungkce
on 2010-10-14 07:42:26
Can you elaborate on what you need to use the BundleContext for in the module itself?
Binding modules are usually small and side-effect free, so I'm just wondering why you
need the context when setting up bindings.
Reported by mcculls
on 2010-10-14 10:48:22
Since I would like to use the Manifest header of the bundle for setting the attributes
of the exported services inside the configure() method, the only way to get those header
is from the BundleContext.getBundle().getHeaders() method unless I can export the services
outside the configure() method.
Reported by yungkce
on 2010-11-12 10:53:02
It seems best to pass the BundleContext to the module constructor. Currently we expect
the module to have a default constructor. We could support a constructor with a BundleContext
as well. I am not sure how nice this will be since now there are two ways to obtain
the BundleContext and the users cat try to bind it a second time.
Stuart what do you think?
Reported by Rinsvind
on 2010-11-12 13:48:48
Reported by mcculls
on 2012-08-04 21:41:37
Originally reported on Google Code with ID 53
Reported by
yungkce
on 2010-10-13 11:24:00