Previous Topic

Next Topic

Book Contents

Book Index

Adding JSON-RPC Methods

The Remote JSON-RPC Provider locates an exported service by module and then calls Java methods of this module.

Mapping Convention

To map a JSON-RPC method to a service, the provider uses the following convention:

where <service_pid> stands for the persistent ID of the service and <method> stands for a name common to the JSON-RPC method and to the Java method of the service. For example the Event Admin Remote Handler supports the following JSON-RPC method:

EA is the service PID (abbreviated from Event Admin) and subscribe is the method.

Steps to Export a Service over JSON-RPC

Step 1: Implement the service to be exported:

Step 2: Register the service in the OSGi framework with the following registration properties: