Remote service admin RPC does not appear in the OSGI standard document. It is an extraction of the serialization/deserialization functionality from remote service admin. It is part of the remote service admin feature.
rsa_json_rpc
is a serialization implementation based on JSON representation. It uses libdfi
to convert function invocation information into JSON messages. The interface description is configured through the description file in the interface consumer/provider. See the libdfi documentation for the interface description file.
Properties | Type | Description |
---|---|---|
RSA_JSON_RPC_LOG_CALLS | bool | If set to true, the RSA will Log calls info to the file in RSA_JSON_RPC_LOG_CALLS_FILE. Default is false. |
RSA_JSON_RPC_LOG_CALLS_FILE | string | Log file. If RSA_JSON_RPC_LOG_CALLS is enabled, the service calls info will be writen to the file(If restart this bundle, it will truncate file). Default is stdout. |
build_rsa_json_rpc=True Default is False
RSA_JSON_RPC=ON Default is OFF
The implementation of rsa_json_rpc
includes two parts: 1. Creation of remote service endpoints; 2. Creation of remote service proxies
When a service is exported, RSA can use rsa_json_rpc to create a service endpoint. When a service is called, the service endpoint calls the corresponding service instance after the RPC request is deserialized. The detailed process is as follows diagram:
When a service is imported, RSA can use rsa_json_rpc to create a proxy service factory. When a service is requested, the proxy service factory creates the proxy service and gives it to the service requester. Then, when the requested service is called (i.e. the service proxy is called), the service proxy serializes the service call information into an RPC request. And the RPC request will be sent to remote endpoint by RSA. The detailed process is as follows diagram:
In the above process, each consumer of the remote service will have a different service proxy, because the service proxy needs to use the interface description file in the consumer (which may be a bundle) to serialize the service call information.
See the cmake target remote-services-shm-server
and remote-services-shm-client
.