T - the generic typepublic class HaProtobufRpcProxy<T> extends NamingServiceChangeListener implements org.aopalliance.intercept.MethodInterceptor
ProtobufRpcProxy supports naming service and load blanace.| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.apache.commons.logging.Log |
LOGGER
log this class.
|
| 构造器和说明 |
|---|
HaProtobufRpcProxy(RpcClient rpcClient,
Class<T> interfaceClass,
NamingService namingService)
Instantiates a new ha protobuf rpc proxy.
|
HaProtobufRpcProxy(RpcClient rpcClient,
Class<T> interfaceClass,
NamingService namingService,
NamingServiceLoadBalanceStrategyFactory loadBalanceStrategyFactory,
SocketFailOverInterceptor failOverInterceptor)
Instantiates a new ha protobuf rpc proxy.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close.
|
NamingService |
getNamingService()
Gets the naming service.
|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
boolean |
isLookupStubOnStartup()
Checks if is lookup stub on startup.
|
protected ProtobufRpcProxy<T> |
onBuildProtobufRpcProxy(RpcClient rpcClient,
Class<T> interfaceClass)
On build protobuf rpc proxy.
|
T |
proxy()
Proxy.
|
protected void |
reInit(String service,
List<RegisterInfo> list)
Re init.
|
void |
setInterceptor(InvokerInterceptor interceptor)
Sets the interceptor.
|
void |
setLookupStubOnStartup(boolean lookupStubOnStartup)
Sets the lookup stub on startup.
|
setDelay, setPeriod, startUpdateNamingServiceTaskpublic HaProtobufRpcProxy(RpcClient rpcClient, Class<T> interfaceClass, NamingService namingService)
rpcClient - the rpc clientinterfaceClass - the interface classnamingService - the naming servicepublic HaProtobufRpcProxy(RpcClient rpcClient, Class<T> interfaceClass, NamingService namingService, NamingServiceLoadBalanceStrategyFactory loadBalanceStrategyFactory, SocketFailOverInterceptor failOverInterceptor)
rpcClient - the rpc clientinterfaceClass - the interface classnamingService - the naming serviceloadBalanceStrategyFactory - the load balance strategy factoryfailOverInterceptor - the fail over interceptorpublic void setInterceptor(InvokerInterceptor interceptor)
interceptor - the new interceptorpublic boolean isLookupStubOnStartup()
public void setLookupStubOnStartup(boolean lookupStubOnStartup)
lookupStubOnStartup - the new lookup stub on startupprotected ProtobufRpcProxy<T> onBuildProtobufRpcProxy(RpcClient rpcClient, Class<T> interfaceClass)
rpcClient - the rpc clientinterfaceClass - the interface classpublic void close()
NamingServiceChangeListenerclose 在类中 NamingServiceChangeListenerpublic NamingService getNamingService()
NamingServiceChangeListenergetNamingService 在类中 NamingServiceChangeListenerprotected void reInit(String service, List<RegisterInfo> list) throws Exception
NamingServiceChangeListenerreInit 在类中 NamingServiceChangeListenerservice - the servicelist - the listException - the exceptionCopyright © 2018 Baidu, Inc.. All rights reserved.