Package org.gridgain.internal.dr
Class DrMessageHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
org.gridgain.internal.dr.DrMessageHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Sharable
public class DrMessageHandler
extends io.netty.channel.ChannelInboundHandlerAdapter
DR message handler. The handler processes connection messages (like handshake, ping) synchronously, and trigger async events on data
messages.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Constructor Summary
ConstructorsConstructorDescriptionDrMessageHandler(org.gridgain.dr.configuration.DrReceiverServerView cfg) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg) voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) protected CompletableFuture<Void>onBatchRequest(io.netty.channel.Channel channel, DrExternalBatchRequest req) Batch request callback.protected voidonHandshake(io.netty.channel.Channel channel, DrExternalHandshakeRequest req) Handshake callback.protected voidonMetadataRequest(io.netty.channel.Channel channel, DrExternalMetadataRequest req) Metadata request callback.Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
DrMessageHandler
public DrMessageHandler(org.gridgain.dr.configuration.DrReceiverServerView cfg) Constructor.- Parameters:
cfg- DR receiver configuration.
-
-
Method Details
-
channelRead
- Specified by:
channelReadin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
channelReadin classio.netty.channel.ChannelInboundHandlerAdapter
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelInboundHandlerAdapter
-
onHandshake
protected void onHandshake(io.netty.channel.Channel channel, DrExternalHandshakeRequest req) throws HandshakeFailedException Handshake callback.- Throws:
HandshakeFailedException- If protocol mismatch found.
-
onMetadataRequest
Metadata request callback. -
onBatchRequest
protected CompletableFuture<Void> onBatchRequest(io.netty.channel.Channel channel, DrExternalBatchRequest req) Batch request callback.
-