The JSONRPC exporter (RoSe_exporter.jabsorb) allows you to create a JSONRPC endpoint from an OSGi service.

Install

In order to use the RoSe JSONRPC exporter you need to deploy the following bundles:

<dependency>
    <artifactId>jabsorb-exporter</artifactId>
    <groupId>org.ow2.chameleon.rose.jsonrpc</groupId>
    <version>${rose.version}</version>
</dependency>
  • the org.jabsorb bundle (here),
  • an HttpService (such as the felix HttpService Jetty, here,
  • and the RoSe core (snapshot, release).

Overview

Component name: RoSe_exporter.jabsorb

Property Default Value Type Description
jsonrpc.servlet.name “/JSONRPC” String path of the JSONRPC broker

Usage

Once you have deployed the bundles on the gateway, in order to the JSONRPC exporter, you must add an instance of RoSe_exporter.jabsorb to your RoSe machine.

  • If you have create the machine through the Json Configuration file. json "component" : [ { "factory" : "RoSe_exporter.jabsorb" } ]

  • If you have create the machine through the Java Fluent API java import static org.ow2.chameleon.rose.api.Machine; import static org.ow2.chameleon.rose.api.MachineBuilder.machine; [...] //add the jsonrpc exporter to your machine. machine.exporter("RoSe_exporter.jabsorb").create();

By default, all the out connection defined in your machine will then use the jsonrpc exporter to create an endpoint. The endpoint will be publish through the url: http://{machineUrl}:{port}/JSONRPC.

You can change the default endpoint url, by setting the property jsonrpc.servlet.name when you declare the instance.