Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] finding a BundleContext

Hello,

I'm trying to find the BundleContext for some random bundle I received
through a BundleEvent.
I see spring-osgi does it like this:

     Method m = bundle.getClass().getDeclaredMethod("getContext", new
Class[0]);
     m.setAccessible(true);
     return (BundleContext) m.invoke(bundle, new Object[0]);

Is there a better way ?

Tom


Back to the top