On 7/13/2018 3:40 PM, Steinar Bang wrote:

That's interesting! Just annotating my service interface, and its
implementation with jaxrs annotations, like the StudentService and
StudentServiceImpl here...?
  
https://wiki.eclipse.org/Tutorial:_Exposing_a_Jax_REST_service_as_an_OSGi_Remote_Service

Yes.   I haven't looked at your annotations, and so don't know if they all are from the javax.ws.rs packages...but assuming so...that's the idea.


(the downside is that I would have to move to karaf 4.2, and I ran into
some issues doing when I inadvertently tried 4.2.0.  JB had some ideas
about what was the cause of my problem, and I will look into them)

It's quite possible that things would run on Karaf 4.0 or 4.0 (with java8), but I haven't tested that so don't want to make any claims. Also I found a small issue with gogo on 4.2 that's been fixed in 4.2.1 stream...but that only affects the added RSA console commands.


How would the service provided by the StudentServiceImpl component be
exposed as a REST service on HTTP in a servlet?

Yes.   For both it registers a servlet with HttpService (jetty). For CXF it's a subclass of

org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet

and for jersey it's a

org.glassfish.jersey.servlet.ServletContainer.ServletContainer

it doesn't currently use the http whiteboard, but it could...and may eventually.


Also:   I've very recently added bndtools 4 project and bndrun
templates for using either jersey or cxf to export the same jaxrs
service [2].
That's probably the answer to my previous question? :-)

I haven't had a chance to create tutorial about these templates yet,
but if you are using bndtools 4 it might be helpful.
I'm using 3.5.1 of maven-bundle-plugin, so probably not bndtools 4,
unfortunately.

Ok.

Scott

Reply via email to