summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/client
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2008-02-21 17:40:42 +0000
committerGordon Sim <gsim@apache.org>2008-02-21 17:40:42 +0000
commit3767d7e49e80c268c60ee247b3526b986eb7fc17 (patch)
tree36f0c9487e54705530be26271de7e52676bad524 /cpp/src/qpid/client
parent5f06a953368f7f41dd8ab94a6775fcd9b5c99792 (diff)
downloadqpid-python-3767d7e49e80c268c60ee247b3526b986eb7fc17.tar.gz
Start moving towards final 0-10 spec:
* marked preview spec as 99-0 to distinguish it from 0-10 (which will now be used for the final version) * modified python client to treat 99-0 as 0-10 for now * modified broker to have two paths for the two different versions: 99-0 uses PreviewConnection, PreviewConnectionHandler and PreviewSessionHandler which are straight copy & pastes of the Connection, ConnectionHandler and SessionHandler now associated with 0-10 (so we can migrate the 0-10 path to the final spec without affecting clients working with the preview version) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@629883 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/client')
-rw-r--r--cpp/src/qpid/client/Channel.cpp6
-rw-r--r--cpp/src/qpid/client/Channel.h6
-rw-r--r--cpp/src/qpid/client/Connection.cpp6
-rw-r--r--cpp/src/qpid/client/Connection.h6
-rw-r--r--cpp/src/qpid/client/Dispatcher.cpp5
-rw-r--r--cpp/src/qpid/client/Dispatcher.h11
-rw-r--r--cpp/src/qpid/client/LocalQueue.h2
-rw-r--r--cpp/src/qpid/client/Message.h12
-rw-r--r--cpp/src/qpid/client/Session.h4
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.cpp4
-rw-r--r--cpp/src/qpid/client/SubscriptionManager.h6
11 files changed, 33 insertions, 35 deletions
diff --git a/cpp/src/qpid/client/Channel.cpp b/cpp/src/qpid/client/Channel.cpp
index a6875fcb63..4af69c8552 100644
--- a/cpp/src/qpid/client/Channel.cpp
+++ b/cpp/src/qpid/client/Channel.cpp
@@ -46,9 +46,9 @@ const std::string empty;
class ScopedSync
{
- Session_0_10& session;
+ Session& session;
public:
- ScopedSync(Session_0_10& s, bool enabled = true) : session(s) { session.setSynchronous(enabled); }
+ ScopedSync(Session& s, bool enabled = true) : session(s) { session.setSynchronous(enabled); }
~ScopedSync() { session.setSynchronous(false); }
};
@@ -63,7 +63,7 @@ Channel::~Channel()
join();
}
-void Channel::open(const Session_0_10& s)
+void Channel::open(const Session& s)
{
Mutex::ScopedLock l(stopLock);
if (isOpen())
diff --git a/cpp/src/qpid/client/Channel.h b/cpp/src/qpid/client/Channel.h
index 35e306e9b5..2cda97dc63 100644
--- a/cpp/src/qpid/client/Channel.h
+++ b/cpp/src/qpid/client/Channel.h
@@ -29,7 +29,7 @@
#include "Message.h"
#include "Queue.h"
#include "ConnectionImpl.h"
-#include "qpid/client/Session_0_10.h"
+#include "qpid/client/Session.h"
#include "qpid/Exception.h"
#include "qpid/sys/Mutex.h"
#include "qpid/sys/Runnable.h"
@@ -79,7 +79,7 @@ class Channel : private sys::Runnable
bool running;
ConsumerMap consumers;
- Session_0_10 session;
+ Session session;
framing::ChannelId channelId;
sys::BlockingQueue<framing::FrameSet::shared_ptr> gets;
framing::Uuid uniqueId;
@@ -88,7 +88,7 @@ class Channel : private sys::Runnable
void stop();
- void open(const Session_0_10& session);
+ void open(const Session& session);
void closeInternal();
void join();
diff --git a/cpp/src/qpid/client/Connection.cpp b/cpp/src/qpid/client/Connection.cpp
index 26113c1254..872e04b3b5 100644
--- a/cpp/src/qpid/client/Connection.cpp
+++ b/cpp/src/qpid/client/Connection.cpp
@@ -73,7 +73,7 @@ void Connection::openChannel(Channel& channel) {
channel.open(newSession(ASYNC));
}
-Session_0_10 Connection::newSession(SynchronousMode sync,
+Session Connection::newSession(SynchronousMode sync,
uint32_t detachedLifetime)
{
shared_ptr<SessionCore> core(
@@ -81,10 +81,10 @@ Session_0_10 Connection::newSession(SynchronousMode sync,
core->setSync(sync);
impl->addSession(core);
core->open(detachedLifetime);
- return Session_0_10(core);
+ return Session(core);
}
-void Connection::resume(Session_0_10& session) {
+void Connection::resume(Session& session) {
session.impl->setChannel(++channelIdCounter);
impl->addSession(session.impl);
session.impl->resume(impl);
diff --git a/cpp/src/qpid/client/Connection.h b/cpp/src/qpid/client/Connection.h
index e6bfbddef6..81d9b972b6 100644
--- a/cpp/src/qpid/client/Connection.h
+++ b/cpp/src/qpid/client/Connection.h
@@ -25,7 +25,7 @@
#include <string>
#include "Channel.h"
#include "ConnectionImpl.h"
-#include "qpid/client/Session_0_10.h"
+#include "qpid/client/Session.h"
#include "qpid/framing/AMQP_HighestVersion.h"
#include "qpid/framing/Uuid.h"
@@ -134,13 +134,13 @@ class Connection
* that the broker may discard the session state. Default is 0,
* meaning the session cannot be resumed.
*/
- Session_0_10 newSession(SynchronousMode sync, uint32_t detachedLifetime=0);
+ Session newSession(SynchronousMode sync, uint32_t detachedLifetime=0);
/**
* Resume a suspendded session. A session may be resumed
* on a different connection to the one that created it.
*/
- void resume(Session_0_10& session);
+ void resume(Session& session);
};
}} // namespace qpid::client
diff --git a/cpp/src/qpid/client/Dispatcher.cpp b/cpp/src/qpid/client/Dispatcher.cpp
index 8df4637c88..2484dabf1f 100644
--- a/cpp/src/qpid/client/Dispatcher.cpp
+++ b/cpp/src/qpid/client/Dispatcher.cpp
@@ -20,7 +20,6 @@
*/
#include "Dispatcher.h"
-#include "qpid/client/Session_0_10.h"
#include "qpid/framing/FrameSet.h"
#include "qpid/framing/MessageTransferBody.h"
#include "qpid/log/Statement.h"
@@ -38,7 +37,7 @@ using qpid::sys::Thread;
namespace qpid {
namespace client {
-Subscriber::Subscriber(Session_0_10& s, MessageListener* l, AckPolicy a) : session(s), listener(l), autoAck(a) {}
+Subscriber::Subscriber(Session& s, MessageListener* l, AckPolicy a) : session(s), listener(l), autoAck(a) {}
void Subscriber::received(Message& msg)
{
@@ -48,7 +47,7 @@ void Subscriber::received(Message& msg)
}
}
-Dispatcher::Dispatcher(Session_0_10& s, const std::string& q)
+Dispatcher::Dispatcher(Session& s, const std::string& q)
: session(s), running(false), autoStop(true)
{
queue = q.empty() ?
diff --git a/cpp/src/qpid/client/Dispatcher.h b/cpp/src/qpid/client/Dispatcher.h
index ae67e61299..e23d0c198c 100644
--- a/cpp/src/qpid/client/Dispatcher.h
+++ b/cpp/src/qpid/client/Dispatcher.h
@@ -25,6 +25,7 @@
#include <memory>
#include <string>
#include <boost/shared_ptr.hpp>
+#include "qpid/client/Session.h"
#include "qpid/sys/Mutex.h"
#include "qpid/sys/Runnable.h"
#include "qpid/sys/Thread.h"
@@ -34,17 +35,15 @@
namespace qpid {
namespace client {
-class Session_0_10;
-
class Subscriber : public MessageListener
{
- Session_0_10& session;
+ Session& session;
MessageListener* const listener;
AckPolicy autoAck;
public:
typedef boost::shared_ptr<Subscriber> shared_ptr;
- Subscriber(Session_0_10& session, MessageListener* listener, AckPolicy);
+ Subscriber(Session& session, MessageListener* listener, AckPolicy);
void received(Message& msg);
};
@@ -56,7 +55,7 @@ class Dispatcher : public sys::Runnable
typedef std::map<std::string, Subscriber::shared_ptr> Listeners;
sys::Mutex lock;
sys::Thread worker;
- Session_0_10& session;
+ Session& session;
Demux::QueuePtr queue;
bool running;
bool autoStop;
@@ -68,7 +67,7 @@ class Dispatcher : public sys::Runnable
bool isStopped();
public:
- Dispatcher(Session_0_10& session, const std::string& queue = "");
+ Dispatcher(Session& session, const std::string& queue = "");
void start();
void run();
diff --git a/cpp/src/qpid/client/LocalQueue.h b/cpp/src/qpid/client/LocalQueue.h
index eba28f6599..f8b2c2e0b3 100644
--- a/cpp/src/qpid/client/LocalQueue.h
+++ b/cpp/src/qpid/client/LocalQueue.h
@@ -50,7 +50,7 @@ class LocalQueue
private:
friend class SubscriptionManager;
- Session_0_10 session;
+ Session session;
Demux::QueuePtr queue;
AckPolicy autoAck;
};
diff --git a/cpp/src/qpid/client/Message.h b/cpp/src/qpid/client/Message.h
index 86404ac792..daac30ba36 100644
--- a/cpp/src/qpid/client/Message.h
+++ b/cpp/src/qpid/client/Message.h
@@ -22,7 +22,7 @@
*
*/
#include <string>
-#include "qpid/client/Session_0_10.h"
+#include "qpid/client/Session.h"
#include "qpid/framing/MessageTransferBody.h"
#include "qpid/framing/TransferContent.h"
@@ -63,18 +63,18 @@ public:
return getMessageProperties().getApplicationHeaders();
}
- void acknowledge(Session_0_10& session, bool cumulative = true, bool send = true) const
+ void acknowledge(Session& session, bool cumulative = true, bool send = true) const
{
session.getExecution().completed(id, cumulative, send);
}
void acknowledge(bool cumulative = true, bool send = true) const
{
- const_cast<Session_0_10&>(session).getExecution().completed(id, cumulative, send);
+ const_cast<Session&>(session).getExecution().completed(id, cumulative, send);
}
/**@internal for incoming messages */
- Message(const framing::FrameSet& frameset, Session_0_10 s) :
+ Message(const framing::FrameSet& frameset, Session s) :
method(*frameset.as<framing::MessageTransferBody>()), id(frameset.getId()), session(s)
{
populate(frameset);
@@ -91,12 +91,12 @@ public:
}
/**@internal use for incoming messages. */
- void setSession(Session_0_10 s) { session=s; }
+ void setSession(Session s) { session=s; }
private:
//method and id are only set for received messages:
framing::MessageTransferBody method;
framing::SequenceNumber id;
- Session_0_10 session;
+ Session session;
};
}}
diff --git a/cpp/src/qpid/client/Session.h b/cpp/src/qpid/client/Session.h
index 11105dcd36..3293af60fe 100644
--- a/cpp/src/qpid/client/Session.h
+++ b/cpp/src/qpid/client/Session.h
@@ -21,7 +21,7 @@
* under the License.
*
*/
-#include "qpid/client/Session_0_10.h"
+#include "qpid/client/Session_99_0.h"
namespace qpid {
namespace client {
@@ -31,7 +31,7 @@ namespace client {
*
* \ingroup clientapi
*/
-typedef Session_0_10 Session;
+typedef Session_99_0 Session;
}} // namespace qpid::client
diff --git a/cpp/src/qpid/client/SubscriptionManager.cpp b/cpp/src/qpid/client/SubscriptionManager.cpp
index 7289997a69..f14344225c 100644
--- a/cpp/src/qpid/client/SubscriptionManager.cpp
+++ b/cpp/src/qpid/client/SubscriptionManager.cpp
@@ -23,7 +23,7 @@
#include "SubscriptionManager.h"
#include <qpid/client/Dispatcher.h>
-#include <qpid/client/Session_0_10.h>
+#include <qpid/client/Session.h>
#include <qpid/client/MessageListener.h>
#include <set>
#include <sstream>
@@ -32,7 +32,7 @@
namespace qpid {
namespace client {
-SubscriptionManager::SubscriptionManager(Session_0_10& s)
+SubscriptionManager::SubscriptionManager(Session& s)
: dispatcher(s), session(s),
messages(UNLIMITED), bytes(UNLIMITED), window(true),
confirmMode(true), acquireMode(false),
diff --git a/cpp/src/qpid/client/SubscriptionManager.h b/cpp/src/qpid/client/SubscriptionManager.h
index 73331450cf..1741796f4f 100644
--- a/cpp/src/qpid/client/SubscriptionManager.h
+++ b/cpp/src/qpid/client/SubscriptionManager.h
@@ -24,7 +24,7 @@
#include "qpid/sys/Mutex.h"
#include <qpid/client/Dispatcher.h>
#include <qpid/client/Completion.h>
-#include <qpid/client/Session_0_10.h>
+#include <qpid/client/Session.h>
#include <qpid/client/MessageListener.h>
#include <qpid/client/LocalQueue.h>
#include <qpid/sys/Runnable.h>
@@ -48,7 +48,7 @@ class SubscriptionManager : public sys::Runnable
Completion subscribeInternal(const std::string& q, const std::string& dest);
qpid::client::Dispatcher dispatcher;
- qpid::client::Session_0_10& session;
+ qpid::client::Session& session;
uint32_t messages;
uint32_t bytes;
bool window;
@@ -58,7 +58,7 @@ class SubscriptionManager : public sys::Runnable
bool autoStop;
public:
- SubscriptionManager(Session_0_10& session);
+ SubscriptionManager(Session& session);
/**
* Subscribe a MessagesListener to receive messages from queue.