We have an application where where we would like to run Jersey using OSGi Equinox. Please provide any help or pointers. All that I have been getting on net is using Apache Felix. I do not want to do that. My App uses the below things
Angular JS for Client side code Jersey for Rest Services OSGi Equinox and Jetty for deployment.
Please suggest if this is possible and if yes then how
See https://github.com/everit-org/osgi-remote-jersey/tree/v1.0.2
The solution works on felix and equinox as well.
Update based on the question (without an extender):
You can implement the same logic as the extender does. In short:
ResourceConfig resourceConfig = new ResourceConfig();
resourceConfig.register(myJAXRSAnnotatedObjectOrClassType);
Servlet servletContainer = new ServletContainer(resourceConfig);
// register the newly created servlet instance to the server
You can register that servlet in several ways:
You can call resourceConfig.register multiple times. In this way, you can register many JARS annotated classes under one servlet instance.
With resourceConfig.register you can not only register JAXRS annotated classes, but also any component that Jersey knows about. For example, if you want to add JSON parsing feature, you can use:
resourceConfig.register(JacksonFeature.class);