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(boolean preferDirect)
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, boolean preferDirect)Create a new instance |
| 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(boolean preferDirect) 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, boolean preferDirect) 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 io. Implements io. Doc from io. Calls
| |
| channelRead | back to summary |
|---|---|
| public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| channelReadComplete | back to summary |
|---|---|
| public void channelReadComplete(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| decode | back to summary |
|---|---|
| protected abstract void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception | |
| decodeLast | back to summary |
|---|---|
| protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception | |
| encode | back to summary |
|---|---|
| protected abstract void encode(ChannelHandlerContext ctx, I msg, ByteBuf out) throws Exception | |
| handlerAdded | back to summary |
|---|---|
| public void handlerAdded(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Gets called after the
| |
| handlerRemoved | back to summary |
|---|---|
| public void handlerRemoved(ChannelHandlerContext ctx) throws Exception Overrides io. Implements io. Doc from io. Gets called after the
| |
| write | back to summary |
|---|---|
| public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception Overrides io. Implements io. Doc from io. Calls
| |
| 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 void | encode(ChannelHandlerContext
the ctx, I ChannelHandlerContext which this MessageToByteEncoder belongs tothe message to encode msg, ByteBuf the out)ByteBuf into which the encoded message will be writtenImplements abstract io. ByteBuf.
|
| Encoder | back to summary |
|---|---|
| pack-priv Encoder(boolean preferDirect) | |
| acceptOutboundMessage | back to summary |
|---|---|
| public boolean acceptOutboundMessage(Object msg) throws Exception Overrides io. Doc from io. Returns
| |
| encode | back to summary |
|---|---|
| protected void encode(ChannelHandlerContext ctx, I msg, ByteBuf out) throws Exception Implements abstract io. Doc from io. Encode a message into a
| |