REQ
- the type of request the client will send.RESP
- the type of response the client expects to receive.public class ClientHandler<REQ extends MessageBody,RESP extends MessageBody>
extends org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandlerAdapter
NetworkClient
to handling incoming messages.Constructor and Description |
---|
ClientHandler(MessageSerializer<REQ,RESP> serializer,
ClientHandlerCallback<RESP> callback)
Creates a handler with the callback.
|
Modifier and Type | Method and Description |
---|---|
void |
channelInactive(org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRead(org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandlerContext ctx,
Object msg) |
void |
exceptionCaught(org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
channelActive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
public ClientHandler(MessageSerializer<REQ,RESP> serializer, ClientHandlerCallback<RESP> callback)
serializer
- the serializer used to (de-)serialize messages.callback
- Callback for responses.public void channelRead(org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandlerContext ctx, Object msg)
channelRead
in interface org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandler
channelRead
in class org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandlerAdapter
public void exceptionCaught(org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
exceptionCaught
in interface org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandler
exceptionCaught
in interface org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandler
exceptionCaught
in class org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandlerAdapter
public void channelInactive(org.apache.paimon.shade.netty4.io.netty.channel.ChannelHandlerContext ctx)
channelInactive
in interface org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandler
channelInactive
in class org.apache.paimon.shade.netty4.io.netty.channel.ChannelInboundHandlerAdapter
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.