Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.activemq.io.impl
Class AbstractPacketWriter  view AbstractPacketWriter download AbstractPacketWriter.java

java.lang.Object
  extended byorg.activemq.io.impl.AbstractPacketWriter
All Implemented Interfaces:
PacketWriter
Direct Known Subclasses:
ActiveMQMessageWriter, BrokerAdminCommandWriter, BrokerInfoWriter, CachedValueWriter, CapacityInfoRequestWriter, CapacityInfoWriter, CleanupConnectionInfoWriter, ConnectionInfoWriter, ConsumerInfoWriter, DurableUnsubscribeWriter, KeepAliveWriter, MessageAckWriter, ProducerInfoWriter, ReceiptWriter, SessionInfoWriter, TransactionInfoWriter, WireFormatInfoWriter, XATransactionInfoWriter

public abstract class AbstractPacketWriter
extends java.lang.Object
implements PacketWriter

Allows instances implementing Packet interface to be serailized/deserailized


Field Summary
protected  int wireFormatVersion
           
 
Constructor Summary
AbstractPacketWriter()
           
 
Method Summary
 boolean canWrite(org.activemq.message.Packet packet)
           
 int getWireFormatVersion()
           
 void setWireFormatVersion(int version)
          Set the wire format version
protected  void writeObject(java.lang.Object object, java.io.DataOutput dataOut)
          Simple (but inefficent) utility method to write an object on to a stream
 void writePacket(org.activemq.message.Packet p, java.io.DataOutput dataOut)
          Write a Packet instance to data output stream
 byte[] writePacketToByteArray(org.activemq.message.Packet packet)
          Serializes a Packet int a byte array
protected  void writeUTF(java.lang.String str, java.io.DataOutput dataOut)
          simple helper method to ensure null strings are catered for
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.activemq.io.impl.PacketWriter
getPacketType
 

Field Detail

wireFormatVersion

protected int wireFormatVersion
Constructor Detail

AbstractPacketWriter

public AbstractPacketWriter()
Method Detail

writeUTF

protected void writeUTF(java.lang.String str,
                        java.io.DataOutput dataOut)
                 throws java.io.IOException
simple helper method to ensure null strings are catered for


canWrite

public boolean canWrite(org.activemq.message.Packet packet)
Specified by:
canWrite in interface PacketWriter

writeObject

protected void writeObject(java.lang.Object object,
                           java.io.DataOutput dataOut)
                    throws java.io.IOException
Simple (but inefficent) utility method to write an object on to a stream


writePacketToByteArray

public byte[] writePacketToByteArray(org.activemq.message.Packet packet)
                              throws java.io.IOException
Serializes a Packet int a byte array

Specified by:
writePacketToByteArray in interface PacketWriter

writePacket

public void writePacket(org.activemq.message.Packet p,
                        java.io.DataOutput dataOut)
                 throws java.io.IOException
Write a Packet instance to data output stream

Specified by:
writePacket in interface PacketWriter

setWireFormatVersion

public void setWireFormatVersion(int version)
Set the wire format version

Specified by:
setWireFormatVersion in interface PacketWriter

getWireFormatVersion

public int getWireFormatVersion()
Specified by:
getWireFormatVersion in interface PacketWriter