java.lang.Object | |||
↳ | com.rabbitmq.client.RpcServer | ||
↳ | com.rabbitmq.client.StringRpcServer | ||
↳ | com.rabbitmq.tools.jsonrpc.JsonRpcServer |
JSON-RPC Server class.
Given a Java Class
, representing an interface, and an
implementation of that interface, JsonRpcServer will reflect on the
class to construct the ServiceDescription
, and will route
incoming requests for methods on the interface to the
implementation object while the mainloop() is running.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
interfaceClass | The interface this server implements. | ||||||||||
interfaceInstance | The instance backing this server. | ||||||||||
serviceDescription | Holds the JSON-RPC service description for this client. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct a server that talks to the outside world using the
given channel, and constructs a fresh temporary
queue.
| |||||||||||
Construct a server that talks to the outside world using the
given channel and queue name.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Runs a single JSON-RPC request.
| |||||||||||
Construct and encode a JSON-RPC error response for the request
ID given, using the code, message, and possible
(JSON-encodable) argument passed in.
| |||||||||||
Public API - gets the service description record that this
service built from interfaceClass at construction time.
| |||||||||||
Override our superclass' method, dispatching to doCall.
| |||||||||||
Retrieves the best matching method for the given method name and parameters.
| |||||||||||
Private API - used by errorResponse and resultResponse.
| |||||||||||
Construct and encode a JSON-RPC success response for the
request ID given, using the result value passed in.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.rabbitmq.client.StringRpcServer
| |||||||||||
From class
com.rabbitmq.client.RpcServer
| |||||||||||
From class
java.lang.Object
|
Holds the JSON-RPC service description for this client.
Construct a server that talks to the outside world using the given channel, and constructs a fresh temporary queue. Use getQueueName() to discover the created queue name.
channel | AMQP channel to use |
---|---|
interfaceClass | Java interface that this server is exposing to the world |
interfaceInstance | Java instance (of interfaceClass) that is being exposed |
IOException | if something goes wrong during an AMQP operation |
---|
Construct a server that talks to the outside world using the given channel and queue name. Our superclass, RpcServer, expects the queue to exist at the time of construction.
channel | AMQP channel to use |
---|---|
queueName | AMQP queue name to listen for requests on |
interfaceClass | Java interface that this server is exposing to the world |
interfaceInstance | Java instance (of interfaceClass) that is being exposed |
IOException | if something goes wrong during an AMQP operation |
---|
Runs a single JSON-RPC request.
requestBody | the JSON-RPC request string (a JSON encoded value) |
---|
Construct and encode a JSON-RPC error response for the request ID given, using the code, message, and possible (JSON-encodable) argument passed in.
Public API - gets the service description record that this service built from interfaceClass at construction time.
Override our superclass' method, dispatching to doCall.
Retrieves the best matching method for the given method name and parameters. Subclasses may override this if they have specialised dispatching requirements, so long as they continue to honour their ServiceDescription.
Private API - used by errorResponse and resultResponse.
Construct and encode a JSON-RPC success response for the request ID given, using the result value passed in.