ByteToMessageDecoder and MessageToByteEncoder.
Be aware that sub-classes of ByteToMessageCodec MUST NOT
annotated with @Sharable.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteToMessageDecoder | |
| private final MessageToByteEncoder | |
| private final TypeParameterMatcher |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | ByteToMessageCodec(Class<? extends I> outboundMessageType)
see |
| protected | ByteToMessageCodec(BufferAllocator
The allocator to use for allocating buffers.
If allocator)null, the channel context allocator will be used.Create a new instance which will try to detect the types to match out of the type parameter of the class. |
| protected | ByteToMessageCodec(Class<? extends I>
The type of messages to match. outboundMessageType, BufferAllocator The allocator to use for allocating buffers.
If allocator)null, the channel context allocator will be used.Create a new instance |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | acceptOutboundMessage(Object
the message msg)Returns |
| public void | channelInactive(ChannelHandlerContext ctx)
Overrides default io. Channel of the ChannelHandlerContext was registered is now inactive and reached its
end of lifetime.
|
| public void | channelRead(ChannelHandlerContext ctx, Object msg)
Overrides default io. Channel has read a message from the peer.
|
| public void | channelReadComplete(ChannelHandlerContext ctx)
Overrides default io. channelRead(ChannelHandlerContext, Object).
|
| protected abstract void | |
| protected void | |
| protected abstract void | |
| public void | handlerAdded(ChannelHandlerContext ctx)
Overrides default io. ChannelHandler was added to the actual context and it's ready to handle events.
|
| public void | handlerRemoved(ChannelHandlerContext ctx)
Overrides default io. ChannelHandler was removed from the actual context and it doesn't handle events
anymore.
|
| public final boolean | isSharable()
Overrides default io. true if this handler is sharable and thus can be added
to more than one ChannelPipeline.
|
| public Future | write(ChannelHandlerContext
the ctx, Object ChannelHandlerContext for which the write operation is madethe message to write msg)Overrides default io. |
| decoder | back to summary |
|---|---|
| private final ByteToMessageDecoder decoder | |
| encoder | back to summary |
|---|---|
| private final MessageToByteEncoder<I> encoder | |
| outboundMsgMatcher | back to summary |
|---|---|
| private final TypeParameterMatcher outboundMsgMatcher | |
| ByteToMessageCodec | back to summary |
|---|---|
| protected ByteToMessageCodec() see | |
| ByteToMessageCodec | back to summary |
|---|---|
| protected ByteToMessageCodec(Class<? extends I> outboundMessageType) see | |
| ByteToMessageCodec | back to summary |
|---|---|
| protected ByteToMessageCodec(BufferAllocator allocator) Create a new instance which will try to detect the types to match out of the type parameter of the class.
| |
| ByteToMessageCodec | back to summary |
|---|---|
| protected ByteToMessageCodec(Class<? extends I> outboundMessageType, BufferAllocator allocator) Create a new instance
| |
| acceptOutboundMessage | back to summary |
|---|---|
| public boolean acceptOutboundMessage(Object msg) throws Exception Returns
| |
| channelInactive | back to summary |
|---|---|
| public void channelInactive(ChannelHandlerContext ctx) throws Exception Overrides default io. Doc from io. The
| |
| channelRead | back to summary |
|---|---|
| public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception Overrides default io. Doc from io. Invoked when the current
| |
| channelReadComplete | back to summary |
|---|---|
| public void channelReadComplete(ChannelHandlerContext ctx) throws Exception Overrides default io. Doc from io. Invoked when the last message read by the current read operation has been consumed by
| |
| decode | back to summary |
|---|---|
| protected abstract void decode(ChannelHandlerContext ctx, Buffer in) throws Exception | |
| decodeLast | back to summary |
|---|---|
| protected void decodeLast(ChannelHandlerContext ctx, Buffer in) throws Exception | |
| encode | back to summary |
|---|---|
| protected abstract void encode(ChannelHandlerContext ctx, I msg, Buffer out) throws Exception | |
| handlerAdded | back to summary |
|---|---|
| public void handlerAdded(ChannelHandlerContext ctx) throws Exception Overrides default io. Doc from io. Gets called after the
| |
| handlerRemoved | back to summary |
|---|---|
| public void handlerRemoved(ChannelHandlerContext ctx) throws Exception Overrides default io. Doc from io. Gets called after the
| |
| isSharable | back to summary |
|---|---|
| public final boolean isSharable() Overrides default io. Doc from io. Returns
| |
| write | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Called once a write operation is made. The write operation will write the messages through the
| |
| Modifier and Type | Field and Description |
|---|---|
| private final BufferAllocator |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | acceptOutboundMessage(Object msg)
Overrides io. true if the given message should be handled.
|
| protected Buffer | allocateBuffer(ChannelHandlerContext
the ctx, I ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to be encoded msg)Implements abstract io. Buffer which will be used as argument of encode(ChannelHandlerContext, I, Buffer).
|
| protected void | encode(ChannelHandlerContext
the ctx, I ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to encode msg, Buffer the out)Buffer into which the encoded message will be writtenImplements abstract io. Buffer.
|
| allocator | back to summary |
|---|---|
| private final BufferAllocator allocator | |
| Encoder | back to summary |
|---|---|
| pack-priv Encoder(BufferAllocator allocator) | |
| acceptOutboundMessage | back to summary |
|---|---|
| public boolean acceptOutboundMessage(Object msg) throws Exception Overrides io. Doc from io. Returns
| |
| allocateBuffer | back to summary |
|---|---|
| protected Buffer allocateBuffer(ChannelHandlerContext ctx, I msg) throws Exception Implements abstract io. Doc from io. Allocate a
| |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, I msg, Buffer out) throws Exception Implements abstract io. Doc from io. Encode a message into a
| |