activemq-cpp-3.4.0

activemq::transport::tcp::TcpTransport Class Reference

Implements a TCP/IP based transport filter, this transport is meant to wrap an instance of an IOTransport. More...

#include <src/main/activemq/transport/tcp/TcpTransport.h>

Inheritance diagram for activemq::transport::tcp::TcpTransport:

Public Member Functions

 TcpTransport (const Pointer< Transport > &next)
 Creates a new instance of a TcpTransport, the transport is left unconnected and is in a unusable state until the connect method is called.
virtual ~TcpTransport ()
void connect (const decaf::net::URI &uri, const decaf::util::Properties &properties)
 Creates a Socket and configures it before attempting to connect to the location specified by the URI passed in.
virtual void close ()
 Closes this object and deallocates the appropriate resources.
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.

Protected Member Functions

virtual decaf::net::SocketcreateSocket ()
 Create an unconnected Socket instance to be used by the transport to communicate with the broker.
virtual void configureSocket (decaf::net::Socket *socket, const decaf::util::Properties &properties)
 Using options from configuration URI, configure the socket options before the Socket instance is connected to the Server.

Detailed Description

Implements a TCP/IP based transport filter, this transport is meant to wrap an instance of an IOTransport.

The lower level transport should take care of managing stream reads and writes.


Constructor & Destructor Documentation

activemq::transport::tcp::TcpTransport::TcpTransport ( const Pointer< Transport > &  next)

Creates a new instance of a TcpTransport, the transport is left unconnected and is in a unusable state until the connect method is called.

Parameters:
nextThe next transport in the chain
virtual activemq::transport::tcp::TcpTransport::~TcpTransport ( ) [virtual]

Member Function Documentation

virtual void activemq::transport::tcp::TcpTransport::close ( ) [virtual]

Closes this object and deallocates the appropriate resources.

The object is generally no longer usable after calling close.

Exceptions:
IOExceptionif an error occurs while closing.

Reimplemented from activemq::transport::TransportFilter.

virtual void activemq::transport::tcp::TcpTransport::configureSocket ( decaf::net::Socket socket,
const decaf::util::Properties properties 
) [protected, virtual]

Using options from configuration URI, configure the socket options before the Socket instance is connected to the Server.

Subclasses can override this option to set more configuration options, they should called the base class version to allow the default set of Socket options to also be configured.

Parameters:
socketThe Socket instance to configure using options from the given Properties.
Exceptions:
NullPointerExceptionif the Socket instance is null.
IllegalArgumentExceptionif the socket instance is not handled by the class.
SocketExceptionif there is an error while setting one of the Socket options.
void activemq::transport::tcp::TcpTransport::connect ( const decaf::net::URI uri,
const decaf::util::Properties properties 
)

Creates a Socket and configures it before attempting to connect to the location specified by the URI passed in.

The Socket is configured using parameters in the properties that are passed to this method.

Parameters:
uriThe URI that the Transport is to connect to once initialized.
propertiesThe Properties that have been parsed from the URI or from configuration files.
virtual decaf::net::Socket* activemq::transport::tcp::TcpTransport::createSocket ( ) [protected, virtual]

Create an unconnected Socket instance to be used by the transport to communicate with the broker.

Returns:
a newly created unconnected Socket instance.
Exceptions:
IOExceptionif there is an error while creating the unconnected Socket.

Reimplemented in activemq::transport::tcp::SslTransport.

virtual bool activemq::transport::tcp::TcpTransport::isClosed ( ) const [inline, virtual]

Has the Transport been shutdown and no longer usable.

Returns:
true if the Transport

Reimplemented from activemq::transport::TransportFilter.

virtual bool activemq::transport::tcp::TcpTransport::isConnected ( ) const [inline, virtual]

Is the Transport Connected to its Broker.

Returns:
true if a connection has been made.

Reimplemented from activemq::transport::TransportFilter.

virtual bool activemq::transport::tcp::TcpTransport::isFaultTolerant ( ) const [inline, virtual]

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

Returns:
true if the Transport is fault tolerant.

Reimplemented from activemq::transport::TransportFilter.


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