public class NettyRemotingClient extends NettyRemotingAbstract implements RemotingClient
defaultRequestProcessor, nettyEventExecutor, processorTable, responseTable, semaphoreAsync, semaphoreOneway
Constructor and Description |
---|
NettyRemotingClient(NettyClientConfig nettyClientConfig) |
NettyRemotingClient(NettyClientConfig nettyClientConfig,
ChannelEventListener channelEventListener) |
Modifier and Type | Method and Description |
---|---|
void |
closeChannel(io.netty.channel.Channel channel) |
void |
closeChannel(String addr,
io.netty.channel.Channel channel) |
ExecutorService |
getCallbackExecutor() |
ChannelEventListener |
getChannelEventListener() |
void |
invokeAsync(String addr,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback)
异步调用
|
void |
invokeOneway(String addr,
RemotingCommand request,
long timeoutMillis)
单向调用
|
RemotingCommand |
invokeSync(String addr,
RemotingCommand request,
long timeoutMillis)
同步调用
|
void |
registerDefaultProcessor(NettyRequestProcessor processor,
ExecutorService executor)
注册默认处理器
|
void |
registerProcessor(int requestCode,
NettyRequestProcessor processor,
ExecutorService executor)
注册处理器
|
void |
shutdown() |
void |
start() |
invokeAsyncImpl, invokeOnewayImpl, invokeSyncImpl, processMessageReceived, processRequestCommand, processResponseCommand, putNettyEvent, scanResponseTable
public NettyRemotingClient(NettyClientConfig nettyClientConfig)
public NettyRemotingClient(NettyClientConfig nettyClientConfig, ChannelEventListener channelEventListener)
public void start()
start
in interface RemotingClient
public void shutdown()
shutdown
in interface RemotingClient
public void closeChannel(String addr, io.netty.channel.Channel channel)
public void closeChannel(io.netty.channel.Channel channel)
public void registerProcessor(int requestCode, NettyRequestProcessor processor, ExecutorService executor)
RemotingClient
registerProcessor
in interface RemotingClient
public void registerDefaultProcessor(NettyRequestProcessor processor, ExecutorService executor)
RemotingClient
registerDefaultProcessor
in interface RemotingClient
public RemotingCommand invokeSync(String addr, RemotingCommand request, long timeoutMillis) throws InterruptedException, RemotingConnectException, RemotingSendRequestException, RemotingTimeoutException
RemotingClient
invokeSync
in interface RemotingClient
InterruptedException
RemotingConnectException
RemotingSendRequestException
RemotingTimeoutException
public void invokeAsync(String addr, RemotingCommand request, long timeoutMillis, InvokeCallback invokeCallback) throws InterruptedException, RemotingConnectException, RemotingTooMuchRequestException, RemotingTimeoutException, RemotingSendRequestException
RemotingClient
invokeAsync
in interface RemotingClient
InterruptedException
RemotingConnectException
RemotingTooMuchRequestException
RemotingTimeoutException
RemotingSendRequestException
public void invokeOneway(String addr, RemotingCommand request, long timeoutMillis) throws InterruptedException, RemotingConnectException, RemotingTooMuchRequestException, RemotingTimeoutException, RemotingSendRequestException
RemotingClient
invokeOneway
in interface RemotingClient
InterruptedException
RemotingConnectException
RemotingTooMuchRequestException
RemotingTimeoutException
RemotingSendRequestException
public ExecutorService getCallbackExecutor()
getCallbackExecutor
in class NettyRemotingAbstract
public ChannelEventListener getChannelEventListener()
getChannelEventListener
in class NettyRemotingAbstract
Copyright © 2014. All Rights Reserved.