activemq-cpp-3.4.0
|
#include <src/main/activemq/transport/failover/FailoverTransport.h>
Public Member Functions | |
FailoverTransport () | |
virtual | ~FailoverTransport () |
void | reconnect (bool rebalance) |
Indicates that the Transport needs to reconnect to another URI in its list. | |
void | add (const std::string &uri) |
Adds a New URI to the List of URIs this transport can Connect to. | |
virtual void | addURI (bool rebalance, const List< URI > &uris) |
Add a URI to the list of URI's that will represent the set of Transports that this Transport is a composite of. | |
virtual void | removeURI (bool rebalance, const List< URI > &uris) |
Remove a URI from the set of URI's that represents the set of Transports that this Transport is composed of, removing a URI for which the composite has created a connected Transport should result in that Transport being disposed of. | |
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 void | oneway (const Pointer< Command > &command) |
Sends a one-way command. | |
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 AMQCPP_UNUSED) |
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 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. | |
bool | isInitialized () const |
void | setInitialized (bool value) |
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 std::string | getRemoteAddress () const |
virtual void | reconnect (const decaf::net::URI &uri) |
reconnect to another location | |
virtual void | updateURIs (bool rebalance, const decaf::util::List< decaf::net::URI > &uris) |
Updates the set of URIs the Transport can connect to. | |
virtual bool | isPending () const |
virtual bool | iterate () |
Performs the actual Reconnect operation for the FailoverTransport, when a connection is made this method returns false to indicate it doesn't need to run again, otherwise it returns true to indicate its still trying to connect. | |
long long | getTimeout () const |
void | setTimeout (long long value) |
long long | getInitialReconnectDelay () const |
void | setInitialReconnectDelay (long long value) |
long long | getMaxReconnectDelay () const |
void | setMaxReconnectDelay (long long value) |
long long | getBackOffMultiplier () const |
void | setBackOffMultiplier (long long value) |
bool | isUseExponentialBackOff () const |
void | setUseExponentialBackOff (bool value) |
bool | isRandomize () const |
void | setRandomize (bool value) |
int | getMaxReconnectAttempts () const |
void | setMaxReconnectAttempts (int value) |
int | getStartupMaxReconnectAttempts () const |
void | setStartupMaxReconnectAttempts (int value) |
long long | getReconnectDelay () const |
void | setReconnectDelay (long long value) |
bool | isBackup () const |
void | setBackup (bool value) |
int | getBackupPoolSize () const |
void | setBackupPoolSize (int value) |
bool | isTrackMessages () const |
void | setTrackMessages (bool value) |
bool | isTrackTransactionProducers () const |
void | setTrackTransactionProducers (bool value) |
int | getMaxCacheSize () const |
void | setMaxCacheSize (int value) |
bool | isReconnectSupported () const |
void | setReconnectSupported (bool value) |
bool | isUpdateURIsSupported () const |
void | setUpdateURIsSupported (bool value) |
void | setConnectionInterruptProcessingComplete (const Pointer< commands::ConnectionId > &connectionId) |
Protected Member Functions | |
void | restoreTransport (const Pointer< Transport > &transport) |
Given a Transport restore the state of the Client's connection to the Broker using the data accumulated in the State Tracker. | |
void | handleTransportFailure (const decaf::lang::Exception &error) |
Called when this class' TransportListener is notified of a Failure. | |
void | handleConnectionControl (const Pointer< Command > &control) |
Called when the Broker sends a ConnectionControl command which could signal that this Client needs to reconnect in order to rebalance the connections on a Broker or the set of Known brokers has changed. | |
Friends | |
class | FailoverTransportListener |
activemq::transport::failover::FailoverTransport::FailoverTransport | ( | ) |
virtual activemq::transport::failover::FailoverTransport::~FailoverTransport | ( | ) | [virtual] |
void activemq::transport::failover::FailoverTransport::add | ( | const std::string & | uri | ) |
Adds a New URI to the List of URIs this transport can Connect to.
uri | A String version of a URI to add to the URIs to failover to. |
virtual void activemq::transport::failover::FailoverTransport::addURI | ( | bool | rebalance, |
const List< URI > & | uris | ||
) | [virtual] |
Add a URI to the list of URI's that will represent the set of Transports that this Transport is a composite of.
rebalance | Indicates if the addition should cause a forced reconnect or not. |
uris | The new URI set to add to the set this composite maintains. |
Implements activemq::transport::CompositeTransport.
virtual void activemq::transport::failover::FailoverTransport::close | ( | ) | [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.
long long activemq::transport::failover::FailoverTransport::getBackOffMultiplier | ( | ) | const |
int activemq::transport::failover::FailoverTransport::getBackupPoolSize | ( | ) | const |
long long activemq::transport::failover::FailoverTransport::getInitialReconnectDelay | ( | ) | const |
int activemq::transport::failover::FailoverTransport::getMaxCacheSize | ( | ) | const |
int activemq::transport::failover::FailoverTransport::getMaxReconnectAttempts | ( | ) | const |
long long activemq::transport::failover::FailoverTransport::getMaxReconnectDelay | ( | ) | const |
long long activemq::transport::failover::FailoverTransport::getReconnectDelay | ( | ) | const |
virtual std::string activemq::transport::failover::FailoverTransport::getRemoteAddress | ( | ) | const [virtual] |
Implements activemq::transport::Transport.
int activemq::transport::failover::FailoverTransport::getStartupMaxReconnectAttempts | ( | ) | const |
long long activemq::transport::failover::FailoverTransport::getTimeout | ( | ) | const |
virtual TransportListener* activemq::transport::failover::FailoverTransport::getTransportListener | ( | ) | const [virtual] |
Gets the observer of asynchronous events from this transport.
Implements activemq::transport::Transport.
virtual Pointer<wireformat::WireFormat> activemq::transport::failover::FailoverTransport::getWireFormat | ( | ) | const [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.
void activemq::transport::failover::FailoverTransport::handleConnectionControl | ( | const Pointer< Command > & | control | ) | [protected] |
Called when the Broker sends a ConnectionControl command which could signal that this Client needs to reconnect in order to rebalance the connections on a Broker or the set of Known brokers has changed.
control | The ConnectionControl command sent from the Broker. |
void activemq::transport::failover::FailoverTransport::handleTransportFailure | ( | const decaf::lang::Exception & | error | ) | [protected] |
Called when this class' TransportListener is notified of a Failure.
error | - The CMS Exception that was thrown. |
Exception | if an error occurs. |
bool activemq::transport::failover::FailoverTransport::isBackup | ( | ) | const |
virtual bool activemq::transport::failover::FailoverTransport::isClosed | ( | ) | const [virtual] |
Has the Transport been shutdown and no longer usable.
Implements activemq::transport::Transport.
virtual bool activemq::transport::failover::FailoverTransport::isConnected | ( | ) | const [virtual] |
Is the Transport Connected to its Broker.
Implements activemq::transport::Transport.
virtual bool activemq::transport::failover::FailoverTransport::isFaultTolerant | ( | ) | const [inline, virtual] |
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Implements activemq::transport::Transport.
bool activemq::transport::failover::FailoverTransport::isInitialized | ( | ) | const |
virtual bool activemq::transport::failover::FailoverTransport::isPending | ( | ) | const [virtual] |
Implements activemq::threads::CompositeTask.
bool activemq::transport::failover::FailoverTransport::isRandomize | ( | ) | const |
bool activemq::transport::failover::FailoverTransport::isReconnectSupported | ( | ) | const [virtual] |
Implements activemq::transport::Transport.
bool activemq::transport::failover::FailoverTransport::isTrackMessages | ( | ) | const |
bool activemq::transport::failover::FailoverTransport::isTrackTransactionProducers | ( | ) | const |
bool activemq::transport::failover::FailoverTransport::isUpdateURIsSupported | ( | ) | const [virtual] |
Implements activemq::transport::Transport.
bool activemq::transport::failover::FailoverTransport::isUseExponentialBackOff | ( | ) | const |
virtual bool activemq::transport::failover::FailoverTransport::iterate | ( | ) | [virtual] |
Performs the actual Reconnect operation for the FailoverTransport, when a connection is made this method returns false to indicate it doesn't need to run again, otherwise it returns true to indicate its still trying to connect.
Implements activemq::threads::Task.
virtual Transport* activemq::transport::failover::FailoverTransport::narrow | ( | const std::type_info & | typeId | ) | [virtual] |
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.
virtual void activemq::transport::failover::FailoverTransport::oneway | ( | const Pointer< Command > & | command | ) | [virtual] |
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.
void activemq::transport::failover::FailoverTransport::reconnect | ( | bool | rebalance | ) |
Indicates that the Transport needs to reconnect to another URI in its list.
rebalance | Indicates if the current connection should be broken and reconnected. |
virtual void activemq::transport::failover::FailoverTransport::reconnect | ( | const decaf::net::URI & | uri | ) | [virtual] |
reconnect to another location
uri | The new URI to connect this Transport to. |
IOException | on failure or if reconnect is not supported. |
Implements activemq::transport::Transport.
virtual void activemq::transport::failover::FailoverTransport::removeURI | ( | bool | rebalance, |
const List< URI > & | uris | ||
) | [virtual] |
Remove a URI from the set of URI's that represents the set of Transports that this Transport is composed of, removing a URI for which the composite has created a connected Transport should result in that Transport being disposed of.
rebalance | Indicates if the removal should cause a forced reconnect or not. |
uris | The new URI set to remove to the set this composite maintains. |
Implements activemq::transport::CompositeTransport.
virtual Pointer<Response> activemq::transport::failover::FailoverTransport::request | ( | const Pointer< Command > & | command | ) | [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. |
Implements activemq::transport::Transport.
virtual Pointer<Response> activemq::transport::failover::FailoverTransport::request | ( | const Pointer< Command > & | command, |
unsigned int | timeout | ||
) | [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. |
Implements activemq::transport::Transport.
void activemq::transport::failover::FailoverTransport::setBackOffMultiplier | ( | long long | value | ) |
void activemq::transport::failover::FailoverTransport::setBackup | ( | bool | value | ) |
void activemq::transport::failover::FailoverTransport::setBackupPoolSize | ( | int | value | ) |
void activemq::transport::failover::FailoverTransport::setConnectionInterruptProcessingComplete | ( | const Pointer< commands::ConnectionId > & | connectionId | ) |
void activemq::transport::failover::FailoverTransport::setInitialized | ( | bool | value | ) |
void activemq::transport::failover::FailoverTransport::setInitialReconnectDelay | ( | long long | value | ) |
void activemq::transport::failover::FailoverTransport::setMaxCacheSize | ( | int | value | ) |
void activemq::transport::failover::FailoverTransport::setMaxReconnectAttempts | ( | int | value | ) |
void activemq::transport::failover::FailoverTransport::setMaxReconnectDelay | ( | long long | value | ) |
void activemq::transport::failover::FailoverTransport::setRandomize | ( | bool | value | ) |
void activemq::transport::failover::FailoverTransport::setReconnectDelay | ( | long long | value | ) |
void activemq::transport::failover::FailoverTransport::setReconnectSupported | ( | bool | value | ) |
void activemq::transport::failover::FailoverTransport::setStartupMaxReconnectAttempts | ( | int | value | ) |
void activemq::transport::failover::FailoverTransport::setTimeout | ( | long long | value | ) |
void activemq::transport::failover::FailoverTransport::setTrackMessages | ( | bool | value | ) |
void activemq::transport::failover::FailoverTransport::setTrackTransactionProducers | ( | bool | value | ) |
virtual void activemq::transport::failover::FailoverTransport::setTransportListener | ( | TransportListener * | listener | ) | [virtual] |
Sets the observer of asynchronous events from this transport.
listener | the listener of transport events. |
Implements activemq::transport::Transport.
void activemq::transport::failover::FailoverTransport::setUpdateURIsSupported | ( | bool | value | ) |
void activemq::transport::failover::FailoverTransport::setUseExponentialBackOff | ( | bool | value | ) |
virtual void activemq::transport::failover::FailoverTransport::setWireFormat | ( | const Pointer< wireformat::WireFormat > &wireFormat | AMQCPP_UNUSED | ) | [inline, virtual] |
virtual void activemq::transport::failover::FailoverTransport::start | ( | ) | [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 void activemq::transport::failover::FailoverTransport::stop | ( | ) | [virtual] |
Stops the Transport.
IOException | if an error occurs while stopping the transport. |
Implements activemq::transport::Transport.
virtual void activemq::transport::failover::FailoverTransport::updateURIs | ( | bool | rebalance, |
const decaf::util::List< decaf::net::URI > & | uris | ||
) | [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.
rebalance | Indicates if a forced reconnection should be performed as a result of the update. |
uris | The new list of URIs that can be used for connection. |
IOException | if an error occurs or updates aren't supported. |
Implements activemq::transport::Transport.
friend class FailoverTransportListener [friend] |