public interface RemotingServer extends RemotingService
| 限定符和类型 | 方法和说明 |
|---|---|
Pair<NettyRequestProcessor,ExecutorService> |
getProcessorPair(int requestCode) |
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
|
registerRPCHook, shutdown, startvoid registerProcessor(int requestCode,
NettyRequestProcessor processor,
ExecutorService executor)
requestCode - processor - executor - void registerDefaultProcessor(NettyRequestProcessor processor, ExecutorService executor)
int localListenPort()
Pair<NettyRequestProcessor,ExecutorService> getProcessorPair(int requestCode)
RemotingCommand invokeSync(io.netty.channel.Channel channel, RemotingCommand request, long timeoutMillis) throws InterruptedException, RemotingSendRequestException, RemotingTimeoutException
void invokeAsync(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback)
throws InterruptedException,
RemotingTooMuchRequestException,
RemotingTimeoutException,
RemotingSendRequestException
void invokeOneway(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis)
throws InterruptedException,
RemotingTooMuchRequestException,
RemotingTimeoutException,
RemotingSendRequestException
Copyright © 2012–2016. All rights reserved.