summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/qpid/broker/SessionHandler.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/SessionManager.cpp4
-rw-r--r--qpid/cpp/src/qpid/broker/SessionManager.h2
-rw-r--r--qpid/cpp/src/qpid/broker/SessionState.cpp6
-rw-r--r--qpid/cpp/src/qpid/broker/SessionState.h4
-rwxr-xr-xqpid/cpp/src/tests/federation.py9
6 files changed, 20 insertions, 9 deletions
diff --git a/qpid/cpp/src/qpid/broker/SessionHandler.cpp b/qpid/cpp/src/qpid/broker/SessionHandler.cpp
index f5fa22060f..e59a79f711 100644
--- a/qpid/cpp/src/qpid/broker/SessionHandler.cpp
+++ b/qpid/cpp/src/qpid/broker/SessionHandler.cpp
@@ -117,7 +117,7 @@ void SessionHandler::attach(const std::string& _name, bool /*force*/)
//TODO: need to revise session manager to support resume as well
assertClosed("attach");
- session.reset(new SessionState(0, this, 0, 0));
+ session.reset(new SessionState(0, this, 0, 0, name));
peerSession.attached(name);
peerSession.commandPoint(session->nextOut, 0);
}
@@ -126,7 +126,7 @@ void SessionHandler::attached(const std::string& _name)
{
name = _name;//TODO: this should be used in conjunction with
//userid for connection as sessions identity
- session.reset(new SessionState(0, this, 0, 0));
+ session.reset(new SessionState(0, this, 0, 0, name));
peerSession.commandPoint(session->nextOut, 0);
}
diff --git a/qpid/cpp/src/qpid/broker/SessionManager.cpp b/qpid/cpp/src/qpid/broker/SessionManager.cpp
index 6e235e32c3..d7bae737fc 100644
--- a/qpid/cpp/src/qpid/broker/SessionManager.cpp
+++ b/qpid/cpp/src/qpid/broker/SessionManager.cpp
@@ -46,11 +46,11 @@ SessionManager::~SessionManager() {}
// FIXME aconway 2008-02-01: pass handler*, allow open unattached.
std::auto_ptr<SessionState> SessionManager::open(
- SessionHandler& h, uint32_t timeout_)
+ SessionHandler& h, uint32_t timeout_, std::string _name)
{
Mutex::ScopedLock l(lock);
std::auto_ptr<SessionState> session(
- new SessionState(this, &h, timeout_, ack));
+ new SessionState(this, &h, timeout_, ack, _name));
active.insert(session->getId());
for_each(observers.begin(), observers.end(),
boost::bind(&Observer::opened, _1,boost::ref(*session)));
diff --git a/qpid/cpp/src/qpid/broker/SessionManager.h b/qpid/cpp/src/qpid/broker/SessionManager.h
index cc2190c2d1..ad064c69bb 100644
--- a/qpid/cpp/src/qpid/broker/SessionManager.h
+++ b/qpid/cpp/src/qpid/broker/SessionManager.h
@@ -58,7 +58,7 @@ class SessionManager : private boost::noncopyable {
~SessionManager();
/** Open a new active session, caller takes ownership */
- std::auto_ptr<SessionState> open(SessionHandler& c, uint32_t timeout_);
+ std::auto_ptr<SessionState> open(SessionHandler& c, uint32_t timeout_, std::string name);
/** Suspend a session, start it's timeout counter.
* The factory takes ownership.
diff --git a/qpid/cpp/src/qpid/broker/SessionState.cpp b/qpid/cpp/src/qpid/broker/SessionState.cpp
index 50938de8ac..2ef1ed2de4 100644
--- a/qpid/cpp/src/qpid/broker/SessionState.cpp
+++ b/qpid/cpp/src/qpid/broker/SessionState.cpp
@@ -45,12 +45,12 @@ using qpid::management::Manageable;
using qpid::management::Args;
SessionState::SessionState(
- SessionManager* f, SessionHandler* h, uint32_t timeout_, uint32_t ack)
+ SessionManager* f, SessionHandler* h, uint32_t timeout_, uint32_t ack, string& _name)
: framing::SessionState(ack, timeout_ > 0), nextOut(0),
factory(f), handler(h), id(true), timeout(timeout_),
broker(h->getConnection().broker),
version(h->getConnection().getVersion()),
- ignoring(false),
+ ignoring(false), name(_name),
semanticState(*this, *this),
adapter(semanticState),
msgBuilder(&broker.getStore(), broker.getStagingThreshold()),
@@ -68,7 +68,7 @@ SessionState::SessionState(
if (agent.get () != 0)
{
mgmtObject = management::Session::shared_ptr
- (new management::Session (this, parent, id.str ()));
+ (new management::Session (this, parent, name));
mgmtObject->set_attached (1);
mgmtObject->set_clientRef (h->getConnection().GetManagementObject()->getObjectId());
mgmtObject->set_channelId (h->getChannel());
diff --git a/qpid/cpp/src/qpid/broker/SessionState.h b/qpid/cpp/src/qpid/broker/SessionState.h
index 2ec68260a1..ae860e84c9 100644
--- a/qpid/cpp/src/qpid/broker/SessionState.h
+++ b/qpid/cpp/src/qpid/broker/SessionState.h
@@ -111,7 +111,8 @@ class SessionState : public framing::SessionState,
SessionState(SessionManager*,
SessionHandler* out,
uint32_t timeout,
- uint32_t ackInterval);
+ uint32_t ackInterval,
+ std::string& name);
framing::SequenceSet completed;
@@ -131,6 +132,7 @@ class SessionState : public framing::SessionState,
framing::ProtocolVersion version;
sys::Mutex lock;
bool ignoring;
+ std::string name;
SemanticState semanticState;
SessionAdapter adapter;
diff --git a/qpid/cpp/src/tests/federation.py b/qpid/cpp/src/tests/federation.py
index 25654fe1c7..33da19b1b8 100755
--- a/qpid/cpp/src/tests/federation.py
+++ b/qpid/cpp/src/tests/federation.py
@@ -142,6 +142,9 @@ class FederationTests(TestBase010):
mgmt.call_method(bridge, "close")
mgmt.call_method(link, "close")
+ sleep(6)
+ self.assertEqual(len(mgmt.get_objects("bridge")), 0)
+ self.assertEqual(len(mgmt.get_objects("link")), 0)
mgmt.shutdown()
@@ -191,6 +194,9 @@ class FederationTests(TestBase010):
mgmt.call_method(bridge, "close")
mgmt.call_method(link, "close")
+ sleep(6)
+ self.assertEqual(len(mgmt.get_objects("bridge")), 0)
+ self.assertEqual(len(mgmt.get_objects("link")), 0)
mgmt.shutdown ()
@@ -239,6 +245,9 @@ class FederationTests(TestBase010):
mgmt.call_method(bridge, "close")
mgmt.call_method(link, "close")
+ sleep(6)
+ self.assertEqual(len(mgmt.get_objects("bridge")), 0)
+ self.assertEqual(len(mgmt.get_objects("link")), 0)
mgmt.shutdown ()