org.activemq.io.impl
Interface PacketWriter

All Known Implementing Classes:
AbstractPacketMarshaller, AbstractPacketWriter, ActiveMQBytesMessageWriter, ActiveMQMapMessageWriter, ActiveMQMessageWriter, ActiveMQObjectMessageWriter, ActiveMQStreamMessageWriter, ActiveMQTextMessageWriter, BrokerAdminCommandWriter, BrokerInfoWriter, CachedValueWriter, CapacityInfoRequestWriter, CapacityInfoWriter, CleanupConnectionInfoWriter, ConnectionInfoWriter, ConsumerInfoWriter, DurableUnsubscribeWriter, IntResponseReceiptWriter, KeepAliveWriter, MessageAckWriter, ProducerInfoWriter, ReceiptWriter, ResponseReceiptWriter, SessionInfoWriter, TransactionInfoWriter, WireFormatInfoWriter, XATransactionInfoWriter

public interface PacketWriter

Allows instances implementing Packet to written to a DataOutput


Method Summary
 boolean canWrite(Packet packet)
           
 int getPacketType()
          Return the type of Packet
 int getWireFormatVersion()
           
 void setWireFormatVersion(int version)
          Set the wire format version
 void writePacket(Packet packet, DataOutput dataOut)
          Write a Packet instance to data output stream
 byte[] writePacketToByteArray(Packet packet)
          Serializes a Packet int a byte array
 

Method Detail

getPacketType

int getPacketType()
Return the type of Packet

Returns:
integer representation of the type of Packet

canWrite

boolean canWrite(Packet packet)
Parameters:
packet -
Returns:
true if this PacketWriter can write this type of Packet

writePacket

void writePacket(Packet packet,
                 DataOutput dataOut)
                 throws IOException
Write a Packet instance to data output stream

Parameters:
packet - the instance to be seralized
dataOut - the output stream
Throws:
IOException - thrown if an error occurs

writePacketToByteArray

byte[] writePacketToByteArray(Packet packet)
                              throws IOException
Serializes a Packet int a byte array

Parameters:
packet -
Returns:
the byte[]
Throws:
IOException

setWireFormatVersion

void setWireFormatVersion(int version)
Set the wire format version

Parameters:
version -

getWireFormatVersion

int getWireFormatVersion()
Returns:
the wire format version


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