org.activemq.io.impl
Class DefaultWireFormat
java.lang.Object
org.activemq.io.AbstractWireFormat
org.activemq.io.impl.AbstractDefaultWireFormat
org.activemq.io.impl.DefaultWireFormat
- All Implemented Interfaces:
- Serializable, WireFormat
public class DefaultWireFormat
- extends AbstractDefaultWireFormat
- implements Serializable
This is a stateful AbstractDefaultWireFormat which implements value caching. Not optimal for use by
many concurrent threads. One DefaultWireFormat is typically allocated per client connection.
- Version:
- $Revision: 1.1.1.1 $
- See Also:
- Serialized Form
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 |
Methods inherited from class org.activemq.io.AbstractWireFormat |
doesSupportMessageCompression, doesSupportMessageFragmentation, fromBytes, fromBytes, getTransportDataIn, getTransportDataOut, initiateClientSideProtocol, initiateServerSideProtocol, isCachingEnabled, 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 |
writeMutex
protected final transient Object writeMutex
internalBytesOut
protected transient WireByteArrayOutputStream internalBytesOut
internalDataOut
protected transient DataOutputStream internalDataOut
cachedBytesOut
protected transient WireByteArrayOutputStream cachedBytesOut
cachedDataOut
protected transient DataOutputStream cachedDataOut
cachedKeyGenerator
protected transient short cachedKeyGenerator
lastWriteValueCacheEvictionPosition
protected transient short lastWriteValueCacheEvictionPosition
readMutex
protected final transient Object readMutex
internalBytesIn
protected transient WireByteArrayInputStream internalBytesIn
internalDataIn
protected transient DataInputStream internalDataIn
DefaultWireFormat
public DefaultWireFormat()
- Default Constructor
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
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
readPacket
protected final Packet readPacket(DataInput dataIn,
PacketReader reader)
throws IOException
- Specified by:
readPacket
in class AbstractDefaultWireFormat
- 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
getValueFromReadCache
public Object getValueFromReadCache(short key)
- Specified by:
getValueFromReadCache
in class AbstractDefaultWireFormat
getWriteCachedKey
protected short getWriteCachedKey(Object key)
throws IOException
- Throws:
IOException
validateWriteCache
protected void validateWriteCache()
throws IOException
- Throws:
IOException
handleCachedValue
protected void handleCachedValue(CachedValue cv)
- Specified by:
handleCachedValue
in class AbstractDefaultWireFormat
Copyright © 2004-2010 Protique, Ltd.. All Rights Reserved.