18#ifndef _ACTIVE_TRANSPORT_FAILOVER_FAILOVERTRANSPORT_H_
19#define _ACTIVE_TRANSPORT_FAILOVER_FAILOVERTRANSPORT_H_
40 using namespace decaf::lang;
41 using activemq::commands::Command;
42 using activemq::commands::Response;
46 class FailoverTransportImpl;
57 FailoverTransportImpl* impl;
61 FailoverTransport(
const FailoverTransport&);
62 FailoverTransport& operator=(
const FailoverTransport&);
87 void add(
bool rebalance,
const std::string& uri);
285 void processNewTransports(
bool rebalance, std::string newTransports);
#define AMQCPP_API
Definition Config.h:30
Definition ConnectionStateTracker.h:41
Represents a single task that can be part of a set of Tasks that are contained in a CompositeTaskRunn...
Definition CompositeTask.h:33
A Composite Transport is a Transport implementation that is composed of several Transports.
Definition CompositeTransport.h:40
Interface for a transport layer for command objects.
Definition Transport.h:60
A listener of asynchronous exceptions from a command transport object.
Definition TransportListener.h:38
Definition BackupTransportPool.h:43
virtual void start()
Starts the Transport, the send methods of a Transport will throw an exception if used before the Tran...
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 t...
void setInitialReconnectDelay(long long value)
virtual std::string getRemoteAddress() const
friend class BackupTransportPool
Definition FailoverTransport.h:53
void setMaxReconnectAttempts(int value)
virtual bool isFaultTolerant() const
Is this Transport fault tolerant, meaning that it will reconnect to a broker on disconnect.
Definition FailoverTransport.h:120
bool isReconnectSupported() const
void setBackup(bool value)
virtual void close()
Closes this object and deallocates the appropriate resources.
friend class FailoverTransportListener
Definition FailoverTransport.h:52
void setUpdateURIsSupported(bool value)
virtual bool isPending() const
virtual void stop()
Stops the Transport.
bool isTrackTransactionProducers() const
virtual bool isClosed() const
Has the Transport been shutdown and no longer usable.
bool isRebalanceUpdateURIs() const
int getStartupMaxReconnectAttempts() const
const decaf::util::List< decaf::net::URI > & getPriorityURIs() const
virtual Pointer< wireformat::WireFormat > getWireFormat() const
Gets the WireFormat instance that is in use by this transport.
virtual bool iterate()
Performs the actual Reconnect operation for the FailoverTransport, when a connection is made this met...
virtual Pointer< Response > request(const Pointer< Command > command)
Sends the given command to the broker and then waits for the response.
void setUseExponentialBackOff(bool value)
void setReconnectDelay(long long value)
void setPriorityBackup(bool priorityBackup)
long long getBackOffMultiplier() const
void setInitialized(bool value)
bool isInitialized() const
void setPriorityURIs(const std::string &priorityURIs)
virtual void oneway(const Pointer< Command > command)
Sends a one-way command.
bool isConnectedToPriority() const
virtual Pointer< Response > request(const Pointer< Command > command, unsigned int timeout)
Sends the given command to the broker and then waits for the response.
bool isTrackMessages() const
void setBackupPoolSize(int value)
void setTrackMessages(bool value)
bool isPriorityBackup() const
void setMaxReconnectDelay(long long value)
long long getReconnectDelay() const
void setConnectionInterruptProcessingComplete(const Pointer< commands::ConnectionId > connectionId)
void setRebalanceUpdateURIs(bool rebalanceUpdateURIs)
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 com...
void setMaxCacheSize(int value)
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 compo...
void setRandomize(bool value)
void add(bool rebalance, const std::string &uri)
Adds a New URI to the List of URIs this transport can Connect to.
int getMaxCacheSize() const
void setBackOffMultiplier(long long value)
virtual void reconnect(const decaf::net::URI &uri)
reconnect to another location
bool isUseExponentialBackOff() const
void setReconnectSupported(bool value)
void handleTransportFailure(const decaf::lang::Exception &error)
Called when this class' TransportListener is notified of a Failure.
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 ...
void setMaxPullCacheSize(int value)
virtual TransportListener * getTransportListener() const
Gets the observer of asynchronous events from this transport.
long long getMaxReconnectDelay() const
virtual void setTransportListener(TransportListener *listener)
Sets the observer of asynchronous events from this transport.
void reconnect(bool rebalance)
Indicates that the Transport needs to reconnect to another URI in its list.
int getMaxReconnectAttempts() const
int getMaxPullCacheSize() const
virtual ~FailoverTransport()
int getBackupPoolSize() const
bool isUpdateURIsSupported() const
long long getInitialReconnectDelay() const
virtual void updateURIs(bool rebalance, const decaf::util::List< decaf::net::URI > &uris)
Updates the set of URIs the Transport can connect to.
void restoreTransport(const Pointer< Transport > transport)
Given a Transport restore the state of the Client's connection to the Broker using the data accumulat...
void handleConnectionControl(const Pointer< Command > control)
Called when the Broker sends a ConnectionControl command which could signal that this Client needs to...
long long getTimeout() const
void setStartupMaxReconnectAttempts(int value)
void setTimeout(long long value)
virtual void setWireFormat(const Pointer< wireformat::WireFormat > wireFormat AMQCPP_UNUSED)
Sets the WireFormat instance to use.
Definition FailoverTransport.h:114
void setTrackTransactionProducers(bool value)
virtual bool isConnected() const
Is the Transport Connected to its Broker.
Utility class used by the Transport to perform the work of responding to events from the active Trans...
Definition FailoverTransportListener.h:37
Definition Exception.h:38
Decaf's implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition Pointer.h:53
This class represents an instance of a URI as defined by RFC 2396.
Definition URI.h:37
An ordered collection (also known as a sequence).
Definition List.h:47
Definition BackupTransport.h:31
Definition AbstractTransportFactory.h:30
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.
Definition CachedConsumer.h:24