ContextType - Service request context type (will be used as context for request handlers).public class Dispatcher<ContextType extends ContextInterface> extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
Dispatcher.RequestHandler<ContextType extends ContextInterface>
JSON-RPC call.
|
| Constructor and Description |
|---|
Dispatcher() |
| Modifier and Type | Method and Description |
|---|---|
com.thetransactioncompany.jsonrpc2.JSONRPC2Response |
dispatch(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request,
ContextType context)
Handles request.
|
void |
register(String method,
Dispatcher.RequestHandler<? super ContextType> handler)
Registers RPC handler.
|
void |
register(String method,
ReturningMethod<? super ContextType> rpcMethod)
Registers result-returning method for RPC call.
|
void |
register(String method,
VoidMethod<? super ContextType> rpcMethod)
Registers no-result method for RPC call.
|
public void register(String method, Dispatcher.RequestHandler<? super ContextType> handler)
method - RPC method.handler - Request handler for RPC method.public void register(String method, ReturningMethod<? super ContextType> rpcMethod)
method - RPC method.rpcMethod - RPC method.public void register(String method, VoidMethod<? super ContextType> rpcMethod)
method - RPC method.rpcMethod - RPC method.public com.thetransactioncompany.jsonrpc2.JSONRPC2Response dispatch(com.thetransactioncompany.jsonrpc2.JSONRPC2Request request,
ContextType context)
request - Request call.context - Execution context.Copyright © 2015 RafaĆ Wrzeszcz - Wrzasq.pl. All rights reserved.