activemq-cpp-3.6.0
activemq::transport::Transport Class Reference

Interface for a transport layer for command objects. More...

#include <src/main/activemq/transport/Transport.h>

Inheritance diagram for activemq::transport::Transport:

Public Member Functions

virtual ~Transport ()
virtual void start ()=0
 Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.
virtual void stop ()=0
 Stops the Transport.
virtual void oneway (const Pointer< Command > command)=0
 Sends a one-way command.
virtual Pointer< FutureResponseasyncRequest (const Pointer< Command > command, const Pointer< ResponseCallback > responseCallback)=0
 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< Responserequest (const Pointer< Command > command)=0
 Sends the given command to the broker and then waits for the response.
virtual Pointer< Responserequest (const Pointer< Command > command, unsigned int timeout)=0
 Sends the given command to the broker and then waits for the response.
virtual Pointer
< wireformat::WireFormat
getWireFormat () const =0
 Gets the WireFormat instance that is in use by this transport.
virtual void setWireFormat (const Pointer< wireformat::WireFormat > wireFormat)=0
 Sets the WireFormat instance to use.
virtual void setTransportListener (TransportListener *listener)=0
 Sets the observer of asynchronous events from this transport.
virtual TransportListenergetTransportListener () const =0
 Gets the observer of asynchronous events from this transport.
virtual Transportnarrow (const std::type_info &typeId)=0
 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 =0
 Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
virtual bool isConnected () const =0
 Is the Transport Connected to its Broker.
virtual bool isClosed () const =0
 Has the Transport been shutdown and no longer usable.
virtual bool isReconnectSupported () const =0
virtual bool isUpdateURIsSupported () const =0
virtual std::string getRemoteAddress () const =0
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 ()
virtual void close ()=0
 Closes this object and deallocates the appropriate resources.

Detailed Description

Interface for a transport layer for command objects.

Callers can send oneway messages or make synchronous requests. Non-response messages will be delivered to the specified listener object upon receipt. A user of the Transport can set an exception listener to be notified of errors that occurs in Threads that the Transport layer runs. Transports should be given an instance of a WireFormat object when created so that they can turn the built in Commands to / from the required wire format encoding.

Constructor & Destructor Documentation

virtual activemq::transport::Transport::~Transport ( )
virtual

Member Function Documentation

virtual Pointer<FutureResponse> activemq::transport::Transport::asyncRequest ( const Pointer< Command command,
const Pointer< ResponseCallback responseCallback 
)
pure virtual

Sends a commands asynchronously, returning a FutureResponse object that the caller can use to check to find out the response from the broker.

Parameters
commandThe Command object that is to sent out.
responseCallbackA callback object that will be notified once a response to the command is received.
Returns
A FutureResponse instance that can be queried for the Response to the Command.
Exceptions
IOExceptionif an exception occurs during the read of the command.
UnsupportedOperationExceptionif this method is not implemented by this transport.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, activemq::transport::failover::FailoverTransport, and activemq::transport::correlator::ResponseCorrelator.

virtual std::string activemq::transport::Transport::getRemoteAddress ( ) const
pure virtual
virtual TransportListener* activemq::transport::Transport::getTransportListener ( ) const
pure virtual

Gets the observer of asynchronous events from this transport.

Returns
the listener of transport events.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.

virtual Pointer<wireformat::WireFormat> activemq::transport::Transport::getWireFormat ( ) const
pure 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.

Returns
The WireFormat the object used to encode / decode commands.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.

virtual bool activemq::transport::Transport::isClosed ( ) const
pure virtual
virtual bool activemq::transport::Transport::isConnected ( ) const
pure virtual
virtual bool activemq::transport::Transport::isFaultTolerant ( ) const
pure virtual

Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.

Returns
true if the Transport is fault tolerant.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, activemq::transport::failover::FailoverTransport, and activemq::transport::tcp::TcpTransport.

virtual bool activemq::transport::Transport::isReconnectSupported ( ) const
pure virtual
virtual bool activemq::transport::Transport::isUpdateURIsSupported ( ) const
pure virtual
virtual Transport* activemq::transport::Transport::narrow ( const std::type_info &  typeId)
pure virtual

