org.apache.activemq.openwire
Class OpenWireFormat

java.lang.Object
  extended by org.apache.activemq.openwire.OpenWireFormat
All Implemented Interfaces:
WireFormat

public final class OpenWireFormat
extends java.lang.Object
implements WireFormat


Field Summary
static int DEFAULT_VERSION
           
static int DEFAULT_WIRE_VERSION
           
 
Constructor Summary
OpenWireFormat()
           
OpenWireFormat(int i)
           
 
Method Summary
 java.lang.Short addToMarshallCache(DataStructure o)
           
 OpenWireFormat copy()
           
 java.lang.Object doUnmarshal(java.io.DataInput dis)
           
 boolean equals(java.lang.Object object)
           
 DataStructure getFromUnmarshallCache(short index)
           
 java.lang.Short getMarshallCacheIndex(DataStructure o)
           
 WireFormatInfo getPreferedWireFormatInfo()
           
 int getVersion()
           
 int hashCode()
           
 boolean isCacheEnabled()
           
 boolean isSizePrefixDisabled()
           
 boolean isStackTraceEnabled()
           
 boolean isTcpNoDelayEnabled()
           
 boolean isTightEncodingEnabled()
           
 void looseMarshalNestedObject(DataStructure o, java.io.DataOutput dataOut)
           
 DataStructure looseUnmarshalNestedObject(java.io.DataInput dis)
           
 ByteSequence marshal(java.lang.Object command)
          Packet based marshaling
 void marshal(java.lang.Object o, java.io.DataOutput dataOut)
          Stream based marshaling
protected  int min(int version1, int version2)
           
 void renegotiateWireFormat(WireFormatInfo info)
           
 void runMarshallCacheEvictionSweep()
           
 void setCacheEnabled(boolean cacheEnabled)
           
 void setInUnmarshallCache(short index, DataStructure o)
           
 void setPreferedWireFormatInfo(WireFormatInfo info)
           
 void setSizePrefixDisabled(boolean prefixPacketSize)
           
 void setStackTraceEnabled(boolean b)
           
 void setTcpNoDelayEnabled(boolean tcpNoDelayEnabled)
           
 void setTightEncodingEnabled(boolean tightEncodingEnabled)
           
 void setVersion(int version)
          Allows you to dynamically switch the version of the openwire protocol being used.
 int tightMarshal1(java.lang.Object o, BooleanStream bs)
          Used by NIO or AIO transports
 void tightMarshal2(java.lang.Object o, java.io.DataOutput ds, BooleanStream bs)
          Used by NIO or AIO transports; note that the size is not written as part of this method.
 int tightMarshalNestedObject1(DataStructure o, BooleanStream bs)
           
 void tightMarshalNestedObject2(DataStructure o, java.io.DataOutput ds, BooleanStream bs)
           
 DataStructure tightUnmarshalNestedObject(java.io.DataInput dis, BooleanStream bs)
           
 java.lang.String toString()
           
 java.lang.Object unmarshal(ByteSequence sequence)
          Packet based un-marshaling
 java.lang.Object unmarshal(java.io.DataInput dis)
          Packet based un-marshaling
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_VERSION

public static final int DEFAULT_VERSION
See Also:
Constant Field Values

DEFAULT_WIRE_VERSION

public static final int DEFAULT_WIRE_VERSION
See Also:
Constant Field Values
Constructor Detail

OpenWireFormat

public OpenWireFormat()

OpenWireFormat

public OpenWireFormat(int i)
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

copy

public OpenWireFormat copy()

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getVersion

public int getVersion()
Specified by:
getVersion in interface WireFormat
Returns:
the version of the wire format

marshal

public ByteSequence marshal(java.lang.Object command)
                     throws java.io.IOException
Description copied from interface: WireFormat
Packet based marshaling

Specified by:
marshal in interface WireFormat
Throws:
java.io.IOException

unmarshal

public java.lang.Object unmarshal(ByteSequence sequence)
                           throws java.io.IOException
Description copied from interface: WireFormat
Packet based un-marshaling

Specified by:
unmarshal in interface WireFormat
Throws:
java.io.IOException

