REQ - the type of request the client will send.RESP - the type of response the client expects to receive.@Internal
public class ClientHandler<REQ extends MessageBody,RESP extends MessageBody>
extends org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
Client to handling incoming messages.| Constructor and Description |
|---|
ClientHandler(String clientName,
MessageSerializer<REQ,RESP> serializer,
ClientHandlerCallback<RESP> callback)
Creates a handler with the callback.
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelInactive(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
exceptionCaught(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharablepublic ClientHandler(String clientName, MessageSerializer<REQ,RESP> serializer, ClientHandlerCallback<RESP> callback)
clientName - the name of the client.serializer - the serializer used to (de-)serialize messages.callback - Callback for responses.public void channelRead(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx,
Object msg)
throws Exception
channelRead in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerchannelRead in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void exceptionCaught(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerexceptionCaught in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerexceptionCaught in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelInactive(org.apache.flink.shaded.netty4.io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerchannelInactive in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapterExceptionCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.