public class UnifiedProtocolDecoder extends InboundHandler<ByteBuffer,Void>
InboundHandler
that reads the protocol bytes
Protocols
and based on the protocol it creates the
appropriate handlers.
The ProtocolDecoder doesn't forward to the dst; it replaces itself once the
protocol bytes are known. So that is why the Void type for dst.channel, dst, src
Constructor and Description |
---|
UnifiedProtocolDecoder(IOService ioService,
UnifiedProtocolEncoder protocolEncoder) |
Modifier and Type | Method and Description |
---|---|
void |
handlerAdded()
Gets called when this ChannelHandler is added to the pipeline.
|
HandlerStatus |
onRead()
A callback to indicate that data is available in the src to be
processed.
|
initSrcBuffer, initSrcBuffer
dst, dst, interceptError, setChannel, src, src
public UnifiedProtocolDecoder(IOService ioService, UnifiedProtocolEncoder protocolEncoder)
public void handlerAdded()
ChannelHandler
handlerAdded
in class ChannelHandler<InboundHandler,ByteBuffer,Void>
public HandlerStatus onRead() throws Exception
InboundHandler
onRead
in class InboundHandler<ByteBuffer,Void>
Exception
- if something fails while reading data from the src
or processing the data (e.g. when a Packet fails to get processed). When an
exception is thrown, the ChannelErrorHandler
is called.Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.