Narrows down a Chain of Transports to a specific Transport to allow a higher level transport to skip intermediate Transports in certain circumstances.

Parameters
typeId- The type_info of the Object we are searching for.
Returns
the requested Object. or NULL if its not in this chain.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.

virtual void activemq::transport::Transport::oneway ( const Pointer< Command command)
pure virtual

Sends a one-way command.

Does not wait for any response from the broker.

Parameters
commandThe command to be sent.
Exceptions
IOExceptionif an exception occurs during writing of the command.
UnsupportedOperationExceptionif this method is not implemented by this transport.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, activemq::transport::failover::FailoverTransport, activemq::wireformat::openwire::OpenWireFormatNegotiator, activemq::transport::inactivity::InactivityMonitor, activemq::transport::correlator::ResponseCorrelator, and activemq::transport::logging::LoggingTransport.

virtual void activemq::transport::Transport::reconnect ( const decaf::net::URI uri)
pure virtual

reconnect to another location

Parameters
uriThe new URI to connect this Transport to.
Exceptions
IOExceptionon failure or if reconnect is not supported.

Implemented in activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.

virtual Pointer<Response> activemq::transport::Transport::request ( const Pointer< Command command)
pure virtual

Sends the given command to the broker and then waits for the response.

Parameters
commandthe command to be sent.
Returns
the response from the broker.
Exceptions
IOExceptionif an exception occurs during the read of the command.
UnsupportedOperationExceptionif this method is not implemented by this transport.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, activemq::transport::failover::FailoverTransport, activemq::wireformat::openwire::OpenWireFormatNegotiator, activemq::transport::correlator::ResponseCorrelator, and activemq::transport::logging::LoggingTransport.

virtual Pointer<Response> activemq::transport::Transport::request ( const Pointer< Command command,
unsigned int  timeout 
)
pure virtual

Sends the given command to the broker and then waits for the response.

Parameters
commandThe command to be sent.
timeoutThe time to wait for this response.
Returns
the response from the broker.
Exceptions
IOExceptionif an exception occurs during the read of the command.
UnsupportedOperationExceptionif this method is not implemented by this transport.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, activemq::transport::failover::FailoverTransport, activemq::wireformat::openwire::OpenWireFormatNegotiator, activemq::transport::correlator::ResponseCorrelator, and activemq::transport::logging::LoggingTransport.

virtual void activemq::transport::Transport::setTransportListener ( TransportListener listener)
pure virtual

Sets the observer of asynchronous events from this transport.

Parameters
listenerthe listener of transport events.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.

virtual void activemq::transport::Transport::setWireFormat ( const Pointer< wireformat::WireFormat wireFormat)
pure virtual

Sets the WireFormat instance to use.

Parameters
wireFormatThe WireFormat the object used to encode / decode commands.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.

virtual void activemq::transport::Transport::start ( )
pure virtual

Starts the Transport, the send methods of a Transport will throw an exception if used before the Transport is started.

Exceptions
IOExceptionif and error occurs while starting the Transport.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::failover::FailoverTransport, and activemq::transport::TransportFilter.

virtual void activemq::transport::Transport::stop ( )
pure virtual

Stops the Transport.

Exceptions
IOExceptionif an error occurs while stopping the transport.

Implemented in activemq::transport::mock::MockTransport, activemq::transport::IOTransport, activemq::transport::failover::FailoverTransport, and activemq::transport::TransportFilter.

virtual void activemq::transport::Transport::updateURIs ( bool  rebalance,
const decaf::util::List< decaf::net::URI > &  uris 
)
pure virtual

Updates the set of URIs the Transport can connect to.

If the Transport doesn't support updating its URIs then an IOException is thrown.

Parameters
rebalanceIndicates if a forced reconnection should be performed as a result of the update.
urisThe new list of URIs that can be used for connection.
Exceptions
IOExceptionif an error occurs or updates aren't supported.

Implemented in activemq::transport::TransportFilter, and activemq::transport::failover::FailoverTransport.


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