Hi,

I use bus-extensions.txt mechanism to register PolicyInterceptorProvider under 
OSGi.
This works almost always correct, except the cases when the interceptor code 
should obtain bundle context (for example to use OSGi ConfigurationAdmin 
properties or other OSGi services). Under some circumstances (I guess when CXF 
bus in bundle is updated) bundle context is null or incorrect.
I tried to get bundle context using

a)      CXF extension: BundleContext bundleContext = 
bus.getExtension(BundleContext.class)

b)      OSGi:
      Bundle runtimeBundle = FrameworkUtil.getBundle(MyCustomInterceptor.class);
     BundleContext bundleContext = runtimeBundle.getBundleContext();

but both methods seems to be not robust.

The question: is there alternative way to register PolicyInterceptorProvider in 
OSGi using Blueprint or SpringDM context?

Regards,
Andrei.

Reply via email to