public abstract class NettyRemotingAbstract extends Object
Modifier and Type | Field and Description |
---|---|
protected Pair<NettyRequestProcessor,ExecutorService> |
defaultRequestProcessor |
protected com.lts.job.remoting.netty.NettyRemotingAbstract.NettyEventExecutor |
nettyEventExecutor |
protected HashMap<Integer,Pair<NettyRequestProcessor,ExecutorService>> |
processorTable |
protected ConcurrentHashMap<Integer,ResponseFuture> |
responseTable |
protected Semaphore |
semaphoreAsync |
protected Semaphore |
semaphoreOneway |
Constructor and Description |
---|
NettyRemotingAbstract(int permitsOneway,
int permitsAsync) |
Modifier and Type | Method and Description |
---|---|
abstract ExecutorService |
getCallbackExecutor() |
abstract ChannelEventListener |
getChannelEventListener() |
void |
invokeAsyncImpl(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis,
InvokeCallback invokeCallback) |
void |
invokeOnewayImpl(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis) |
RemotingCommand |
invokeSyncImpl(io.netty.channel.Channel channel,
RemotingCommand request,
long timeoutMillis) |
void |
processMessageReceived(io.netty.channel.ChannelHandlerContext ctx,
RemotingCommand msg) |
void |
processRequestCommand(io.netty.channel.ChannelHandlerContext ctx,
RemotingCommand cmd) |
void |
processResponseCommand(io.netty.channel.ChannelHandlerContext ctx,
RemotingCommand cmd) |
void |
putNettyEvent(NettyEvent event) |
void |
scanResponseTable() |
protected final Semaphore semaphoreOneway
protected final Semaphore semaphoreAsync
protected final ConcurrentHashMap<Integer,ResponseFuture> responseTable
protected final HashMap<Integer,Pair<NettyRequestProcessor,ExecutorService>> processorTable
protected final com.lts.job.remoting.netty.NettyRemotingAbstract.NettyEventExecutor nettyEventExecutor
protected Pair<NettyRequestProcessor,ExecutorService> defaultRequestProcessor
public NettyRemotingAbstract(int permitsOneway, int permitsAsync)
public abstract ChannelEventListener getChannelEventListener()
public void putNettyEvent(NettyEvent event)
public void processRequestCommand(io.netty.channel.ChannelHandlerContext ctx, RemotingCommand cmd)
public void processResponseCommand(io.netty.channel.ChannelHandlerContext ctx, RemotingCommand cmd)
public void processMessageReceived(io.netty.channel.ChannelHandlerContext ctx, RemotingCommand msg) throws Exception
Exception
public abstract ExecutorService getCallbackExecutor()
public void scanResponseTable()
public RemotingCommand invokeSyncImpl(io.netty.channel.Channel channel, RemotingCommand request, long timeoutMillis) throws InterruptedException, RemotingSendRequestException, RemotingTimeoutException
public void invokeAsyncImpl(io.netty.channel.Channel channel, RemotingCommand request, long timeoutMillis, InvokeCallback invokeCallback) throws InterruptedException, RemotingTooMuchRequestException, RemotingTimeoutException, RemotingSendRequestException
public void invokeOnewayImpl(io.netty.channel.Channel channel, RemotingCommand request, long timeoutMillis) throws InterruptedException, RemotingTooMuchRequestException, RemotingTimeoutException, RemotingSendRequestException
Copyright © 2014. All Rights Reserved.