This example shows how to use JAX-RS to implement a REST service.
This example uses blueprint to deal with the jaxrs-server and Apache CXF as the implementation of the JAXRS specification.
It implements a BookingService
with a REST implementation.
The "client" bundle uses the BookingService
with a REST client stub.
- karaf-rest-example-api is a common bundle containing the
Booking
POJO and theBookingService
interface. - karaf-rest-example-whiteboard is a whiteboard bundle providing the
BookingServiceRest
implementation of theBookingService
interface. - karaf-rest-example-features provides a Karaf features repository used for the deployment.
The build uses Apache Maven. Simply use:
mvn clean install
On a running Karaf instance, register the features repository using:
karaf@root()> feature:repo-add mvn:ru.agentlab/karaf-rest-features/LATEST/xml
Then, you can install the service provider feature:
karaf@root()> feature:install karaf-rest-whiteboard