tree: f53a8fd766a1590baa2aded0e77d7f7882b70a51 [path history] [tgz]
  1. README.md
  2. karaf-blueprint-example-client/
  3. karaf-blueprint-example-common/
  4. karaf-blueprint-example-features/
  5. karaf-blueprint-example-provider/
  6. pom.xml
examples/karaf-blueprint-example/README.md

Apache Karaf Blueprint Example

Abstract

Blueprint is a convenient way of using services. You can describe your beans and services using a XML descriptor. You can write this XML by hand or use annotation and let the blueprint-maven-plugin generates the XML for you.

Artifacts

  • karaf-blueprint-example-common provides the BookingService interface and Booking POJO.
  • karaf-blueprint-example-provider implements and exposes a BookingService using a Blueprint XML file.
  • karaf-blueprint-example-client uses OSGI-INF/blueprint/client.xml Blueprint XML to get a service and start a thread.
  • karaf-blueprint-example-features contains a Karaf features repository used for the deployment.

## Build

Simply use:

mvn clean install

## Feature and Deployment

On a running Karaf instance, you register the blueprint example features repository with:

karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-blueprint-example-features/LATEST/xml

Then you can install the karaf-blueprint-example-provider feature:

karaf@root()> feature:install karaf-blueprint-example-provider

Now, you can install the karaf-blueprint-example-client feature:

karaf@root()> feature:install karaf-blueprint-example-client

When you install the client feature, you should see on the console:

karaf@root()> 1794197511025182174 | John Doo | AF3030