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

    Constructors
    Constructor
    Description
    DrMessageHandler(org.gridgain.dr.configuration.DrReceiverServerView cfg)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
     
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     
    onBatchRequest(io.netty.channel.Channel channel, DrExternalBatchRequest req)
    Batch request callback.
    protected void
    onHandshake(io.netty.channel.Channel channel, DrExternalHandshakeRequest req)
    Handshake callback.
    protected void
    onMetadataRequest(io.netty.channel.Channel channel, DrExternalMetadataRequest req)
    Metadata request callback.

    Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

    channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered

    Methods inherited from class io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, handlerRemoved, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods 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

      public void channelRead(io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Specified by:
      channelRead in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class io.netty.channel.ChannelInboundHandlerAdapter
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelHandler
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelInboundHandler
      Overrides:
      exceptionCaught in class io.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

      protected void onMetadataRequest(io.netty.channel.Channel channel, DrExternalMetadataRequest req)
      Metadata request callback.
    • onBatchRequest

      protected CompletableFuture<Void> onBatchRequest(io.netty.channel.Channel channel, DrExternalBatchRequest req)
      Batch request callback.