activemq-cpp-3.6.0
|
#include <src/main/activemq/wireformat/openwire/OpenWireFormat.h>
Public Member Functions | |||||||||
OpenWireFormat (const decaf::util::Properties &properties) | |||||||||
Constructs a new OpenWireFormat object. | |||||||||
virtual | ~OpenWireFormat () | ||||||||
virtual bool | hasNegotiator () const | ||||||||
Returns true if this WireFormat has a Negotiator that needs to wrap the Transport that uses it.
| |||||||||
virtual Pointer < transport::Transport > | createNegotiator (const Pointer< transport::Transport > transport) | ||||||||
If the Transport Provides a Negotiator this method will create and return a new instance of the Negotiator.
| |||||||||
void | addMarshaller (marshal::DataStreamMarshaller *marshaler) | ||||||||
Allows an external source to add marshalers to this object for types that may be marshaled or unmarshaled. | |||||||||
virtual void | marshal (const Pointer< commands::Command > command, const activemq::transport::Transport *transport, decaf::io::DataOutputStream *out) | ||||||||
Stream based marshaling of a Command, this method blocks until the entire Command has been written out to the output stream.
| |||||||||
virtual Pointer < commands::Command > | unmarshal (const activemq::transport::Transport *transport, decaf::io::DataInputStream *in) | ||||||||
Stream based unmarshaling, blocks on reads on the input stream until a complete command has been read and unmarshaled into the correct form.Returns a Pointer to the newly unmarshaled Command.
| |||||||||
virtual int | tightMarshalNestedObject1 (commands::DataStructure *object, utils::BooleanStream *bs) | ||||||||
Utility method for Tight Marshaling the given object to the boolean stream passed. | |||||||||
void | tightMarshalNestedObject2 (commands::DataStructure *o, decaf::io::DataOutputStream *ds, utils::BooleanStream *bs) | ||||||||
Utility method that will Tight marshal some internally nested object that implements the DataStructure interface. | |||||||||
commands::DataStructure * | tightUnmarshalNestedObject (decaf::io::DataInputStream *dis, utils::BooleanStream *bs) | ||||||||
Utility method used to Unmarshal a Nested DataStructure type object from the given DataInputStream. | |||||||||
commands::DataStructure * | looseUnmarshalNestedObject (decaf::io::DataInputStream *dis) | ||||||||
Utility method to unmarshal an DataStructure object from an DataInputStream using the Loose Unmarshaling format. | |||||||||
void | looseMarshalNestedObject (commands::DataStructure *o, decaf::io::DataOutputStream *dataOut) | ||||||||
Utility method to loosely Marshal an object that is derived from the DataStrucutre interface. | |||||||||
void | renegotiateWireFormat (const commands::WireFormatInfo &info) | ||||||||
Called to re-negotiate the settings for the WireFormatInfo, these determine how the client and broker communicate. | |||||||||
void | setPreferedWireFormatInfo (const Pointer< commands::WireFormatInfo > info) | ||||||||
Configures this object using the provided WireformatInfo object. | |||||||||
const Pointer < commands::WireFormatInfo > & | getPreferedWireFormatInfo () const | ||||||||
Gets the Preferred WireFormatInfo object that this class holds. | |||||||||
bool | isStackTraceEnabled () const | ||||||||
Checks if the stackTraceEnabled flag is on. | |||||||||
void | setStackTraceEnabled (bool stackTraceEnabled) | ||||||||
Sets if the stackTraceEnabled flag is on. | |||||||||
bool | isTcpNoDelayEnabled () const | ||||||||
Checks if the tcpNoDelayEnabled flag is on. | |||||||||
void | setTcpNoDelayEnabled (bool tcpNoDelayEnabled) | ||||||||
Sets if the tcpNoDelayEnabled flag is on. | |||||||||
int | getVersion () const | ||||||||
Get the current Wireformat Version. | |||||||||
void | setVersion (int version) | ||||||||
Set the current Wireformat Version. | |||||||||
virtual bool | inReceive () const | ||||||||
Is there a Message being unmarshaled? | |||||||||
bool | isCacheEnabled () const | ||||||||
Checks if the cacheEnabled flag is on. | |||||||||
void | setCacheEnabled (bool cacheEnabled) | ||||||||
Sets if the cacheEnabled flag is on. | |||||||||
int | getCacheSize () const | ||||||||
Returns the currently set Cache size. | |||||||||
void | setCacheSize (int value) | ||||||||
Sets the current Cache size. | |||||||||
bool | isTightEncodingEnabled () const | ||||||||
Checks if the tightEncodingEnabled flag is on. | |||||||||
void | setTightEncodingEnabled (bool tightEncodingEnabled) | ||||||||
Sets if the tightEncodingEnabled flag is on. | |||||||||
bool | isSizePrefixDisabled () const | ||||||||
Checks if the sizePrefixDisabled flag is on. | |||||||||
void | setSizePrefixDisabled (bool sizePrefixDisabled) | ||||||||
Sets if the sizePrefixDisabled flag is on. | |||||||||
long long | getMaxInactivityDuration () const | ||||||||
Gets the MaxInactivityDuration setting. | |||||||||
void | setMaxInactivityDuration (long long value) | ||||||||
Sets the MaxInactivityDuration setting. | |||||||||
long long | getMaxInactivityDurationInitialDelay () const | ||||||||
Gets the MaxInactivityDurationInitialDelay setting. | |||||||||
void | setMaxInactivityDurationInitialDelay (long long value) | ||||||||
Sets the MaxInactivityDurationInitialDelay setting. | |||||||||
Public Member Functions inherited from activemq::wireformat::WireFormat | |||||||||
virtual | ~WireFormat () |
Protected Member Functions | |
commands::DataStructure * | doUnmarshal (decaf::io::DataInputStream *dis) |
Perform the actual unmarshal of data from the given DataInputStream return the unmarshalled DataStrucutre object once done, caller takes ownership of this object. | |
void | destroyMarshalers () |
Cleans up all registered Marshallers and empties the dataMarshallers vector. |
Static Protected Attributes | |
static const unsigned char | NULL_TYPE |
static const int | DEFAULT_VERSION |
static const int | MAX_SUPPORTED_VERSION |
activemq::wireformat::openwire::OpenWireFormat::OpenWireFormat | ( | const decaf::util::Properties & | properties | ) |
Constructs a new OpenWireFormat object.
properties | - can contain optional config params. |
|
virtual |
void activemq::wireformat::openwire::OpenWireFormat::addMarshaller | ( | marshal::DataStreamMarshaller * | marshaler | ) |
Allows an external source to add marshalers to this object for types that may be marshaled or unmarshaled.
marshaler | - the Marshaler to add to the collection. |
|
virtual |
If the Transport Provides a Negotiator this method will create and return a new instance of the Negotiator.
transport | The Transport to Wrap the Negotiator around. |
UnsupportedOperationException | if the WireFormat doesn't have a Negotiator. |
Implements activemq::wireformat::WireFormat.
|
protected |
Cleans up all registered Marshallers and empties the dataMarshallers vector.
This should be called before a reconfiguration of the version marshallers, or on destruction of this object
|
protected |
Perform the actual unmarshal of data from the given DataInputStream return the unmarshalled DataStrucutre object once done, caller takes ownership of this object.
This method can return null if the type of the object to unmarshal is NULL, empty data.
dis | The DataInputStream to read from. |
IOException | if an error occurs during the unmarshal. |
|
inline |
Returns the currently set Cache size.
|
inline |
Gets the MaxInactivityDuration setting.
|
inline |
Gets the MaxInactivityDurationInitialDelay setting.
|
inline |
Gets the Preferred WireFormatInfo object that this class holds.
|
inlinevirtual |
Get the current Wireformat Version.
Implements activemq::wireformat::WireFormat.
|
inlinevirtual |
Returns true if this WireFormat has a Negotiator that needs to wrap the Transport that uses it.
Implements activemq::wireformat::WireFormat.
|
inlinevirtual |
Is there a Message being unmarshaled?
Implements activemq::wireformat::WireFormat.
|
inline |
Checks if the cacheEnabled flag is on.
|
inline |
Checks if the sizePrefixDisabled flag is on.
|
inline |
Checks if the stackTraceEnabled flag is on.
|
inline |
Checks if the tcpNoDelayEnabled flag is on.
|
inline |
Checks if the tightEncodingEnabled flag is on.
void activemq::wireformat::openwire::OpenWireFormat::looseMarshalNestedObject | ( | commands::DataStructure * | o, |
decaf::io::DataOutputStream * | dataOut | ||
) |
Utility method to loosely Marshal an object that is derived from the DataStrucutre interface.
The marshaled data is written to the passed in DataOutputStream.
o | - DataStructure derived Object to Marshal |
dataOut | - DataOutputStream to write the data to |
IOException | if an error occurs. |
commands::DataStructure* activemq::wireformat::openwire::OpenWireFormat::looseUnmarshalNestedObject | ( | decaf::io::DataInputStream * | dis | ) |
Utility method to unmarshal an DataStructure object from an DataInputStream using the Loose Unmarshaling format.
Will read the Data and construct a new DataStructure based Object, the pointer to the Object returned is now owned by the caller.
dis | - the DataInputStream to read the data from |
IOException | if an error occurs. |
|
virtual |
Stream based marshaling of a Command, this method blocks until the entire Command has been written out to the output stream.
command | The Command to Marshal |
transport | The Transport that called this method. |
out | The output stream to write the command to. |
IOException | if an I/O error occurs. |
Implements activemq::wireformat::WireFormat.
void activemq::wireformat::openwire::OpenWireFormat::renegotiateWireFormat | ( | const commands::WireFormatInfo & | info | ) |
Called to re-negotiate the settings for the WireFormatInfo, these determine how the client and broker communicate.
info | The new Wireformat Info settings. |
IllegalStateException | is wire format can't be negotiated. |
|
inline |
Sets if the cacheEnabled flag is on.
cacheEnabled | - true to turn flag is on |
|
inline |
Sets the current Cache size.
value | - the value to send as the broker's cache size. |
|
inline |
Sets the MaxInactivityDuration setting.
value | - the Max inactivity duration value in milliseconds. |
|
inline |
Sets the MaxInactivityDurationInitialDelay setting.
value | - the Max inactivity Initial Delay duration value in milliseconds. |
void activemq::wireformat::openwire::OpenWireFormat::setPreferedWireFormatInfo | ( | const Pointer< commands::WireFormatInfo > | info | ) |
Configures this object using the provided WireformatInfo object.
info | A WireFormatInfo object, takes ownership. |
IllegalStateException | if the WireFormat object has not been initialized. |
|
inline |
Sets if the sizePrefixDisabled flag is on.
sizePrefixDisabled | - true to turn flag is on |
|
inline |
Sets if the stackTraceEnabled flag is on.
stackTraceEnabled | - true to turn flag is on |
|
inline |
Sets if the tcpNoDelayEnabled flag is on.
tcpNoDelayEnabled | - true to turn flag is on |
|
inline |
Sets if the tightEncodingEnabled flag is on.
tightEncodingEnabled | - true to turn flag is on |
|
virtual |
Set the current Wireformat Version.
version | An int that identifies the version |
IllegalArgumentException | if the version given is not supported. |
Implements activemq::wireformat::WireFormat.
|
virtual |
Utility method for Tight Marshaling the given object to the boolean stream passed.
object | - The DataStructure to marshal |
bs | - the BooleanStream to write to |
void activemq::wireformat::openwire::OpenWireFormat::tightMarshalNestedObject2 | ( | commands::DataStructure * | o, |
decaf::io::DataOutputStream * | ds, | ||
utils::BooleanStream * | bs | ||
) |
Utility method that will Tight marshal some internally nested object that implements the DataStructure interface.
Writes the data to the Data Output Stream provided.
o | - DataStructure object |
ds | - DataOuputStream for writing |
bs | - BooleanStream |
IOException | if an error occurs. |
commands::DataStructure* activemq::wireformat::openwire::OpenWireFormat::tightUnmarshalNestedObject | ( | decaf::io::DataInputStream * | dis, |
utils::BooleanStream * | bs | ||
) |
Utility method used to Unmarshal a Nested DataStructure type object from the given DataInputStream.
The DataStructure instance that is returned is now the property of the caller.
dis | - DataInputStream to read from |
bs | - BooleanStream to read from |
IOException | if an error occurs. |
|
virtual |
Stream based unmarshaling, blocks on reads on the input stream until a complete command has been read and unmarshaled into the correct form.Returns a Pointer to the newly unmarshaled Command.
transport | Pointer to the transport that is making this request. |
in | The input stream to read the command from. |
IOException | if an I/O error occurs. |
Implements activemq::wireformat::WireFormat.
|
staticprotected |
|
staticprotected |
|
staticprotected |