marshal

public void marshal(java.lang.Object o,
                    java.io.DataOutput dataOut)
             throws java.io.IOException
Description copied from interface: WireFormat
Stream based marshaling

Specified by:
marshal in interface WireFormat
Throws:
java.io.IOException

unmarshal

public java.lang.Object unmarshal(java.io.DataInput dis)
                           throws java.io.IOException
Description copied from interface: WireFormat
Packet based un-marshaling

Specified by:
unmarshal in interface WireFormat
Throws:
java.io.IOException

tightMarshal1

public int tightMarshal1(java.lang.Object o,
                         BooleanStream bs)
                  throws java.io.IOException
Used by NIO or AIO transports

Throws:
java.io.IOException

tightMarshal2

public void tightMarshal2(java.lang.Object o,
                          java.io.DataOutput ds,
                          BooleanStream bs)
                   throws java.io.IOException
Used by NIO or AIO transports; note that the size is not written as part of this method.

Throws:
java.io.IOException

setVersion

public void setVersion(int version)
Allows you to dynamically switch the version of the openwire protocol being used.

Specified by:
setVersion in interface WireFormat
Parameters:
version -

doUnmarshal

public java.lang.Object doUnmarshal(java.io.DataInput dis)
                             throws java.io.IOException
Throws:
java.io.IOException

tightMarshalNestedObject1

public int tightMarshalNestedObject1(DataStructure o,
                                     BooleanStream bs)
                              throws java.io.IOException
Throws:
java.io.IOException

tightMarshalNestedObject2

public void tightMarshalNestedObject2(DataStructure o,
                                      java.io.DataOutput ds,
                                      BooleanStream bs)
                               throws java.io.IOException
Throws:
java.io.IOException

tightUnmarshalNestedObject

public DataStructure tightUnmarshalNestedObject(java.io.DataInput dis,
                                                BooleanStream bs)
                                         throws java.io.IOException
Throws:
java.io.IOException

looseUnmarshalNestedObject

public DataStructure looseUnmarshalNestedObject(java.io.DataInput dis)
                                         throws java.io.IOException
Throws:
java.io.IOException

looseMarshalNestedObject

public void looseMarshalNestedObject(DataStructure o,
                                     java.io.DataOutput dataOut)
                              throws java.io.IOException
Throws:
java.io.IOException

runMarshallCacheEvictionSweep

public void runMarshallCacheEvictionSweep()

getMarshallCacheIndex

public java.lang.Short getMarshallCacheIndex(DataStructure o)

addToMarshallCache

public java.lang.Short addToMarshallCache(DataStructure o)

setInUnmarshallCache

public void setInUnmarshallCache(short index,
                                 DataStructure o)

getFromUnmarshallCache

public DataStructure getFromUnmarshallCache(short index)

setStackTraceEnabled

public void setStackTraceEnabled(boolean b)

isStackTraceEnabled

public boolean isStackTraceEnabled()

isTcpNoDelayEnabled

public boolean isTcpNoDelayEnabled()

setTcpNoDelayEnabled

public void setTcpNoDelayEnabled(boolean tcpNoDelayEnabled)

isCacheEnabled

public boolean isCacheEnabled()

setCacheEnabled

public void setCacheEnabled(boolean cacheEnabled)

isTightEncodingEnabled

public boolean isTightEncodingEnabled()

setTightEncodingEnabled

public void setTightEncodingEnabled(boolean tightEncodingEnabled)

isSizePrefixDisabled

public boolean isSizePrefixDisabled()

setSizePrefixDisabled

public void setSizePrefixDisabled(boolean prefixPacketSize)

setPreferedWireFormatInfo

public void setPreferedWireFormatInfo(WireFormatInfo info)

getPreferedWireFormatInfo

public WireFormatInfo getPreferedWireFormatInfo()

renegotiateWireFormat

public void renegotiateWireFormat(WireFormatInfo info)
                           throws java.io.IOException
Throws:
java.io.IOException

min

protected int min(int version1,
                  int version2)


Copyright © 2005-2011 FuseSource, Corp.. All Rights Reserved.