Skip to content
This repository has been archived by the owner on Nov 18, 2022. It is now read-only.

Commit

Permalink
Update README.md for 4.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
hstaudacher committed Feb 15, 2015
1 parent 9cef098 commit 366fb93
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# OSGi - JAX-RS Connector 4.1
# OSGi - JAX-RS Connector 4.2
[![Build Status](https://travis-ci.org/hstaudacher/osgi-jax-rs-connector.png)](https://travis-ci.org/hstaudacher/osgi-jax-rs-connector) [![Maven Status](https://maven-badges.herokuapp.com/maven-central/com.eclipsesource.jaxrs/publisher/badge.png)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.eclipsesource.jaxrs%22)

![](http://download.eclipsesource.com/~hstaudacher/connector.png)
![](http://download.eclipsesource.com/~hstaudacher/connector.png)

[JAX-RS (JSR 311)](http://jsr311.java.net/) is the community-driven standard for
building RESTful web services with Java. The reference implementation for JAX-RS is
[Jersey](http://jersey.java.net/) and ships as OSGi bundles.
Expand All @@ -14,10 +15,13 @@ RESTful web services by simply registering them as OSGi services. A neat side fe
The OSGi-JAX-RS Connector provides **two main bundles**. A **publisher** and a **consumer**. Both can be used completely separately or together, it's up to you. Additional the connector provides custom `@Provider` and `Feature` implementations that can be used optionally.

### Publisher
The publisher is located in the bundle `com.eclipsesource.jaxrs.publisher`. All it does is tracking OSGi services. When it spots a service that is annotated with the JAX-RS annotations `@Path`/`@Provider` or it extends `Feature` the work begins. The publisher hooks these services into Jersey and the OSGi HTTPService. Basically this means it publishes them as RESTful web services. It's just that simple!

The publisher is located in the bundle `com.eclipsesource.jaxrs.publisher`. All it does is tracking services. When it spots a service that is annotated with the JAX-RS annotations `@Path` or `@Provider` the work begins. The publisher hooks these services into Jersey and the OSGi HTTPService. Basically this means it publishes them as RESTful web services. It's just that simple.
By default the publisher registers the services using the context path `/services`. This means an OSGi service that is annotated with `@Path( "/foo" )` will be available using the path `/services/foo`. This context path is configurable using the OSGi configuration admin. You can configure the service using the service.pid `com.eclipsesource.jaxrs.connector` with the following properties:

By default the publisher registers the services using the context path `/services`. This means an OSGi service that is annotated with `@Path( "/foo" )` will be available using the path `/services/foo`. This context path is configurable using the OSGi configuration admin. You can configure the service using the service.pid `com.eclipsesource.jaxrs.connector` and the property `root` to define a custom path.
* `root` : defines a custom root path. Default is `/services`.
* `disableWadl` : disables the wadl generation. Default is `false`.
* `publishDelay` : the time in ms to wait after a resource was registered before its going to be published. Default is `150`.

As said earlier, the publisher uses the OSGi HTTPService to publish the services. As a result all configuration topics regarding ports, protocol and so on are up to the HTTPService implementation of your choice.

Expand All @@ -37,7 +41,7 @@ The custom `@Provider` and `Feature` implementations are located in their own fe
* `com.eclipsesource.jaxrs.provider.moxy` - Allows the de/serialization using [EclipseLink MOXy](http://www.eclipse.org/eclipselink/moxy.php).
* `com.eclipsesource.jaxrs.provider.gson` - Allows the de/serialization using [Gson](https://code.google.com/p/google-gson/).
* `com.eclipsesource.jaxrs.provider.security` - Provides an OSGi friendly integration of Jersey's/JAX-RS security features. [Read the wiki for more information](https://github.com/hstaudacher/osgi-jax-rs-connector/wiki/security).
* `com.eclipsesource.jaxrs.provider.sse` - Provides an integration of Jersey's [SSE feature](https://jersey.java.net/documentation/latest/sse.html).
* `com.eclipsesource.jaxrs.provider.sse` - Provides an integration of Jersey's [SSE feature](https://jersey.java.net/documentation/latest/sse.html) *(requires javax.servlet 3.x)*.
* `com.eclipsesource.jaxrs.provider.multipart` - Provides an integration of Jersey's [Multipart feature](https://jersey.java.net/documentation/latest/media.html#multipart).

## Installation
Expand Down Expand Up @@ -80,27 +84,25 @@ Besides these basic example two example exist that are shwoing how the [security
### Consumer Examples
The example for the consumer is splitted into two bundles called `com.eclipsesource.jaxrs.consumer.example` and `com.eclipsesource.jaxrs.consumer.example.caller`. The example bundle contains the data model and the resource interface while the caller just calls the service. The example fetches data from github and is pretty simple.

## Apache Karaf Integration
### Apache Karaf Integration
If you want to deploy the connector into [Apache Karaf](http://karaf.apache.org/) take a look at the [karaf-integration example](https://github.com/hstaudacher/osgi-jax-rs-connector/tree/master/examples/karaf-integration). To get tarted read the step-by-step guide in the [README](https://github.com/hstaudacher/osgi-jax-rs-connector/tree/master/examples/karaf-integration/README.md).

## Starter Kit
### Starter Kit
If you are working with [Bndtools](http://bndtools.org), a [Starter Kit](https://github.com/BryanHunt/bndtools-equinox-app-kit) is available to help you get going. You will most likely want either the [rest](https://github.com/BryanHunt/bndtools-equinox-app-kit/tree/rest) or [mongo-rest](https://github.com/BryanHunt/bndtools-equinox-app-kit/tree/mongo-rest) branch.

## Requirements
* OSGi Core Specification R4 and an OSGi HttpService implementation (e.g. Equinox, Felix).
* JRE 1.7 (same as Jersey 2.6+)
* *If you want to use the SSE provider you need javax.servlet
API 3.x*

## Jersey version
With Jersey 2.0 the library was splitted into several modules with a whole bunch of dependencies. To ease the OSGi application development Jersey was rebundled in this project and ships as a single bundle called `com.eclipsesource.jaxrs.jersey.all`. Currently it includes Jersey 2.10.1 and it's dependencies. Also the Eclipse Source Bundle will be shipped to make the Jersey API more discoverable when using Eclipse.

## Alternatives
* [Neil Bartlett's jaxrs-osgi-extender](https://github.com/njbartlett/jaxrs-osgi-extender)
* OSGi Remote Services (e.g. [Apache CXF](http://cxf.apache.org/distributed-osgi-reference.html#DistributedOSGiReference-ServiceProviderpropertiesForConfiguringRESTfulJAXRSbasedendpointsandconsumers))
With Jersey 2.0 the library was splitted into several modules with a whole bunch of dependencies. To ease the OSGi application development Jersey was rebundled in this project and ships as a single bundle called `com.eclipsesource.jaxrs.jersey.all`. Currently it includes Jersey 2.16 and it's dependencies. Also the Eclipse Source Bundle will be shipped to make the Jersey API more discoverable when using Eclipse.

## Changelog
Checkout the [github releases](https://github.com/hstaudacher/osgi-jax-rs-connector/releases).

## License
The code is published under the terms of the [Eclipse Public License, version 1.0](http://www.eclipse.org/legal/epl-v10.html).

Included binaries from [Jersey](http://jersey.java.net/) (rebundled), version 2.10.1, which are published under two licenses, the [CDDL 1.1 and GPL 2 with CPE](http://glassfish.java.net/public/CDDL+GPL_1_1.html)
Included binaries from [Jersey](http://jersey.java.net/) (rebundled), version 2.16, which are published under two licenses, the [CDDL 1.1 and GPL 2 with CPE](http://glassfish.java.net/public/CDDL+GPL_1_1.html)

0 comments on commit 366fb93

Please sign in to comment.