T - the generic typepublic class ProtobufRpcProxy<T> extends Object implements InvocationHandler
ProxyFactory| 构造器和说明 |
|---|
ProtobufRpcProxy(RpcClient rpcClient,
Class<T> interfaceClass)
Instantiates a new protobuf rpc proxy.
|
| 限定符和类型 | 方法和说明 |
|---|---|
protected RpcDataPackage |
buildRequestDataPackage(RpcMethodInfo rpcMethodInfo,
Object[] args)
Builds the request data package.
|
void |
close()
Close.
|
protected Method[] |
getMethds()
Gets the methds.
|
protected ProtobufRPC |
getProtobufRPCAnnotation(Method method)
Gets the protobuf rpc annotation.
|
Set<String> |
getServiceSignatures()
Gets the service signatures.
|
Object |
invoke(Object proxy,
Method method,
Object[] args) |
boolean |
isLookupStubOnStartup()
Checks if is lookup stub on startup.
|
T |
proxy()
Proxy.
|
void |
setChannelPoolSharableFactory(ChannelPoolSharableFactory channelPoolSharableFactory)
Sets the channel pool sharable factory.
|
void |
setExceptionHandler(ExceptionHandler exceptionHandler)
Sets the exception handler.
|
void |
setHost(String host)
Sets the host.
|
void |
setInterceptor(InvokerInterceptor interceptor)
Sets the interceptor.
|
void |
setLookupStubOnStartup(boolean lookupStubOnStartup)
Sets the lookup stub on startup.
|
void |
setPort(int port)
Sets the port.
|
void |
setServiceLocatorCallback(ServiceLocatorCallback serviceLocatorCallback)
Sets the service locator callback.
|
public void setChannelPoolSharableFactory(ChannelPoolSharableFactory channelPoolSharableFactory)
channelPoolSharableFactory - the new channel pool sharable factorypublic void setExceptionHandler(ExceptionHandler exceptionHandler)
exceptionHandler - the new exception handlerpublic void setInterceptor(InvokerInterceptor interceptor)
interceptor - the new interceptorpublic void setServiceLocatorCallback(ServiceLocatorCallback serviceLocatorCallback)
serviceLocatorCallback - the new service locator callbackpublic boolean isLookupStubOnStartup()
public void setLookupStubOnStartup(boolean lookupStubOnStartup)
lookupStubOnStartup - the new lookup stub on startuppublic void setHost(String host)
host - the new hostpublic Set<String> getServiceSignatures()
public void setPort(int port)
port - the new portprotected Method[] getMethds()
public T proxy()
protected 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 close()
protected ProtobufRPC getProtobufRPCAnnotation(Method method)
method - the methodCopyright © 2022 Baidu, Inc.. All rights reserved.