OSGi Remote Jersey
OSGi Remote Jersey
The Jersey extender picks up OSGi services and registers them as Jersey based JAX-RS components.
Currently the extender supports two service properties:
org.everit.osgi.remote.jersey.component: When this property has the value true, the OSGi service will be picked up by the extender and registered as a Jersey component.
org.everit.osgi.remote.jackson: When this property is set to true, the extender registers the Jackson feature to the Jersey Servlet.
In case a registered OSGi service has the type java.util.Collection, each member of the collection will be handled as a Jersey component. If the collection contains four objects, the newly created Jersey servlet will contain four components.
A component can be
In case a special feature is to be used during the processing of registered components, the user should register a Collection that holds the original components and the type of the Feature(s) as well.
All service properties beginning with org.everit.osgi.remote.jersey.prop. will be passed to the ResourceConfig of Jersey.
E.g.:
If a service property with the following key is defined: org.everit.osgi.remote.jersey.prop.jersey.config.server.wadl.disableWadl
This will pass the jersey.config.server.wadl.disableWadl property to Jersey with the value that the service property had.
The extender itself simply creates a Servlet OSGi service that contains the Jersey components. It is the user`s task to register the newly created OSGi service to any of the containers.
However, the newly created service will contain all service properties that the original OSGi service had. The user has the possibility to define properties in the original OSGi service that makes the Servlet registered. The easiest way is to use the felix-whiteboard module or if there is an implementation, use the OSGi HTTP Whiteboard Service properties.
The extender has a webconsole plugin. On the webconsole, there should be a "Jersey Extender" menu item. Within the page, there is a table that shows the services that were picked up and also the Servlet services that were created.
Examples are avaialable in the Integration test project. The "tests" project is available in the source repository.