@InterfaceAudience.Private public abstract class RpcDispatcher extends io.netty.channel.SimpleChannelInboundHandler<Object>
protected void handle(ChannelHandlerContext, MessageType)Where "MessageType" must match exactly the type of the message to handle. Polymorphism is not supported. Handlers can return a value, which becomes the RPC reply; if a null is returned, then a reply is still sent, with an empty payload.
Constructor and Description |
---|
RpcDispatcher() |
Modifier and Type | Method and Description |
---|---|
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
protected String |
name()
Override this to add a name to the dispatcher, for debugging purposes.
|
acceptInboundMessage, channelRead
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
handlerAdded, handlerRemoved, isSharable
protected String name()
protected final void channelRead0(io.netty.channel.ChannelHandlerContext ctx, Object msg) throws Exception
public final void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface io.netty.channel.ChannelHandler
exceptionCaught
in interface io.netty.channel.ChannelInboundHandler
exceptionCaught
in class io.netty.channel.ChannelInboundHandlerAdapter
Copyright © 2017 The Apache Software Foundation. All rights reserved.