On Tue, Mar 20, 2018 at 11:23 PM Scott Lewis <[email protected]> wrote:


>Any pointers on how to do that with CXFNonSpringJaxrsServlet or other
>servlet class?

I don't know how you're going about registering your servlet, but here's
how CXF does it:

https://github.com/apache/cxf/blob/3a46e586b405c79a98e37d33a30b2fa22905f853/rt/transports/http/src/main/java/org/apache/cxf/transport/http/osgi/HttpServiceTrackerCust.java


The relevant code in Microbule is here:

https://github.com/Microbule/microbule/blob/master/core/src/main/java/org/microbule/core/DefaultJaxrsServerFactory.java

Notice the use of the BusFactory.getDefaultBus(true) there. Microbule is
doing all of what you're trying to do (context providers, exception
mappers, etc.), so you should be able to use it for inspiration.

>Because I'm not using just one container, rather I am using CXF to
>implement a Remote Services distribution provider...able to run on any
>framework...and it needs to dynamically register/unregister
>servlets...via HttpService.

Are all your containers OSGi? I believe CXF should work in any OSGi
container. It doesn't use anything special to Karaf or anything upon
startup. It just uses activators. Do you need to register multiple
servlets?  Perhaps you've already explored how CXF works out-of-the-box
already, but for my use cases, the default behavior has worked just fine.

Reply via email to