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, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public 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.ChannelInboundHandler
channelRead
in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
Exception
public 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.ChannelHandler
exceptionCaught
in interface org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandler
exceptionCaught
in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
Exception
public 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.ChannelInboundHandler
channelInactive
in class org.apache.flink.shaded.netty4.io.netty.channel.ChannelInboundHandlerAdapter
Exception
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.