T - the generic typepublic class HaProtobufRpcProxy<T> extends NamingServiceChangeListener implements org.aopalliance.intercept.MethodInterceptor
ProtobufRpcProxy supports naming service and load blanace.| 限定符和类型 | 字段和说明 |
|---|---|
protected ExceptionHandler |
exceptionHandler
The exception handler.
|
protected InvokerInterceptor |
interceptor
The interceptor.
|
| 构造器和说明 |
|---|
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 |
setExceptionHandler(ExceptionHandler exceptionHandler)
Sets the exception handler.
|
void |
setHeartBeatInterval(long heartBeatInterval)
Sets the heart beat interval.
|
void |
setInterceptor(InvokerInterceptor interceptor)
Sets the interceptor.
|
void |
setLookupStubOnStartup(boolean lookupStubOnStartup)
Sets the lookup stub on startup.
|
void |
setStrategyInterceptor(StrategyInterceptor strategyInterceptor)
Sets the strategy interceptor.
|
setDelay, setEnableNamingServiceCallback, setPeriod, startUpdateNamingServiceTaskprotected InvokerInterceptor interceptor
protected ExceptionHandler exceptionHandler
public 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 setHeartBeatInterval(long heartBeatInterval)
heartBeatInterval - the new heart beat intervalpublic void setStrategyInterceptor(StrategyInterceptor strategyInterceptor)
strategyInterceptor - the new strategy interceptorpublic void setExceptionHandler(ExceptionHandler exceptionHandler)
exceptionHandler - the new exception handlerpublic 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 © 2022 Baidu, Inc.. All rights reserved.