Another option (not sure if this works with Spring, should with blueprint) is to do:
bus.getExtension(BundleContext.class) to get the org.osgi.framework.BundleContext. I believe we store it on the bus like that. Then bundleContext.getBundle(); Dan On Thursday, July 12, 2012 07:01:08 PM Jim Talbut wrote: > On 12/07/2012 16:23, Jim Talbut wrote: > > Given a Bus, in a CXF interceptor running in an OSGi bundle, how can I > > get to the OSGi bundle that is responsible for actually creating the > > bus? > > The bundle of the Bus is the CXF bundle. > > If I get the ApplicationContext from the Bus then its bundle is the > > Spring bundle. > > Sometimes (though not in the example I'm testing with) the bundle I'm > > after will just be created using fileinstall, it won't have any > > classes in it at all. > > > > I guess this is more an OSGi question than a CXF question, but if > > anyone has any idea. > > Oh, I've got it: the ApplicationContext is OSGi specific and can be cast > to a subclass that has a getBundle method. > Sorted. > > Sorry for the intrusion. > > Jim -- Daniel Kulp [email protected] - http://dankulp.com/blog Talend Community Coder - http://coders.talend.com
