Hi James,
Just wanted to let you know that with your help I was able to create an
ECF Remote Services distribution provider based upon CXF. It's
available via this repo [1]. It essentially meant extending
CXFNonSpringJaxrsServlet (which is a relatively new CXF servlet class, I
think), and explicitly setting the Bus+application+extensions in the
JAXRSServerFactoryBean [2].
Even better, for those interested, they can/could create their own
CXF-based remote services distribution provider (e.g. with their own or
other's extensions for arg/ret value serialization, transport, or other
customization) by following the same approach as in 2 and just modifying
which extensions get installed at servlet init time.
For everyone's info: ECF will be having a release within the next few
weeks, and that will also create a release of the bundles from [1].
Thanks for your help with my questions about CXF.
Scott
[1] https://github.com/ECF/JaxRSProviders
[2]
https://github.com/ECF/JaxRSProviders/blob/master/bundles/org.eclipse.ecf.provider.cxf.server/src/org/eclipse/ecf/provider/cxf/server/CXFServerDistributionProvider.java
On 3/20/2018 5:15 PM, James Carman wrote:
Mainly you just need to make sure it uses the same Bus, I believe. What
OSGi container? Why are you registering the server yourself? CXF has good
support for OSGi already.
On Tue, Mar 20, 2018 at 2:37 PM Scott Lewis <[email protected]> wrote:
Thanks James,
I'm using the OSGi HttpService and registering a
CXFNonSpringJaxrsServlet instance at runtime. I don't quite understand
how to use the JaxrsServerBeanFactory with the HttpService/servlet. By
chance do you have an example of that in Microbule? Is there
another/better CXF servlet class to use with HttpService in OSGi?
I take it from your answer that there is no CXF impl of
javax.ws.rs.Configurable...but just want to make sure.
Thanks again,
Scott
On 3/20/2018 10:52 AM, James Carman wrote:
You can use JaxrsServerBeanFactory in OSGi just fine. With that, you can
add all the providers you want. You can check out Microbule for
inspiration:
https://github.com/Microbule/microbule
On Tue, Mar 20, 2018 at 1:34 PM Scott Lewis <[email protected]>
wrote:
I'm programmatically using cxf in an osgi environment. I'm using the
servlet class: org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet,
and want to create and an impl of javax.ws.rs.core.Configurable to
register extensions (e.g. json support, etc).
Is there a cxf jaxrs impl of javax.ws.rs.core.Configurable in that I can
create programmatically, and use to register extensions like
ContextResolver, etc?
Thanksinadvance,
Scott