com.alibaba.rocketmq.remoting.netty
类 NettyRemotingServer
java.lang.Object
com.alibaba.rocketmq.remoting.netty.NettyRemotingAbstract
com.alibaba.rocketmq.remoting.netty.NettyRemotingServer
- 所有已实现的接口:
- RemotingServer, RemotingService
public class NettyRemotingServer
- extends NettyRemotingAbstract
- implements RemotingServer
Remoting服务端实现
- 从以下版本开始:
- 2013-7-13
- 作者:
- shijia.wxr
|
方法摘要 |
ExecutorService |
getCallbackExecutor()
|
ChannelEventListener |
getChannelEventListener()
|
Pair<NettyRequestProcessor,ExecutorService> |
getProcessorPair(int requestCode)
|
RPCHook |
getRPCHook()
|
void |
invokeAsync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback)
|
void |
invokeOneway(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis)
|
RemotingCommand |
invokeSync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis)
|
int |
localListenPort()
服务器绑定的本地端口 |
void |
registerDefaultProcessor(NettyRequestProcessor processor,
ExecutorService executor)
|
void |
registerProcessor(int requestCode,
NettyRequestProcessor processor,
ExecutorService executor)
注册请求处理器,ExecutorService必须要对应一个队列大小有限制的阻塞队列,防止OOM |
void |
registerRPCHook(RPCHook rpcHook)
|
void |
shutdown()
|
void |
start()
|
| 从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NettyRemotingServer
public NettyRemotingServer(NettyServerConfig nettyServerConfig)
NettyRemotingServer
public NettyRemotingServer(NettyServerConfig nettyServerConfig,
ChannelEventListener channelEventListener)
start
public void start()
- 指定者:
- 接口
RemotingService 中的 start
registerProcessor
public void registerProcessor(int requestCode,
NettyRequestProcessor processor,
ExecutorService executor)
- 从接口
RemotingServer 复制的描述
- 注册请求处理器,ExecutorService必须要对应一个队列大小有限制的阻塞队列,防止OOM
- 指定者:
- 接口
RemotingServer 中的 registerProcessor
registerDefaultProcessor
public void registerDefaultProcessor(NettyRequestProcessor processor,
ExecutorService executor)
- 指定者:
- 接口
RemotingServer 中的 registerDefaultProcessor
invokeSync
public RemotingCommand invokeSync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis)
throws InterruptedException,
RemotingSendRequestException,
RemotingTimeoutException
- 指定者:
- 接口
RemotingServer 中的 invokeSync
- 抛出:
InterruptedException
RemotingSendRequestException
RemotingTimeoutException
invokeAsync
public void invokeAsync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback)
throws InterruptedException,
RemotingTooMuchRequestException,
RemotingTimeoutException,
RemotingSendRequestException
- 指定者:
- 接口
RemotingServer 中的 invokeAsync
- 抛出:
InterruptedException
RemotingTooMuchRequestException
RemotingTimeoutException
RemotingSendRequestException
invokeOneway
public void invokeOneway(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis)
throws InterruptedException,
RemotingTooMuchRequestException,
RemotingTimeoutException,
RemotingSendRequestException
- 指定者:
- 接口
RemotingServer 中的 invokeOneway
- 抛出:
InterruptedException
RemotingTooMuchRequestException
RemotingTimeoutException
RemotingSendRequestException
shutdown
public void shutdown()
- 指定者:
- 接口
RemotingService 中的 shutdown
getChannelEventListener
public ChannelEventListener getChannelEventListener()
- 指定者:
- 类
NettyRemotingAbstract 中的 getChannelEventListener
getCallbackExecutor
public ExecutorService getCallbackExecutor()
- 指定者:
- 类
NettyRemotingAbstract 中的 getCallbackExecutor
registerRPCHook
public void registerRPCHook(RPCHook rpcHook)
- 指定者:
- 接口
RemotingService 中的 registerRPCHook
getRPCHook
public RPCHook getRPCHook()
- 指定者:
- 类
NettyRemotingAbstract 中的 getRPCHook
localListenPort
public int localListenPort()
- 从接口
RemotingServer 复制的描述
- 服务器绑定的本地端口
- 指定者:
- 接口
RemotingServer 中的 localListenPort
- 返回:
- PORT
getProcessorPair
public Pair<NettyRequestProcessor,ExecutorService> getProcessorPair(int requestCode)
- 指定者:
- 接口
RemotingServer 中的 getProcessorPair
Copyright © 2012-2015. All Rights Reserved.