Описание тега jsonrpc4j
JSON-RPC for Java
This project aims to provide the facility to easily implement JSON-RPC for the java programming language. jsonrpc4j uses the Jackson library to convert java objects to and from json objects (and other things related to JSON-RPC).
Features Include:
- Streaming server (
InputStream
\OutputStream
) - HTTP Server (
HttpServletRequest
\HttpServletResponse
) - Portlet Server (
ResourceRequest
\ResourceResponse
) - Socket Server (
StreamServer
) - Integration with the Spring Framework (
RemoteExporter
) - Streaming client
- HTTP client
- Dynamic client proxies
- Annotations support
- Custom error resolving
- Composite services
Maven
This project is built with Maven. Be sure to check the pom.xml for the dependencies if you're not using maven. If you're already using spring you should have most (if not all) of the dependencies already - outside of maybe the Jackson Library. Jsonrpc4j is available from the maven central repo. Add the following to your pom.xml if you're using maven:
In <dependencies>
:
<!-- jsonrpc4j -->
<dependency>
<groupId>com.github.briandilley.jsonrpc4j</groupId>
<artifactId>jsonrpc4j</artifactId>
<version>1.1</version>
</dependency>
JSON-RPC specification
The official source for the JSON-RPC 2.0 specification. The guys over at json-rpc google groupseem to be fairly active, so you can ask clarifying questions there.
Streaming server and client
Jsonrpc4j comes with a streaming server and client to support applications of all types
(not just HTTP). The JsonRpcClient
and JsonRpcServer
have simple methods
that take InputStream
s and OutputStream
s. Also in the library is a JsonRpcHttpClient
which extends the JsonRpcClient
to add HTTP support.
Spring Framework
jsonrpc4j provides a RemoteExporter
to expose java services as JSON-RPC over HTTP without
requiring any additional work on the part of the programmer. The following example explains
how to use the JsonServiceExporter
within the Spring Framework.