Package org.openremote.agent.protocol.io
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
FieldsModifier and TypeFieldDescriptionprotected AbstractNettyIOClient<T,?> protected BiConsumer<T,io.netty.buffer.ByteBuf> -
Constructor Summary
ConstructorsConstructorDescriptionMessageToByteEncoder(Class<? extends T> typeClazz, AbstractNettyIOClient<T, ?> client, BiConsumer<T, io.netty.buffer.ByteBuf> encoder) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) Methods inherited from class io.netty.handler.codec.MessageToByteEncoder
acceptOutboundMessage, allocateBuffer, isPreferDirect, writeMethods inherited from class io.netty.channel.ChannelOutboundHandlerAdapter
bind, close, connect, deregister, disconnect, flush, readMethods 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
-
Field Details
-
client
-
encoder
-
-
Constructor Details
-
MessageToByteEncoder
public MessageToByteEncoder(Class<? extends T> typeClazz, AbstractNettyIOClient<T, ?> client, BiConsumer<T, io.netty.buffer.ByteBuf> encoder)
-
-
Method Details
-
encode
protected void encode(io.netty.channel.ChannelHandlerContext ctx, T msg, io.netty.buffer.ByteBuf out) - Specified by:
encodein classio.netty.handler.codec.MessageToByteEncoder<T>
-
exceptionCaught
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception - Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Overrides:
exceptionCaughtin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-