org.activemq.io.impl
Class StatelessDefaultWireFormat

java.lang.Object
  extended by org.activemq.io.AbstractWireFormat
      extended by org.activemq.io.impl.AbstractDefaultWireFormat
          extended by org.activemq.io.impl.StatelessDefaultWireFormat
All Implemented Interfaces:
Serializable, WireFormat

public class StatelessDefaultWireFormat
extends AbstractDefaultWireFormat

Provides a stateless implementation of AbstractDefaultWireFormat. Safe for use by multiple threads and incurs no locking overhead.

Version:
$Revision: 1.1.1.1 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.activemq.io.impl.AbstractDefaultWireFormat
brokerAdminCommandReader, brokerAdminCommandWriter, brokerInfoReader, brokerInfoWriter, bytesMessageReader, bytesMessageWriter, cachedValueReader, cachedValueWriter, capacityInfoReader, capacityInfoRequestReader, capacityInfoRequestWriter, capacityInfoWriter, cleanupConnectionAndSessionInfoReader, cleanupConnectionAndSessionInfoWriter, connectionInfoReader, connectionInfoWriter, consumerInfoReader, consumerInfoWriter, currentWireFormatVersion, durableUnsubscribeReader, durableUnsubscribeWriter, intReponseReceiptReader, intReponseReceiptWriter, keepAliveReader, keepAliveWriter, mapMessageReader, mapMessageWriter, messageAckReader, messageAckWriter, messageReader, messageWriter, objectMessageReader, objectMessageWriter, producerInfoReader, producerInfoWriter, receiptReader, receiptWriter, reponseReceiptReader, reponseReceiptWriter, sessionInfoReader, sessionInfoWriter, streamMessageReader, streamMessageWriter, textMessageReader, textMessageWriter, transactionInfoReader, transactionInfoWriter, WIRE_FORMAT_VERSION, wireFormatInfoReader, wireFormatInfoWriter, xaTransactionInfoReader, xaTransactionInfoWriter
 
Fields inherited from class org.activemq.io.AbstractWireFormat
cachingEnabled, transportDataIn, transportDataOut
 
Fields inherited from interface org.activemq.io.WireFormat
DEFAULT_MAXIMUM_MESSAGE_SIZE
 
Constructor Summary
StatelessDefaultWireFormat()
           
 
Method Summary
 WireFormat copy()
          Creates a new copy of this wire format so it can be used in another thread/context
 Object getValueFromReadCache(short key)
           
protected  void handleCachedValue(CachedValue cv)
           
 boolean isCachingEnabled()
           
protected  Packet readPacket(DataInput dataIn, PacketReader reader)
           
 Packet readPacket(org.activeio.Packet dataIn)
           
 byte[] toBytes(Packet packet)
          A helper method which converts a packet into a byte array Overrides the WireFormat to make use of the internal BytesOutputStream
 Packet writePacket(Packet packet, DataOutput dataOut)
          Writes the packet to the given output stream
 org.activeio.Packet writePacket(Packet packet, org.activeio.adapter.PacketByteArrayOutputStream paos)
          Write a Packet to a PacketByteArrayOutputStream
 
Methods inherited from class org.activemq.io.impl.AbstractDefaultWireFormat
canProcessWireFormatVersion, getCurrentWireFormatVersion, getWriter, initiateClientSideProtocol, initiateServerSideProtocol, readPacket, setCurrentWireFormatVersion
 
Methods inherited from class org.activemq.io.AbstractWireFormat
doesSupportMessageCompression, doesSupportMessageFragmentation, fromBytes, fromBytes, getTransportDataIn, getTransportDataOut, initiateClientSideProtocol, initiateServerSideProtocol, readPacket, readPacket, registerTransportStreams, setCachingEnabled, setTransportDataIn, setTransportDataOut, writePacket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatelessDefaultWireFormat

public StatelessDefaultWireFormat()
Method Detail

writePacket

public Packet writePacket(Packet packet,
                          DataOutput dataOut)
                   throws IOException
Description copied from interface: WireFormat
Writes the packet to the given output stream

Specified by:
writePacket in interface WireFormat
Specified by:
writePacket in class AbstractDefaultWireFormat
Returns:
a response packet - or null
Throws:
IOException

writePacket

public org.activeio.Packet writePacket(Packet packet,
                                       org.activeio.adapter.PacketByteArrayOutputStream paos)
                                throws IOException
Write a Packet to a PacketByteArrayOutputStream

Parameters:
packet -
dataOut -
Returns:
a response packet - or null
Throws:
IOException

toBytes

public byte[] toBytes(Packet packet)
               throws IOException
A helper method which converts a packet into a byte array Overrides the WireFormat to make use of the internal BytesOutputStream

Specified by:
toBytes in interface WireFormat
Specified by:
toBytes in class AbstractDefaultWireFormat
Parameters:
packet -
Returns:
a byte array representing the packet using some wire protocol
Throws:
IOException

readPacket

protected Packet readPacket(DataInput dataIn,
                            PacketReader reader)
                     throws IOException
Specified by:
readPacket in class AbstractDefaultWireFormat
Throws:
IOException

readPacket

public Packet readPacket(org.activeio.Packet dataIn)
                  throws IOException
Parameters:
dataIn -
Returns:
Throws:
IOException

handleCachedValue

protected void handleCachedValue(CachedValue cv)
Specified by:
handleCachedValue in class AbstractDefaultWireFormat

getValueFromReadCache

public Object getValueFromReadCache(short key)
Specified by:
getValueFromReadCache in class AbstractDefaultWireFormat

isCachingEnabled

public boolean isCachingEnabled()
Specified by:
isCachingEnabled in interface WireFormat
Overrides:
isCachingEnabled in class AbstractWireFormat
Returns:
Returns the enableCaching.

copy

public WireFormat copy()
Description copied from interface: WireFormat
Creates a new copy of this wire format so it can be used in another thread/context

Specified by:
copy in interface WireFormat
Specified by:
copy in class AbstractDefaultWireFormat
Returns:
new WireFormat


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