OSGi - JAX-RS Connector 2.0.0
JAX-RS (JSR 311) is the community-driven Standard for building RESTful web services with Java. The reference implementation for JAX-RS is Jersey and ships as OSGi bundles. This project connects Jersey and OSGi at the service level. This means that OSGi services can be published as RESTful web services by simply registering them as OSGi services ;).
When the com.eclipsesource.jaxrs.connector bundle is activated all @Path annotated
objects that are registered as OSGi services will be published as RESTful web services.
Services can be added or removed during runtime and will be published or postponed.
To publish services on different ports the http.port service property can be used.
The connector detects configuration changes during runtime (e.g. when done by the
OSGi Configuration Admin Service).
New in 2.0: Use the config admin to specify the root path. The default root path is /services. You can configure the path by specifying a config with the service.pid com.eclipsesource.jaxrs.connector and the property root. The path needs to be a valid servlet path e.g. "/api".
- OSGi Core Specification 4.2 and an OSGi HttpService implementation (e.g. Equinox, Felix).
- JRE 1.6 (same as Jersey)
Jersey 1.13 is included in the software repository.
Install from this software repository into your target: http://hstaudacher.github.com/osgi-jax-rs-connector or download the binaries:
- com.eclipsesource.jaxrs.connector_220.127.116.11208151950.jar - (src bundle)
If dependencies can't be satisfied please disable "include required software" within the target editor.
- For Eclipse: Add the com.eclipsesource.jaxrs.connector.feature (OSGi JAX-RS Connector) to your target using the url above.
- Add the com.eclipsesource.jaxrs.connector and the 3 Jersey bundles to your OSGi instance.
- Convert some OSGi service to resources like in this tutorial
- Point your client to the specified url
The code is published under the terms of the Eclipse Public License, version 1.0.