| 限定符和类型 | 字段和说明 |
|---|---|
protected WsonrpcConfig |
config |
protected JsonRpcEngine |
jsonRpcEngine |
protected WsonrpcLogger |
wsonrpcLogger |
| 构造器和说明 |
|---|
WsonrpcEngine(WsonrpcConfig config) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected JsonRpcResponse |
execute(WebSocketSession session,
JsonRpcRequest request) |
protected <T> T |
fromResponse(JsonRpcResponse resp,
Class<T> returnType) |
WsonrpcConfig |
getConfig() |
protected JsonImplementor |
getJsonImplementor() |
ServiceRegistry |
getServiceRegistry() |
void |
handle(WebSocketSession session,
byte[] bytes)
处理收到的JSON数据
|
protected void |
handleRequest(WebSocketSession session,
JsonRpcRequest request) |
protected void |
handleResponse(JsonRpcResponse response) |
void |
notify(WebSocketSession session,
String serviceName,
String methodName,
Object[] args) |
<T> Future<T> |
request(WebSocketSession session,
String serviceName,
String methodName,
Object[] args,
Class<T> returnType) |
void |
request(WebSocketSession session,
String serviceName,
String methodName,
Object[] args,
WsonrpcCallback callback) |
protected JsonRpcResponse |
toResponse(String id,
Object result) |
protected void |
transmit(WebSocketSession session,
JsonRpcResponse resp) |
protected final WsonrpcConfig config
protected final JsonRpcEngine jsonRpcEngine
protected final WsonrpcLogger wsonrpcLogger
public WsonrpcEngine(WsonrpcConfig config)
public final WsonrpcConfig getConfig()
public ServiceRegistry getServiceRegistry()
public void notify(WebSocketSession session, String serviceName, String methodName, Object[] args) throws IOException, WsonrpcException
public <T> Future<T> request(WebSocketSession session, String serviceName, String methodName, Object[] args, Class<T> returnType) throws IOException, WsonrpcException
public void request(WebSocketSession session, String serviceName, String methodName, Object[] args, WsonrpcCallback callback) throws IOException, WsonrpcException
public void handle(WebSocketSession session, byte[] bytes)
session - sessionbytes - 接收到的数据protected void handleRequest(WebSocketSession session, JsonRpcRequest request)
protected void handleResponse(JsonRpcResponse response)
protected JsonRpcResponse execute(WebSocketSession session, JsonRpcRequest request)
protected void transmit(WebSocketSession session, JsonRpcResponse resp)
protected JsonImplementor getJsonImplementor()
protected JsonRpcResponse toResponse(String id, Object result)
protected <T> T fromResponse(JsonRpcResponse resp, Class<T> returnType) throws JsonException, RemoteException
Copyright © 2018. All rights reserved.