activemq-cpp-3.6.0
activemq::wireformat::WireFormat Class Reference

Provides a mechanism to marshal commands into and out of packets or into and out of streams, Channels and Datagrams. More...

#include <src/main/activemq/wireformat/WireFormat.h>

Inheritance diagram for activemq::wireformat::WireFormat:

Public Member Functions

virtual ~WireFormat ()
virtual void marshal (const Pointer< commands::Command > command, const activemq::transport::Transport *transport, decaf::io::DataOutputStream *out)=0
 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)=0
 Stream based unmarshaling, blocks on reads on the input stream until a complete command has been read and unmarshaled into the correct form.
virtual void setVersion (int version)=0
 Set the Version.
virtual int getVersion () const =0
 Get the Version.
virtual bool hasNegotiator () const =0
 Returns true if this WireFormat has a Negotiator that needs to wrap the Transport that uses it.
virtual bool inReceive () const =0
 Indicates if the WireFromat object is in the process of receiving a message.
virtual Pointer
< transport::Transport
createNegotiator (const Pointer< transport::Transport > transport)=0
 If the Transport Provides a Negotiator this method will create and return a new instance of the Negotiator.

Detailed Description

Provides a mechanism to marshal commands into and out of packets or into and out of streams, Channels and Datagrams.

Constructor & Destructor Documentation

virtual activemq::wireformat::WireFormat::~WireFormat ( )
virtual

Member Function Documentation

virtual Pointer<transport::Transport> activemq::wireformat::WireFormat::createNegotiator ( const Pointer< transport::Transport transport)
pure virtual

If the Transport Provides a Negotiator this method will create and return a new instance of the Negotiator.

Parameters
transportThe Transport to Wrap the Negotiator around.
Returns
new instance of a WireFormatNegotiator as a Pointer<Transport>.
Exceptions
UnsupportedOperationExceptionif the WireFormat doesn't have a Negotiator.

Implemented in activemq::wireformat::stomp::StompWireFormat, and activemq::wireformat::openwire::OpenWireFormat.

virtual int activemq::wireformat::WireFormat::getVersion ( ) const
pure virtual

Get the Version.

Returns
the version of the wire format

Implemented in activemq::wireformat::openwire::OpenWireFormat, and activemq::wireformat::stomp::StompWireFormat.

virtual bool activemq::wireformat::WireFormat::hasNegotiator ( ) const
pure virtual

Returns true if this WireFormat has a Negotiator that needs to wrap the Transport that uses it.

Returns
true if the WireFormat provides a Negotiator.

Implemented in activemq::wireformat::stomp::StompWireFormat, and activemq::wireformat::openwire::OpenWireFormat.

virtual bool activemq::wireformat::WireFormat::inReceive ( ) const
pure virtual

Indicates if the WireFromat object is in the process of receiving a message.

This is useful for monitoring inactivity and the WireFormat is processing a large message which takes longer than some configured timeout to unmarshal, the inactivity monitor can query the WireFormat instance to determine if its busy or not and not mark the connection as inactive if so.

Returns
true if the WireFormat object is unmarshaling a message.

Implemented in activemq::wireformat::openwire::OpenWireFormat, and activemq::wireformat::stomp::StompWireFormat.

virtual void activemq::wireformat::WireFormat::marshal ( const Pointer< commands::Command command,
const activemq::transport::Transport transport,
decaf::io::DataOutputStream out 
)
pure virtual

Stream based marshaling of a Command, this method blocks until the entire Command has been written out to the output stream.

Parameters
commandThe Command to Marshal
transportThe Transport that called this method.
outThe output stream to write the command to.
Exceptions
IOExceptionif an I/O error occurs.

Implemented in activemq::wireformat::openwire::OpenWireFormat, and activemq::wireformat::stomp::StompWireFormat.

virtual void activemq::wireformat::WireFormat::setVersion ( int  version)
pure virtual

Set the Version.

Parameters
versionthe version of the wire format

Implemented in activemq::wireformat::openwire::OpenWireFormat, and activemq::wireformat::stomp::StompWireFormat.

virtual Pointer<commands::Command> activemq::wireformat::WireFormat::unmarshal ( const activemq::transport::Transport transport,
decaf::io::DataInputStream in 
)
pure 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.

Parameters
transportPointer to the transport that is making this request.
inThe input stream to read the command from.
Returns
the newly marshaled Command, caller owns the pointer
Exceptions
IOExceptionif an I/O error occurs.

Implemented in activemq::wireformat::openwire::OpenWireFormat, and activemq::wireformat::stomp::StompWireFormat.


The documentation for this class was generated from the following file: