org.activemq.io.impl
Interface PacketReader

All Known Implementing Classes:
AbstractPacketMarshaller, AbstractPacketReader, ActiveMQBytesMessageReader, ActiveMQMapMessageReader, ActiveMQMessageReader, ActiveMQObjectMessageReader, ActiveMQStreamMessageReader, ActiveMQTextMessageReader, BrokerAdminCommandReader, BrokerInfoReader, CachedValueReader, CapacityInfoReader, CapacityInfoRequestReader, CleanupConnectionInfoReader, ConnectionInfoReader, ConsumerInfoReader, DurableUnsubscribeReader, IntResponseReceiptReader, KeepAliveReader, MessageAckReader, ProducerInfoReader, ReceiptReader, ResponseReceiptReader, SessionInfoReader, TransactionInfoReader, WireFormatInfoReader, XATransactionInfoReader

public interface PacketReader

Allows instances implementing Packet to read from a DataOutputStream


Method Summary
 void buildPacket(Packet packet, DataInput dataIn)
          build a Packet instance from the data input stream
 boolean canRead(int packetType)
           
 Packet createPacket()
           
 int getPacketType()
          Return the type of Packet
 int getWireFormatVersion()
           
 Packet readPacketFromByteArray(byte[] data)
          Deserailizes a Packet from a byte array
 void setWireFormatVersion(int version)
          Set the wire format version
 

Method Detail

getPacketType

int getPacketType()
Return the type of Packet

Returns:
integer representation of the type of Packet

canRead

boolean canRead(int packetType)
Parameters:
packetType -
Returns:
true if this PacketReader can a Packet of this type

createPacket

Packet createPacket()
Returns:
a new Packet instance

buildPacket

void buildPacket(Packet packet,
                 DataInput dataIn)
                 throws IOException
build a Packet instance from the data input stream

Parameters:
packet - A Packet object
dataIn - the data input stream to build the packet from
Throws:
IOException

readPacketFromByteArray

Packet readPacketFromByteArray(byte[] data)
                               throws IOException
Deserailizes a Packet from a byte array

Parameters:
data -
Returns:
the deserialized Packet
Throws:
IOException

setWireFormatVersion

void setWireFormatVersion(int version)
Set the wire format version

Parameters:
version -

getWireFormatVersion

int getWireFormatVersion()
Returns:
the wire format version


Copyright © 2004-2008 Protique, Ltd.. All Rights Reserved.