Package com.xxl.tool.jsonrpc
Class JsonRpcClient
java.lang.Object
com.xxl.tool.jsonrpc.JsonRpcClient
json-rpc client
- Author:
- xuxueli
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Tinvoke with params<T> Tinvoke with paramsstatic JsonRpcClientbuild json-rpc client<T> T<T> Tproxy servicetimeout(int timeout)
-
Constructor Details
-
JsonRpcClient
public JsonRpcClient()
-
-
Method Details
-
newClient
build json-rpc client- Returns:
-
url
-
timeout
-
header
-
header
-
proxy
-
proxy
proxy service- Type Parameters:
T- the service interface- Parameters:
service- the service nameserviceInterface- the service interface- Returns:
- service
-
invoke
invoke with params- Type Parameters:
T- the response type- Parameters:
service- the service namemethod- the method nameparams- the method paramsresponseType- the response type- Returns:
- response the response
-
invoke
public <T> T invoke(String service, String method, Object[] params, Class<T> responseType, Type[] typeArguments) invoke with params- Type Parameters:
T- the response type- Parameters:
service- the service namemethod- the method nameparams- the method paramsresponseType- the response typetypeArguments- the response type arguments- Returns:
- response the response
-