public interface Packet
Modifier and Type | Field and Description |
---|---|
static int |
INITIAL_PACKET_SIZE |
Modifier and Type | Method and Description |
---|---|
void |
decode(ActiveMQBuffer buffer)
decodes the buffer into this packet
|
ActiveMQBuffer |
encode(RemotingConnection connection)
Encodes the packet and returns a
ActiveMQBuffer containing the data |
default int |
expectedEncodeSize()
This will return the expected packet size for the encoding
|
long |
getChannelID()
Returns the channel id of the channel that should handle this packet.
|
int |
getPacketSize()
returns the size needed to encode this packet.
|
byte |
getType()
returns the type of the packet.
|
boolean |
isRequiresConfirmations()
returns true if a confirmation should be sent on receipt of this packet.
|
boolean |
isResponse()
returns true if this packet is being sent in response to a previously received packet
|
default void |
release()
The packe wasn't used because the stream is closed,
this gives a chance to sub classes to cleanup anything that won't be used.
|
void |
setChannelID(long channelID)
Sets the channel id that should be used once the packet has been successfully decoded it is
sent to the correct channel.
|
static final int INITIAL_PACKET_SIZE
void setChannelID(long channelID)
channelID
- the id of the channel to handle the packetdefault int expectedEncodeSize()
long getChannelID()
boolean isResponse()
byte getType()
This is needed when decoding the packet
ActiveMQBuffer encode(RemotingConnection connection)
ActiveMQBuffer
containing the dataconnection
- the connectionvoid decode(ActiveMQBuffer buffer)
buffer
- the buffer to decode fromint getPacketSize()
boolean isRequiresConfirmations()
default void release()
Copyright © 2017 JBoss by Red Hat. All rights reserved.