public class RpcClient extends Object
| 构造器和说明 |
|---|
RpcClient(EndPoint endPoint) |
RpcClient(EndPoint endPoint,
RpcClientOptions options) |
RpcClient(List<EndPoint> endPoints) |
RpcClient(List<EndPoint> endPoints,
RpcClientOptions option,
List<Interceptor> interceptors) |
RpcClient(String namingServiceUrl) |
RpcClient(String namingServiceUrl,
RpcClientOptions options) |
RpcClient(String namingServiceUrl,
RpcClientOptions options,
List<Interceptor> interceptors) |
RpcClient(String serviceUrl,
RpcClientOptions options,
List<Interceptor> interceptors,
NamingService namingService)
parse naming service url, connect to servers
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addEndPoints(Collection<EndPoint> addList) |
protected void |
deleteEndPoints(Collection<EndPoint> deleteList) |
io.netty.bootstrap.Bootstrap |
getBootstrap() |
CopyOnWriteArrayList<BrpcChannelGroup> |
getHealthyInstances() |
List<Interceptor> |
getInterceptors() |
Protocol |
getProtocol() |
RpcClientOptions |
getRpcClientOptions() |
ThreadPool |
getThreadPool() |
CopyOnWriteArrayList<BrpcChannelGroup> |
getUnhealthyInstances() |
void |
removeChannel(io.netty.channel.Channel channel) |
void |
removeLogId(long id) |
void |
returnChannel(io.netty.channel.Channel channel) |
io.netty.channel.Channel |
selectChannel()
业务手动选择channel,
这类channel由业务自己调用returnChannel归还给连接池,
或者调用removeChannel从连接池中删除。
|
<T> Future<T> |
sendRequest(RpcRequest rpcRequest,
Type responseType,
RpcCallback<T> callback) |
void |
setServiceInterface(Class clazz) |
void |
stop() |
void |
triggerCallback(Runnable runnable) |
void |
updateEndPoints(List<EndPoint> newEndPoints) |
public RpcClient(String namingServiceUrl)
public RpcClient(String namingServiceUrl, RpcClientOptions options)
public RpcClient(String namingServiceUrl, RpcClientOptions options, List<Interceptor> interceptors)
public RpcClient(String serviceUrl, RpcClientOptions options, List<Interceptor> interceptors, NamingService namingService)
serviceUrl - format like "list://127.0.0.1:8200"options - rpc client optionspublic RpcClient(EndPoint endPoint)
public RpcClient(EndPoint endPoint, RpcClientOptions options)
public RpcClient(List<EndPoint> endPoints, RpcClientOptions option, List<Interceptor> interceptors)
public void setServiceInterface(Class clazz)
public void stop()
public io.netty.channel.Channel selectChannel()
public void returnChannel(io.netty.channel.Channel channel)
public void removeChannel(io.netty.channel.Channel channel)
public <T> Future<T> sendRequest(RpcRequest rpcRequest, Type responseType, RpcCallback<T> callback)
public void triggerCallback(Runnable runnable)
public void addEndPoints(Collection<EndPoint> addList)
protected void deleteEndPoints(Collection<EndPoint> deleteList)
public void removeLogId(long id)
public RpcClientOptions getRpcClientOptions()
public Protocol getProtocol()
public CopyOnWriteArrayList<BrpcChannelGroup> getHealthyInstances()
public CopyOnWriteArrayList<BrpcChannelGroup> getUnhealthyInstances()
public List<Interceptor> getInterceptors()
public io.netty.bootstrap.Bootstrap getBootstrap()
public ThreadPool getThreadPool()
Copyright © 2018 Baidu, Inc.. All rights reserved.