Class AbstractNettyIOClient.MessageToByteEncoder<T>

java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelOutboundHandlerAdapter
io.netty.handler.codec.MessageToByteEncoder<T>
org.openremote.agent.protocol.io.AbstractNettyIOClient.MessageToByteEncoder<T>
All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelOutboundHandler
Enclosing class:
AbstractNettyIOClient<T,U extends SocketAddress>

public static class AbstractNettyIOClient.MessageToByteEncoder<T> extends io.netty.handler.codec.MessageToByteEncoder<T>
Concrete implementations must provide an encoder to fill the ByteBuf ready to be sent `over the wire`.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

    io.netty.channel.ChannelHandler.Sharable
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     
    protected BiConsumer<T,io.netty.buffer.ByteBuf>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    MessageToByteEncoder(Class<? extends T> typeClazz, AbstractNettyIOClient<T,?> client, BiConsumer<T,io.netty.buffer.ByteBuf> encoder)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    encode(io.netty.channel.ChannelHandlerContext ctx, T msg, io.netty.buffer.ByteBuf out)
     
    void
    exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause)
     

    Methods inherited from class io.netty.handler.codec.MessageToByteEncoder

    acceptOutboundMessage, allocateBuffer, isPreferDirect, write

    Methods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter

    bind, close, connect, deregister, disconnect, flush, read

    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
  • Field Details

  • Constructor Details

  • Method Details

    • encode

      protected void encode(io.netty.channel.ChannelHandlerContext ctx, T msg, io.netty.buffer.ByteBuf out)
      Specified by:
      encode in class io.netty.handler.codec.MessageToByteEncoder<T>
    • exceptionCaught

      public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception
      Specified by:
      exceptionCaught in interface io.netty.channel.ChannelHandler
      Overrides:
      exceptionCaught in class io.netty.channel.ChannelHandlerAdapter
      Throws:
      Exception