summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/broker
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/qpid/broker')
-rw-r--r--cpp/src/qpid/broker/PersistableQueue.h9
-rw-r--r--cpp/src/qpid/broker/Queue.cpp12
-rw-r--r--cpp/src/qpid/broker/Queue.h7
3 files changed, 20 insertions, 8 deletions
diff --git a/cpp/src/qpid/broker/PersistableQueue.h b/cpp/src/qpid/broker/PersistableQueue.h
index 2d30513884..9236814ae3 100644
--- a/cpp/src/qpid/broker/PersistableQueue.h
+++ b/cpp/src/qpid/broker/PersistableQueue.h
@@ -24,6 +24,7 @@
#include <string>
#include "Persistable.h"
+#include "qpid/management/Manageable.h"
#include <boost/shared_ptr.hpp>
namespace qpid {
@@ -35,7 +36,7 @@ namespace broker {
* persistableQueue
*/
-class ExternalQueueStore
+class ExternalQueueStore : public management::Manageable
{
public:
virtual ~ExternalQueueStore() {};
@@ -58,11 +59,7 @@ public:
delete externalQueueStore;
};
- inline void setExternalQueueStore(ExternalQueueStore* inst){
- if (externalQueueStore!=inst && externalQueueStore)
- delete externalQueueStore;
- externalQueueStore = inst;
- };
+ virtual void setExternalQueueStore(ExternalQueueStore* inst) = 0;
inline ExternalQueueStore* getExternalQueueStore() const {return externalQueueStore;};
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp
index 436431fce1..a405971805 100644
--- a/cpp/src/qpid/broker/Queue.cpp
+++ b/cpp/src/qpid/broker/Queue.cpp
@@ -632,6 +632,18 @@ bool Queue::hasExclusiveConsumer() const
return exclusive;
}
+void Queue::setExternalQueueStore(ExternalQueueStore* inst) {
+ if (externalQueueStore!=inst && externalQueueStore)
+ delete externalQueueStore;
+ externalQueueStore = inst;
+
+ if (inst) {
+ ManagementObject::shared_ptr childObj = inst->GetManagementObject();
+ if (childObj.get() != 0)
+ mgmtObject->set_storeRef(childObj->getObjectId());
+ }
+}
+
ManagementObject::shared_ptr Queue::GetManagementObject (void) const
{
return dynamic_pointer_cast<ManagementObject> (mgmtObject);
diff --git a/cpp/src/qpid/broker/Queue.h b/cpp/src/qpid/broker/Queue.h
index 880b048103..8b92784b9a 100644
--- a/cpp/src/qpid/broker/Queue.h
+++ b/cpp/src/qpid/broker/Queue.h
@@ -60,7 +60,8 @@ namespace qpid {
* registered consumers or be stored until dequeued or until one
* or more consumers registers.
*/
- class Queue : public boost::enable_shared_from_this<Queue>, public PersistableQueue, public management::Manageable {
+ class Queue : public boost::enable_shared_from_this<Queue>,
+ public PersistableQueue, public management::Manageable {
typedef std::set<Consumer*> Listeners;
typedef std::deque<QueuedMessage> Messages;
@@ -106,7 +107,7 @@ namespace qpid {
Queue(const string& name, bool autodelete = false,
MessageStore* const store = 0,
const OwnershipToken* const owner = 0,
- Manageable* parent = 0);
+ management::Manageable* parent = 0);
~Queue();
bool dispatch(Consumer&);
@@ -183,6 +184,8 @@ namespace qpid {
static Queue::shared_ptr decode(QueueRegistry& queues, framing::Buffer& buffer);
static void tryAutoDelete(Broker& broker, Queue::shared_ptr);
+ virtual void setExternalQueueStore(ExternalQueueStore* inst);
+
// Manageable entry points
management::ManagementObject::shared_ptr GetManagementObject (void) const;
management::Manageable::status_t