summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker/Link.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker/Link.h')
-rw-r--r--cpp/src/qpid/broker/Link.h20
1 files changed, 7 insertions, 13 deletions
diff --git a/cpp/src/qpid/broker/Link.h b/cpp/src/qpid/broker/Link.h
index f0cb90e73b..01ddc68d97 100644
--- a/cpp/src/qpid/broker/Link.h
+++ b/cpp/src/qpid/broker/Link.h
@@ -69,12 +69,11 @@ class Link : public PersistableConfig, public management::Manageable {
std::string username;
std::string password;
mutable uint64_t persistenceId;
- qmf::org::apache::qpid::broker::Link* mgmtObject;
+ qmf::org::apache::qpid::broker::Link::shared_ptr mgmtObject;
Broker* broker;
int state;
uint32_t visitCount;
uint32_t currentInterval;
- bool closing;
Url url; // URL can contain many addresses.
size_t reconnectNext; // Index for next re-connect attempt
@@ -82,7 +81,8 @@ class Link : public PersistableConfig, public management::Manageable {
Bridges created; // Bridges pending creation
Bridges active; // Bridges active
Bridges cancellations; // Bridges pending cancellation
- uint channelCounter;
+ framing::ChannelId nextFreeChannel;
+ RangeSet<framing::ChannelId> freeChannels;
Connection* connection;
management::ManagementAgent* agent;
boost::function<void(Link*)> listener;
@@ -97,7 +97,7 @@ class Link : public PersistableConfig, public management::Manageable {
static const int STATE_OPERATIONAL = 3;
static const int STATE_FAILED = 4;
static const int STATE_CLOSED = 5;
- static const int STATE_PASSIVE = 6;
+ static const int STATE_CLOSING = 6; // Waiting for outstanding connect to complete first
static const uint32_t MAX_INTERVAL = 32;
@@ -106,7 +106,6 @@ class Link : public PersistableConfig, public management::Manageable {
void destroy(); // Cleanup connection before link goes away
void ioThreadProcessing(); // Called on connection's IO thread by request
bool tryFailoverLH(); // Called during maintenance visit
- bool hideManagement() const;
void reconnectLH(const Address&); //called by LinkRegistry
// connection management (called by LinkRegistry)
@@ -115,7 +114,6 @@ class Link : public PersistableConfig, public management::Manageable {
void closed(int, std::string); // Called when connection goes away
void notifyConnectionForced(const std::string text);
void closeConnection(const std::string& reason);
- bool pendingConnection(const std::string& host, uint16_t port) const; // is Link trying to connect to this remote?
friend class LinkRegistry; // to call established, opened, closed
@@ -151,7 +149,8 @@ class Link : public PersistableConfig, public management::Manageable {
bool isDurable() { return durable; }
void maintenanceVisit ();
- uint nextChannel();
+ framing::ChannelId nextChannel(); // allocate channel from link free pool
+ void returnChannel(framing::ChannelId); // return channel to link free pool
void add(Bridge::shared_ptr);
void cancel(Bridge::shared_ptr);
@@ -165,7 +164,6 @@ class Link : public PersistableConfig, public management::Manageable {
std::string getPassword() { return password; }
Broker* getBroker() { return broker; }
- void setPassive(bool p);
bool isConnecting() const { return state == STATE_CONNECTING; }
// PersistableConfig:
@@ -181,17 +179,13 @@ class Link : public PersistableConfig, public management::Manageable {
static bool isEncodedLink(const std::string& key);
// Manageable entry points
- management::ManagementObject* GetManagementObject(void) const;
+ management::ManagementObject::shared_ptr GetManagementObject(void) const;
management::Manageable::status_t ManagementMethod(uint32_t, management::Args&, std::string&);
// manage the exchange owned by this link
static const std::string exchangeTypeName;
static boost::shared_ptr<Exchange> linkExchangeFactory(const std::string& name);
- // replicate internal state of this Link for clustering
- void getState(framing::FieldTable& state) const;
- void setState(const framing::FieldTable& state);
-
/** create a name for a link (if none supplied by user config) */
static std::string createName(const std::string& transport,
const std::string& host,