public class DynamicProtobufRpcProxy extends Object
ProtobufRpcProxy实现,无需要提供接口定义。| 限定符和类型 | 字段和说明 |
|---|---|
static String |
TIMEOUT_KEY
The Constant TIMEOUT_KEY.
|
| 构造器和说明 |
|---|
DynamicProtobufRpcProxy(RpcClient rpcClient)
Instantiates a new dynamic protobuf rpc proxy.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected RpcDataPackage |
buildRequestDataPackage(RpcMethodInfo rpcMethodInfo,
Object[] args)
Builds the request data package.
|
void |
close()
Close.
|
protected Object |
doInvoke(String serviceSignature,
RpcChannel rpcChannel,
Object proxy,
RpcMethodInfo rpcMethodInfo,
Method method,
Object[] args)
Do invoke.
|
Object |
invoke(String serviceSignature,
Object proxy,
Method method,
Object[] args,
Class<? extends ClientAttachmentHandler> cls)
Invoke.
|
Object |
invoke(String serviceSignature,
Object proxy,
Method method,
Object[] args,
Map<String,String> config,
Class<? extends ClientAttachmentHandler> cls)
Invoke.
|
Object |
invoke(String serviceName,
String methodName,
Object proxy,
Method method,
Object[] args,
Map<String,String> config,
Class<? extends ClientAttachmentHandler> cls) |
Object |
invoke(String serviceName,
String methodName,
Object proxy,
Method method,
Object[] args,
Map<String,String> config,
Class<? extends ClientAttachmentHandler> cls,
Class<? extends AuthenticationDataHandler> authenticationDataHandlerCls,
Class<? extends LogIDGenerator> logIdGenerateorCls)
Invoke.
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Sets the exception handler.
|
void |
setHost(String host)
Sets the host.
|
void |
setPort(int port)
Sets the port.
|
public DynamicProtobufRpcProxy(RpcClient rpcClient)
rpcClient - RPC clientpublic void setExceptionHandler(ExceptionHandler exceptionHandler)
exceptionHandler - the new exception handlerpublic Object invoke(String serviceSignature, Object proxy, Method method, Object[] args, Class<? extends ClientAttachmentHandler> cls) throws Throwable
serviceSignature - the service signatureproxy - the proxymethod - the methodargs - the argscls - the clsThrowable - the throwablepublic Object invoke(String serviceSignature, Object proxy, Method method, Object[] args, Map<String,String> config, Class<? extends ClientAttachmentHandler> cls) throws Throwable
serviceSignature - the service signatureproxy - the proxymethod - the methodargs - the argsconfig - the configcls - the clsThrowable - the throwablepublic Object invoke(String serviceName, String methodName, Object proxy, Method method, Object[] args, Map<String,String> config, Class<? extends ClientAttachmentHandler> cls) throws Throwable
Throwablepublic Object invoke(String serviceName, String methodName, Object proxy, Method method, Object[] args, Map<String,String> config, Class<? extends ClientAttachmentHandler> cls, Class<? extends AuthenticationDataHandler> authenticationDataHandlerCls, Class<? extends LogIDGenerator> logIdGenerateorCls) throws Throwable
serviceSignature - the service signatureproxy - the proxymethod - the methodargs - the argsconfig - the configcls - the clsThrowable - the throwableprotected Object doInvoke(String serviceSignature, RpcChannel rpcChannel, Object proxy, RpcMethodInfo rpcMethodInfo, Method method, Object[] args) throws Throwable
serviceSignature - the service signaturerpcChannel - the rpc channelproxy - the proxyrpcMethodInfo - the rpc method infomethod - the methodargs - the argsThrowable - the throwableprotected RpcDataPackage buildRequestDataPackage(RpcMethodInfo rpcMethodInfo, Object[] args) throws IOException
rpcMethodInfo - the rpc method infoargs - the argsIOException - Signals that an I/O exception has occurred.public void setHost(String host)
host - the new hostpublic void setPort(int port)
port - the new portpublic void close()
Copyright © 2022 Baidu, Inc.. All rights reserved.