activemq-cpp-3.6.0
|
Implementation of the Transport interface that performs marshaling of commands to IO streams. More...
#include <src/main/activemq/transport/IOTransport.h>
Public Member Functions | |||||||||
IOTransport () | |||||||||
Default Constructor. | |||||||||
IOTransport (const Pointer< wireformat::WireFormat > wireFormat) | |||||||||
Create an instance of this Transport and assign its WireFormat instance at creation time. | |||||||||
virtual | ~IOTransport () | ||||||||
virtual void | setInputStream (decaf::io::DataInputStream *is) | ||||||||
Sets the stream from which this Transport implementation will read its data. | |||||||||
virtual void | setOutputStream (decaf::io::DataOutputStream *os) | ||||||||
Sets the stream to which this Transport implementation will write its data. | |||||||||
virtual void | oneway (const Pointer< Command > command) | ||||||||
Sends a one-way command. | |||||||||
virtual Pointer< FutureResponse > | asyncRequest (const Pointer< Command > command, const Pointer< ResponseCallback > responseCallback) | ||||||||
Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker.
| |||||||||
virtual Pointer< Response > | request (const Pointer< Command > command) | ||||||||
Sends the given command to the broker and then waits for the response.
| |||||||||
virtual Pointer< Response > | request (const Pointer< Command > command, unsigned int timeout) | ||||||||
Sends the given command to the broker and then waits for the response.
| |||||||||
virtual Pointer < wireformat::WireFormat > | getWireFormat () const | ||||||||
Gets the WireFormat instance that is in use by this transport. | |||||||||
virtual void | setWireFormat (const Pointer< wireformat::WireFormat > wireFormat) | ||||||||
Sets the WireFormat instance to use. | |||||||||
virtual void | setTransportListener (TransportListener *listener) | ||||||||
Sets the observer of asynchronous events from this transport. | |||||||||
virtual TransportListener * | getTransportListener () const | ||||||||
Gets the observer of asynchronous events from this transport. | |||||||||
virtual void | start () | ||||||||
Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started. | |||||||||
virtual void | stop () | ||||||||
Stops the Transport. | |||||||||
virtual void | close () | ||||||||
Closes this object and deallocates the appropriate resources. | |||||||||
virtual Transport * | narrow (const std::type_info &typeId) | ||||||||
Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip intermediate Transports in certain circumstances. | |||||||||
virtual bool | isFaultTolerant () const | ||||||||
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect. | |||||||||
virtual bool | isConnected () const | ||||||||
Is the Transport Connected to its Broker. | |||||||||
virtual bool | isClosed () const | ||||||||
Has the Transport been shutdown and no longer usable. | |||||||||
virtual std::string | getRemoteAddress () const | ||||||||
virtual bool | isReconnectSupported () const | ||||||||
virtual bool | isUpdateURIsSupported () const | ||||||||
virtual void | updateURIs (bool rebalance AMQCPP_UNUSED, const decaf::util::List< decaf::net::URI > &uris AMQCPP_UNUSED) | ||||||||
virtual void | reconnect (const decaf::net::URI &uri AMQCPP_UNUSED) | ||||||||
| |||||||||
virtual void | run () | ||||||||
Run method - called by the Thread class in the context of the thread. | |||||||||
Public Member Functions inherited from activemq::transport::Transport | |||||||||
virtual | ~Transport () | ||||||||
virtual void | reconnect (const decaf::net::URI &uri)=0 | ||||||||
reconnect to another location | |||||||||
virtual void | updateURIs (bool rebalance, const decaf::util::List< decaf::net::URI > &uris)=0 | ||||||||
Updates the set of URIs the Transport can connect to. | |||||||||
Public Member Functions inherited from decaf::io::Closeable | |||||||||
virtual | ~Closeable () | ||||||||
Public Member Functions inherited from decaf::lang::Runnable | |||||||||
virtual | ~Runnable () |
Implementation of the Transport interface that performs marshaling of commands to IO streams.
This class does not implement the Transport::request method, it only handles oneway messages. A thread polls on the input stream for in-coming commands. When a command is received, the command listener is notified. The polling thread is not started until the start method is called. Polling can be suspending by calling stop; however, because the read operation is blocking the transport my still pull one command off the wire even after the stop method has been called.
The close method will close the associated streams. Close can be called explicitly by the user, but is also called in the destructor. Once this object has been closed, it cannot be restarted.
activemq::transport::IOTransport::IOTransport | ( | ) |
Default Constructor.
activemq::transport::IOTransport::IOTransport | ( | const Pointer< wireformat::WireFormat > | wireFormat | ) |
Create an instance of this Transport and assign its WireFormat instance at creation time.
wireFormat | Data encoder / decoder to use when reading and writing. |
|
virtual |
|
virtual |
Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker.
command | The Command object that is to sent out. |
responseCallback | A callback object that will be notified once a response to the command is received. |
IOException | if an exception occurs during the read of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
This method always thrown an UnsupportedOperationException.
Implements activemq::transport::Transport.
|
virtual |
Closes this object and deallocates the appropriate resources.
The object is generally no longer usable after calling close.
IOException | if an error occurs while closing. |
Implements decaf::io::Closeable.
|
inlinevirtual |
Implements activemq::transport::Transport.
|
virtual |
Gets the observer of asynchronous events from this transport.
Implements activemq::transport::Transport.
|
virtual |
Gets the WireFormat instance that is in use by this transport.
In the case of nested transport this method delegates down to the lowest level transport that actually maintains a WireFormat info instance.
Implements activemq::transport::Transport.
|
virtual |
Has the Transport been shutdown and no longer usable.
Implements activemq::transport::Transport.
|
virtual |
Is the Transport Connected to its Broker.
Implements activemq::transport::Transport.
|
inlinevirtual |
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Implements activemq::transport::Transport.
|
inlinevirtual |
Implements activemq::transport::Transport.
|
inlinevirtual |
Implements activemq::transport::Transport.
|
inlinevirtual |
Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip intermediate Transports in certain circumstances.
typeId | - The type_info of the Object we are searching for. |
Implements activemq::transport::Transport.
References NULL.
Sends a one-way command.
Does not wait for any response from the broker.
command | The command to be sent. |
IOException | if an exception occurs during writing of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
Implements activemq::transport::Transport.
|
inlinevirtual |
This method does nothing in this subclass.
|
virtual |
Sends the given command to the broker and then waits for the response.
command | the command to be sent. |
IOException | if an exception occurs during the read of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
This method always thrown an UnsupportedOperationException.
Implements activemq::transport::Transport.
|
virtual |
Sends the given command to the broker and then waits for the response.
command | The command to be sent. |
timeout | The time to wait for this response. |
IOException | if an exception occurs during the read of the command. |
UnsupportedOperationException | if this method is not implemented by this transport. |
This method always thrown an UnsupportedOperationException.
Implements activemq::transport::Transport.
|
virtual |
Run method - called by the Thread class in the context of the thread.
Implements decaf::lang::Runnable.
|
virtual |
Sets the stream from which this Transport implementation will read its data.
is | The InputStream that will be read from by this object. |
|
virtual |
Sets the stream to which this Transport implementation will write its data.
os | The OuputStream that will be written to by this object. |
|
virtual |
Sets the observer of asynchronous events from this transport.
listener | the listener of transport events. |
Implements activemq::transport::Transport.
|
virtual |
Sets the WireFormat instance to use.
wireFormat | The WireFormat the object used to encode / decode commands. |
Implements activemq::transport::Transport.
|
virtual |
Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.
IOException | if and error occurs while starting the Transport. |
Implements activemq::transport::Transport.
|
virtual |
Stops the Transport.
IOException | if an error occurs while stopping the transport. |
Implements activemq::transport::Transport.
|
inlinevirtual |