summaryrefslogtreecommitdiff
path: root/cpp/src/qpid
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2012-06-07 12:42:37 +0000
committerKim van der Riet <kpvdr@apache.org>2012-06-07 12:42:37 +0000
commit22d453646b4815752134ad62e0b27841a103afb2 (patch)
tree152b6447a5c097b9617c10b7309775fc7987f996 /cpp/src/qpid
parent45d67efe63abecddf5ca7a68c45f308664bd1466 (diff)
downloadqpid-python-22d453646b4815752134ad62e0b27841a103afb2.tar.gz
QPID-3858: WIP - added AsyncResultQueue for async result return path
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/asyncstore@1347588 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid')
-rw-r--r--cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp5
-rw-r--r--cpp/src/qpid/asyncStore/AsyncStoreImpl.h3
-rw-r--r--cpp/src/qpid/asyncStore/OperationQueue.cpp24
-rw-r--r--cpp/src/qpid/asyncStore/OperationQueue.h4
-rw-r--r--cpp/src/qpid/asyncStore/Plugin.cpp2
-rw-r--r--cpp/src/qpid/broker/AsyncResultHandle.cpp74
-rw-r--r--cpp/src/qpid/broker/AsyncResultHandle.h56
-rw-r--r--cpp/src/qpid/broker/AsyncResultHandleImpl.cpp68
-rw-r--r--cpp/src/qpid/broker/AsyncResultHandleImpl.h54
-rw-r--r--cpp/src/qpid/broker/AsyncResultQueue.cpp62
-rw-r--r--cpp/src/qpid/broker/AsyncResultQueue.h51
-rw-r--r--cpp/src/qpid/broker/AsyncStore.cpp2
-rw-r--r--cpp/src/qpid/broker/AsyncStore.h55
13 files changed, 429 insertions, 31 deletions
diff --git a/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp b/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp
index 083034acc4..6283d07ee9 100644
--- a/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp
+++ b/cpp/src/qpid/asyncStore/AsyncStoreImpl.cpp
@@ -38,11 +38,12 @@ namespace qpid {
namespace asyncStore {
AsyncStoreImpl::AsyncStoreImpl(boost::shared_ptr<qpid::sys::Poller> poller,
- const AsyncStoreOptions& opts) :
+ const AsyncStoreOptions& opts,
+ qpid::broker::AsyncResultQueue* resultQueue) :
m_poller(poller),
m_opts(opts),
m_runState(),
- m_operations(m_poller)
+ m_operations(m_poller, resultQueue)
{}
AsyncStoreImpl::~AsyncStoreImpl()
diff --git a/cpp/src/qpid/asyncStore/AsyncStoreImpl.h b/cpp/src/qpid/asyncStore/AsyncStoreImpl.h
index 0298c74dc5..717723eda3 100644
--- a/cpp/src/qpid/asyncStore/AsyncStoreImpl.h
+++ b/cpp/src/qpid/asyncStore/AsyncStoreImpl.h
@@ -43,7 +43,8 @@ namespace asyncStore {
class AsyncStoreImpl: public qpid::broker::AsyncStore {
public:
AsyncStoreImpl(boost::shared_ptr<qpid::sys::Poller> poller,
- const AsyncStoreOptions& opts);
+ const AsyncStoreOptions& opts,
+ qpid::broker::AsyncResultQueue* resultQueue);
virtual ~AsyncStoreImpl();
void initialize();
uint64_t getNextRid();
diff --git a/cpp/src/qpid/asyncStore/OperationQueue.cpp b/cpp/src/qpid/asyncStore/OperationQueue.cpp
index 69ddf7645e..f13114f41e 100644
--- a/cpp/src/qpid/asyncStore/OperationQueue.cpp
+++ b/cpp/src/qpid/asyncStore/OperationQueue.cpp
@@ -23,11 +23,15 @@
#include "OperationQueue.h"
+#include "qpid/broker/AsyncResultHandle.h"
+
namespace qpid {
namespace asyncStore {
-OperationQueue::OperationQueue(const boost::shared_ptr<qpid::sys::Poller>& poller) :
- m_opQueue(boost::bind(&OperationQueue::handle, this, _1), poller)
+OperationQueue::OperationQueue(const boost::shared_ptr<qpid::sys::Poller>& poller,
+ qpid::broker::AsyncResultQueue* resultQueue) :
+ m_opQueue(boost::bind(&OperationQueue::handle, this, _1), poller),
+ m_resultQueue(resultQueue)
{
m_opQueue.start();
}
@@ -40,7 +44,7 @@ OperationQueue::~OperationQueue()
void
OperationQueue::submit(const AsyncOperation* op)
{
-//std::cout << "--> OperationQueue::submit() op=" << op->getOpStr() << std::endl << std::flush;
+std::cout << "--> OperationQueue::submit() op=" << op->getOpStr() << std::endl << std::flush;
m_opQueue.push(op);
}
@@ -49,11 +53,17 @@ OperationQueue::OpQueue::Batch::const_iterator
OperationQueue::handle(const OperationQueue::OpQueue::Batch& e)
{
for (OpQueue::Batch::const_iterator i = e.begin(); i != e.end(); ++i) {
-//std::cout << "<-- OperationQueue::handle() Op=" << (*i)->getOpStr() << std::endl << std::flush;
- if ((*i)->m_resCb) {
- ((*i)->m_resCb)(new qpid::broker::AsyncResult, (*i)->m_brokerCtxt);
+std::cout << "<-- OperationQueue::handle() Op=" << (*i)->getOpStr() << std::endl << std::flush;
+ qpid::broker::BrokerAsyncContext* bc = (*i)->m_brokerCtxt;
+ qpid::broker::ResultCallback rcb = (*i)->m_resCb;
+ if (rcb) {
+// ((*i)->m_resCb)(new qpid::broker::AsyncResult, (*i)->m_brokerCtxt);
+// rcb(new qpid::broker::AsyncResultHandle(new qpid::broker::AsyncResultHandleImpl(bc)));
+ if (m_resultQueue) {
+ (m_resultQueue->*rcb)(new qpid::broker::AsyncResultHandle(new qpid::broker::AsyncResultHandleImpl(bc)));
+ }
} else {
- delete (*i)->m_brokerCtxt;
+ delete bc;
}
delete (*i);
}
diff --git a/cpp/src/qpid/asyncStore/OperationQueue.h b/cpp/src/qpid/asyncStore/OperationQueue.h
index 8a79684262..eba7c829a3 100644
--- a/cpp/src/qpid/asyncStore/OperationQueue.h
+++ b/cpp/src/qpid/asyncStore/OperationQueue.h
@@ -35,13 +35,15 @@ namespace asyncStore {
class OperationQueue
{
public:
- OperationQueue(const boost::shared_ptr<qpid::sys::Poller>& poller);
+ OperationQueue(const boost::shared_ptr<qpid::sys::Poller>& poller,
+ qpid::broker::AsyncResultQueue* resultQueue = 0);
virtual ~OperationQueue();
void submit(const AsyncOperation* op);
protected:
typedef qpid::sys::PollableQueue<const AsyncOperation*> OpQueue;
OpQueue m_opQueue;
+ qpid::broker::AsyncResultQueue* m_resultQueue;
OpQueue::Batch::const_iterator handle(const OpQueue::Batch& e);
};
diff --git a/cpp/src/qpid/asyncStore/Plugin.cpp b/cpp/src/qpid/asyncStore/Plugin.cpp
index 4f35e8cd2a..0441e9c082 100644
--- a/cpp/src/qpid/asyncStore/Plugin.cpp
+++ b/cpp/src/qpid/asyncStore/Plugin.cpp
@@ -41,7 +41,7 @@ Plugin::earlyInitialize(Target& target)
m_options.m_storeDir = dataDir.getPath ();
}
- m_store.reset(new qpid::asyncStore::AsyncStoreImpl(broker->getPoller(), m_options));
+ m_store.reset(new qpid::asyncStore::AsyncStoreImpl(broker->getPoller(), m_options, 0)); // TODO: last arg: point to broker instance of AsyncResultQueue
boost::shared_ptr<qpid::broker::AsyncStore> brokerAsyncStore(m_store);
broker->setAsyncStore(brokerAsyncStore);
boost::function<void()> fn = boost::bind(&Plugin::finalize, this);
diff --git a/cpp/src/qpid/broker/AsyncResultHandle.cpp b/cpp/src/qpid/broker/AsyncResultHandle.cpp
new file mode 100644
index 0000000000..26e46fee1c
--- /dev/null
+++ b/cpp/src/qpid/broker/AsyncResultHandle.cpp
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * \file AsyncResultHandle.cpp
+ */
+
+#include "AsyncResultHandle.h"
+
+#include "qpid/messaging/PrivateImplRef.h"
+
+namespace qpid {
+namespace broker {
+
+typedef qpid::messaging::PrivateImplRef<AsyncResultHandle> PrivateImpl;
+
+AsyncResultHandle::AsyncResultHandle(AsyncResultHandleImpl* p) :
+ qpid::messaging::Handle<AsyncResultHandleImpl>()
+{
+ PrivateImpl::ctor(*this, p);
+}
+
+AsyncResultHandle::AsyncResultHandle(const AsyncResultHandle& r) :
+ qpid::messaging::Handle<AsyncResultHandleImpl>()
+{
+ PrivateImpl::copy(*this, r);
+}
+
+AsyncResultHandle::~AsyncResultHandle()
+{
+ PrivateImpl::dtor(*this);
+}
+
+AsyncResultHandle&
+AsyncResultHandle::operator=(const AsyncResultHandle& r)
+{
+ return PrivateImpl::assign(*this, r);
+}
+
+int
+AsyncResultHandle::getErrNo() const
+{
+ return impl->getErrNo();
+}
+
+std::string
+AsyncResultHandle::getErrMsg() const
+{
+ return impl->getErrMsg();
+}
+
+const BrokerAsyncContext*
+AsyncResultHandle::getBrokerAsyncContext() const
+{
+ return impl->getBrokerAsyncContext();
+}
+
+}} // namespace qpid::broker
diff --git a/cpp/src/qpid/broker/AsyncResultHandle.h b/cpp/src/qpid/broker/AsyncResultHandle.h
new file mode 100644
index 0000000000..6f6290bfcb
--- /dev/null
+++ b/cpp/src/qpid/broker/AsyncResultHandle.h
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * \file AsyncResultHandle.h
+ */
+
+#ifndef qpid_broker_AsyncResultHandle_h_
+#define qpid_broker_AsyncResultHandle_h_
+
+#include "AsyncResultHandleImpl.h"
+
+#include "qpid/messaging/Handle.h"
+
+namespace qpid {
+namespace broker {
+
+class AsyncResultHandle : public qpid::messaging::Handle<AsyncResultHandleImpl>
+{
+public:
+ AsyncResultHandle(AsyncResultHandleImpl* p = 0);
+ AsyncResultHandle(const AsyncResultHandle& r);
+ virtual ~AsyncResultHandle();
+ AsyncResultHandle& operator=(const AsyncResultHandle& r);
+
+ // AsyncResultHandleImpl methods
+
+ int getErrNo() const;
+ std::string getErrMsg() const;
+ const BrokerAsyncContext* getBrokerAsyncContext() const;
+
+private:
+ typedef qpid::broker::AsyncResultHandleImpl Impl;
+ Impl* impl;
+ friend class qpid::messaging::PrivateImplRef<AsyncResultHandle>;
+};
+
+}} // namespace qpid::broker
+
+#endif // qpid_broker_AsyncResultHandle_h_
diff --git a/cpp/src/qpid/broker/AsyncResultHandleImpl.cpp b/cpp/src/qpid/broker/AsyncResultHandleImpl.cpp
new file mode 100644
index 0000000000..36d45e7b0a
--- /dev/null
+++ b/cpp/src/qpid/broker/AsyncResultHandleImpl.cpp
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * \file AsyncResultHandleImpl.cpp
+ */
+
+#include "AsyncResultHandleImpl.h"
+
+namespace qpid {
+namespace broker {
+
+AsyncResultHandleImpl::AsyncResultHandleImpl() :
+ m_errNo(0),
+ m_errMsg(),
+ m_bc(0)
+{}
+
+AsyncResultHandleImpl::AsyncResultHandleImpl(const BrokerAsyncContext* bc) :
+ m_errNo(0),
+ m_errMsg(),
+ m_bc(bc)
+{}
+
+AsyncResultHandleImpl::AsyncResultHandleImpl(const int errNo, const std::string& errMsg, const BrokerAsyncContext* bc) :
+ m_errNo(errNo),
+ m_errMsg(errMsg),
+ m_bc(bc)
+{}
+
+AsyncResultHandleImpl::~AsyncResultHandleImpl()
+{}
+
+int
+AsyncResultHandleImpl::getErrNo() const
+{
+ return m_errNo;
+}
+
+std::string
+AsyncResultHandleImpl::getErrMsg() const
+{
+ return m_errMsg;
+}
+
+const BrokerAsyncContext*
+AsyncResultHandleImpl::getBrokerAsyncContext() const
+{
+ return m_bc;
+}
+
+}} // namespace qpid::broker
diff --git a/cpp/src/qpid/broker/AsyncResultHandleImpl.h b/cpp/src/qpid/broker/AsyncResultHandleImpl.h
new file mode 100644
index 0000000000..e1bd1fa0e9
--- /dev/null
+++ b/cpp/src/qpid/broker/AsyncResultHandleImpl.h
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * \file AsyncResultHandleImpl.h
+ */
+
+#ifndef qpid_broker_AsyncResultHandleImpl_h_
+#define qpid_broker_AsyncResultHandleImpl_h_
+
+#include "AsyncStore.h"
+
+#include "qpid/RefCounted.h"
+
+namespace qpid {
+namespace broker {
+
+class AsyncResultHandleImpl : public virtual qpid::RefCounted
+{
+public:
+ AsyncResultHandleImpl();
+ AsyncResultHandleImpl(const BrokerAsyncContext* bc);
+ AsyncResultHandleImpl(const int errNo, const std::string& errMsg, const BrokerAsyncContext* bc);
+ virtual ~AsyncResultHandleImpl();
+
+ int getErrNo() const;
+ std::string getErrMsg() const;
+ const BrokerAsyncContext* getBrokerAsyncContext() const;
+
+private:
+ const int m_errNo;
+ const std::string m_errMsg;
+ const BrokerAsyncContext* m_bc;
+};
+
+}} // namespace qpid::broker
+
+#endif // qpid_broker_AsyncResultHandleImpl_h_
diff --git a/cpp/src/qpid/broker/AsyncResultQueue.cpp b/cpp/src/qpid/broker/AsyncResultQueue.cpp
new file mode 100644
index 0000000000..1094a582f4
--- /dev/null
+++ b/cpp/src/qpid/broker/AsyncResultQueue.cpp
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * \file AsyncResultQueue.cpp
+ */
+
+#include "AsyncResultQueue.h"
+
+namespace qpid {
+namespace broker {
+
+AsyncResultQueue::AsyncResultQueue(const boost::shared_ptr<qpid::sys::Poller>& poller) :
+ m_resQueue(boost::bind(&AsyncResultQueue::handle, this, _1), poller)
+{
+ m_resQueue.start();
+}
+
+AsyncResultQueue::~AsyncResultQueue()
+{
+ m_resQueue.stop();
+}
+
+void
+AsyncResultQueue::submit(AsyncResultHandle* res)
+{
+ m_resQueue.push(res);
+}
+
+//static
+/*
+void
+AsyncResultQueue::submit(AsyncResultQueue* arq, AsyncResultHandle* rh)
+{
+ arq->submit(rh);
+}
+*/
+
+// protected
+AsyncResultQueue::ResultQueue::Batch::const_iterator
+AsyncResultQueue::handle(const ResultQueue::Batch& e)
+{
+ return e.end();
+}
+
+}} // namespace qpid::broker
diff --git a/cpp/src/qpid/broker/AsyncResultQueue.h b/cpp/src/qpid/broker/AsyncResultQueue.h
new file mode 100644
index 0000000000..8881f25bac
--- /dev/null
+++ b/cpp/src/qpid/broker/AsyncResultQueue.h
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * \file AsyncResultQueue.h
+ */
+
+#ifndef qpid_broker_AsyncResultQueue_h_
+#define qpid_broker_AsyncResultQueue_h_
+
+#include "qpid/sys/PollableQueue.h"
+
+namespace qpid {
+namespace broker {
+
+class AsyncResultHandle;
+
+class AsyncResultQueue
+{
+public:
+ AsyncResultQueue(const boost::shared_ptr<qpid::sys::Poller>& poller);
+ virtual ~AsyncResultQueue();
+ void submit(AsyncResultHandle* rh);
+// static void submit(AsyncResultQueue* arq, AsyncResultHandle* rh);
+
+protected:
+ typedef qpid::sys::PollableQueue<const AsyncResultHandle*> ResultQueue;
+ ResultQueue m_resQueue;
+
+ ResultQueue::Batch::const_iterator handle(const ResultQueue::Batch& e);
+};
+
+}} // namespace qpid::broker
+
+#endif // qpid_broker_AsyncResultQueue_h_
diff --git a/cpp/src/qpid/broker/AsyncStore.cpp b/cpp/src/qpid/broker/AsyncStore.cpp
index 649049bf41..d37b034648 100644
--- a/cpp/src/qpid/broker/AsyncStore.cpp
+++ b/cpp/src/qpid/broker/AsyncStore.cpp
@@ -34,6 +34,7 @@ AsyncStore::AsyncStore()
AsyncStore::~AsyncStore()
{}
+/*
AsyncResult::AsyncResult() :
errNo(0),
errMsg()
@@ -50,5 +51,6 @@ AsyncResult::destroy()
{
delete this;
}
+*/
}} // namespace qpid::broker
diff --git a/cpp/src/qpid/broker/AsyncStore.h b/cpp/src/qpid/broker/AsyncStore.h
index eb47d62cf0..c57bdaa552 100644
--- a/cpp/src/qpid/broker/AsyncStore.h
+++ b/cpp/src/qpid/broker/AsyncStore.h
@@ -37,7 +37,36 @@ public:
virtual ~BrokerAsyncContext();
};
-// Subclassed by broker:
+// Callback definition:
+//struct AsyncResult {
+// int errNo; // 0 implies no error
+// std::string errMsg;
+// AsyncResult();
+// AsyncResult(const int errNo,
+// const std::string& errMsg);
+// void destroy();
+//};
+//typedef void (*ResultCallback)(const AsyncResult*, BrokerAsyncContext*);
+
+class AsyncResultHandle;
+class AsyncResultQueue; // Implements the result callback function
+
+// Singleton class in broker which contains return pollable queue. Use submitAsyncResult() to add reulsts to queue.
+class AsyncResultHandler {
+public:
+ virtual ~AsyncResultHandler();
+
+ // Factory method to create result handle
+
+ virtual AsyncResultHandle createAsyncResultHandle(const int errNo, const std::string& errMsg, BrokerAsyncContext*) = 0;
+
+ // Async return interface
+
+ virtual void submitAsyncResult(AsyncResultHandle&) = 0;
+};
+typedef void (qpid::broker::AsyncResultQueue::*ResultCallback)(AsyncResultHandle*);
+//typedef void (qpid::broker::AsyncResultQueue::*ResultCallback)(AsyncResultQueue*, AsyncResultHandle*);
+
class DataSource {
public:
virtual ~DataSource();
@@ -45,25 +74,13 @@ public:
virtual void write(char* target) = 0;
};
-// Defined by store, all implement qpid::messaging::Handle-type template to hide ref counting:
class ConfigHandle;
-class QueueHandle;
-class TxnHandle;
+class EnqueueHandle;
class EventHandle;
class MessageHandle;
-class EnqueueHandle;
+class QueueHandle;
+class TxnHandle;
-// Callback definition:
-struct AsyncResult
-{
- int errNo; // 0 implies no error
- std::string errMsg;
- AsyncResult();
- AsyncResult(const int errNo,
- const std::string& errMsg);
- void destroy();
-};
-typedef void (*ResultCallback)(const AsyncResult*, BrokerAsyncContext*);
// Subclassed by store:
class AsyncStore {
@@ -73,12 +90,12 @@ public:
// Factory methods for creating handles
- virtual TxnHandle createTxnHandle(const std::string& xid=std::string()) = 0;
virtual ConfigHandle createConfigHandle() = 0;
- virtual QueueHandle createQueueHandle(const std::string& name, const qpid::types::Variant::Map& opts) = 0;
+ virtual EnqueueHandle createEnqueueHandle(MessageHandle&, QueueHandle&) = 0;
virtual EventHandle createEventHandle(QueueHandle&, const std::string& key=std::string()) = 0;
virtual MessageHandle createMessageHandle(const DataSource*) = 0;
- virtual EnqueueHandle createEnqueueHandle(MessageHandle&, QueueHandle&) = 0;
+ virtual QueueHandle createQueueHandle(const std::string& name, const qpid::types::Variant::Map& opts) = 0;
+ virtual TxnHandle createTxnHandle(const std::string& xid=std::string()) = 0;
// Store async interface