summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/SessionManager.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-07-27 22:08:51 +0000
committerAlan Conway <aconway@apache.org>2007-07-27 22:08:51 +0000
commit956a72f00b64928a601ea2891789a53271fc7571 (patch)
treec4469485822787d4742b06d35e23df007f399ed9 /cpp/src/qpid/cluster/SessionManager.cpp
parentac669123004b6e78468cc4fcea3ffb4b9d7b7bd3 (diff)
downloadqpid-python-956a72f00b64928a601ea2891789a53271fc7571.tar.gz
* src/tests/ais_check, cluster.mk: Run AIS tests only if:
- CLUSTER makefile conditional set by configure. - Effective gid == ais - aisexec is running Otherwise print a warning. * src/tests/EventChannelConnectionTest.cpp * src/qpid/cluster/doxygen_overview.h Removed unused files. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@560404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/SessionManager.cpp')
-rw-r--r--cpp/src/qpid/cluster/SessionManager.cpp55
1 files changed, 16 insertions, 39 deletions
diff --git a/cpp/src/qpid/cluster/SessionManager.cpp b/cpp/src/qpid/cluster/SessionManager.cpp
index 88ddfe843f..c9e79b4bbc 100644
--- a/cpp/src/qpid/cluster/SessionManager.cpp
+++ b/cpp/src/qpid/cluster/SessionManager.cpp
@@ -74,61 +74,38 @@ using namespace broker;
virtual void redeliver(Message::shared_ptr&, DeliveryToken::shared_ptr, DeliveryId) {}
};
-/** Wrap plain AMQFrames in SessionFrames */
-struct FrameWrapperHandler : public FrameHandler {
-
- FrameWrapperHandler(const Uuid& id, bool dir, SessionFrameHandler::Chain next_)
- : uuid(id), direction(dir), next(next_) {
- assert(!uuid.isNull());
- }
-
- void handle(AMQFrame& frame) {
- SessionFrame sf(uuid, frame, direction);
- assert(next);
- next->handle(sf);
- }
-
- Uuid uuid;
- bool direction;
- SessionFrameHandler::Chain next;
-};
-
SessionManager::SessionManager(Broker& b) : localBroker(new BrokerHandler(b)) {}
-void SessionManager::update(FrameHandler::Chains& chains) {
+void SessionManager::update(ChannelId channel, FrameHandler::Chains& chains) {
Mutex::ScopedLock l(lock);
// Create a new local session, store local chains.
- Uuid uuid(true);
- sessions[uuid] = chains;
+ sessions[channel] = chains;
- // Replace local in chain. Build from the back.
- // TODO aconway 2007-07-05: Currently mcast wiring, bypass
- // everythign else.
+ // Replace local "in" chain to mcast wiring and process other frames
+ // as normal.
assert(clusterSend);
- FrameHandler::Chain wiring(new FrameWrapperHandler(uuid, SessionFrame::IN, clusterSend));
- FrameHandler::Chain classify(new ClassifierHandler(wiring, chains.in));
- chains.in = classify;
-
- // Leave out chain unmodified.
- // TODO aconway 2007-07-05: Failover will require replication of
- // outgoing frames to session replicas.
+ chains.in = make_shared_ptr(
+ new ClassifierHandler(clusterSend, chains.in));
}
-void SessionManager::handle(SessionFrame& frame) {
+void SessionManager::handle(AMQFrame& frame) {
// Incoming from cluster.
{
Mutex::ScopedLock l(lock);
- assert(frame.isIncoming); // FIXME aconway 2007-07-24: Drop isIncoming?
- SessionMap::iterator i = sessions.find(frame.uuid);
+ SessionMap::iterator i = sessions.find(frame.getChannel());
if (i == sessions.end()) {
- // Non local method frame, invoke.
- localBroker->handle(frame.frame);
+ // Non-local wiring method frame, invoke locally.
+ localBroker->handle(frame);
}
else {
- // Local frame, continue on local chain
- i->second.in->handle(frame.frame);
+ // Local frame continuing on local chain
+ i->second.in->handle(frame);
}
}
}
+void SessionManager::setClusterSend(const FrameHandler::Chain& send) {
+ clusterSend=send;
+}
+
}} // namespace qpid::cluster