|
activemq-cpp-3.9.5
|
#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 (bool rebalance, 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< decaf::net::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< decaf::net::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< 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 AMQCPP_UNUSED) |
| 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 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) |
| int | getMaxPullCacheSize () const |
| void | setMaxPullCacheSize (int value) |
| bool | isReconnectSupported () const |
| void | setReconnectSupported (bool value) |
| bool | isUpdateURIsSupported () const |
| void | setUpdateURIsSupported (bool value) |
| bool | isRebalanceUpdateURIs () const |
| void | setRebalanceUpdateURIs (bool rebalanceUpdateURIs) |
| bool | isPriorityBackup () const |
| void | setPriorityBackup (bool priorityBackup) |
| void | setPriorityURIs (const std::string &priorityURIs) |
| const decaf::util::List< decaf::net::URI > & | getPriorityURIs () const |
| void | setConnectionInterruptProcessingComplete (const Pointer< commands::ConnectionId > connectionId) |
| bool | isConnectedToPriority () const |
Public Member Functions inherited from activemq::transport::CompositeTransport | |
| virtual | ~CompositeTransport () |
| virtual void | addURI (bool rebalance, const List< URI > &uris)=0 |
| 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)=0 |
| 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. | |
Public Member Functions inherited from activemq::transport::Transport | |
| 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< FutureResponse > | asyncRequest (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< Response > | request (const Pointer< Command > command)=0 |
| Sends the given command to the broker and then waits for the response. | |
| virtual Pointer< Response > | request (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 TransportListener * | getTransportListener () const =0 |
| Gets the observer of asynchronous events from this transport. | |
| virtual Transport * | narrow (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 activemq::util::Service | |
| virtual | ~Service () |
| virtual void | start ()=0 |
| virtual void | stop ()=0 |
Public Member Functions inherited from decaf::io::Closeable | |
| virtual | ~Closeable () |
| virtual void | close ()=0 |
| Closes this object and deallocates the appropriate resources. | |
Public Member Functions inherited from activemq::threads::CompositeTask | |
| virtual | ~CompositeTask () |
| virtual bool | isPending () const =0 |
Indicates whether this task has any pending work that needs to be done, if not then it is skipped and the next Task in the CompositeTaskRunner's list of tasks is checked, if none of the tasks have any pending work to do, then the runner can go to sleep until it awakened by a call to wakeup. | |
Public Member Functions inherited from activemq::threads::Task | |
| virtual | ~Task () |
| virtual bool | iterate ()=0 |
| Perform one iteration of work, returns true if the task needs to run again to complete or false to indicate that the task is now complete. | |
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 |
| class | BackupTransportPool |
| activemq::transport::failover::FailoverTransport::FailoverTransport | ( | ) |
|
virtual |
| void activemq::transport::failover::FailoverTransport::add | ( | bool | rebalance, |
| const std::string & | uri | ||
| ) |
Adds a New URI to the List of URIs this transport can Connect to.
| rebalance | Should the transport reconnect to a different broker to balance load. |
| uri | A String version of a URI to add to the URIs to failover to. |
|
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 |
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. |
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.
| 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::getMaxPullCacheSize | ( | ) | const |
| int activemq::transport::failover::FailoverTransport::getMaxReconnectAttempts | ( | ) | const |
| long long activemq::transport::failover::FailoverTransport::getMaxReconnectDelay | ( | ) | const |
| const decaf::util::List< decaf::net::URI > & activemq::transport::failover::FailoverTransport::getPriorityURIs | ( | ) | const |
| long long activemq::transport::failover::FailoverTransport::getReconnectDelay | ( | ) | const |
|
virtual |
Implements activemq::transport::Transport.
| int activemq::transport::failover::FailoverTransport::getStartupMaxReconnectAttempts | ( | ) | const |
| long long activemq::transport::failover::FailoverTransport::getTimeout | ( | ) | const |
|
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.
|
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. |
|
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 |
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.
| bool activemq::transport::failover::FailoverTransport::isConnectedToPriority | ( | ) | const |
|
inlinevirtual |
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 |
Implements activemq::threads::CompositeTask.
| bool activemq::transport::failover::FailoverTransport::isPriorityBackup | ( | ) | const |
| bool activemq::transport::failover::FailoverTransport::isRandomize | ( | ) | const |
| bool activemq::transport::failover::FailoverTransport::isRebalanceUpdateURIs | ( | ) | const |
|
virtual |
Implements activemq::transport::Transport.
| bool activemq::transport::failover::FailoverTransport::isTrackMessages | ( | ) | const |
| bool activemq::transport::failover::FailoverTransport::isTrackTransactionProducers | ( | ) | const |
|
virtual |
Implements activemq::transport::Transport.
| bool activemq::transport::failover::FailoverTransport::isUseExponentialBackOff | ( | ) | const |
|
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 |
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 |
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 |
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 |
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 |
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 |
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::setMaxPullCacheSize | ( | int | value | ) |
| void activemq::transport::failover::FailoverTransport::setMaxReconnectAttempts | ( | int | value | ) |
| void activemq::transport::failover::FailoverTransport::setMaxReconnectDelay | ( | long long | value | ) |
| void activemq::transport::failover::FailoverTransport::setPriorityBackup | ( | bool | priorityBackup | ) |
| void activemq::transport::failover::FailoverTransport::setPriorityURIs | ( | const std::string & | priorityURIs | ) |
| void activemq::transport::failover::FailoverTransport::setRandomize | ( | bool | value | ) |
| void activemq::transport::failover::FailoverTransport::setRebalanceUpdateURIs | ( | bool | rebalanceUpdateURIs | ) |
| 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 |
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 | ) |
|
inlinevirtual |
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.
|
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 |
|
friend |