diff options
author | Carl C. Trieloff <cctrieloff@apache.org> | 2007-09-14 18:44:27 +0000 |
---|---|---|
committer | Carl C. Trieloff <cctrieloff@apache.org> | 2007-09-14 18:44:27 +0000 |
commit | b4ae4c1493c29e38f096eb8c973d7681dff55778 (patch) | |
tree | f3a4ddea8b2c8c585fdeddf55b05024d053a85e1 /cpp | |
parent | 9b3748849707c476b76c09fcabfefd965087a108 (diff) | |
download | qpid-python-b4ae4c1493c29e38f096eb8c973d7681dff55778.tar.gz |
recover support for async stores
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@575773 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/qpid/broker/PersistableQueue.h | 7 | ||||
-rw-r--r-- | cpp/src/qpid/broker/RecoverableQueue.h | 7 | ||||
-rw-r--r-- | cpp/src/qpid/broker/RecoveryManagerImpl.cpp | 12 |
3 files changed, 25 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/PersistableQueue.h b/cpp/src/qpid/broker/PersistableQueue.h index 2b98b37b52..951c93fb86 100644 --- a/cpp/src/qpid/broker/PersistableQueue.h +++ b/cpp/src/qpid/broker/PersistableQueue.h @@ -56,7 +56,12 @@ public: delete externalQueueStore; }; - inline void setExternalQueueStore(ExternalQueueStore* inst) {externalQueueStore = inst;}; + inline void setExternalQueueStore(ExternalQueueStore* inst){ + if (externalQueueStore!=inst && externalQueueStore) + delete externalQueueStore; + externalQueueStore = inst; + }; + inline ExternalQueueStore* getExternalQueueStore() const {return externalQueueStore;}; PersistableQueue():externalQueueStore(NULL){ diff --git a/cpp/src/qpid/broker/RecoverableQueue.h b/cpp/src/qpid/broker/RecoverableQueue.h index 656a5f0149..578cc09e04 100644 --- a/cpp/src/qpid/broker/RecoverableQueue.h +++ b/cpp/src/qpid/broker/RecoverableQueue.h @@ -28,6 +28,8 @@ namespace qpid { namespace broker { +class ExternalQueueStore; + /** * The interface through which messages are added back to queues on * recovery. @@ -43,6 +45,11 @@ public: */ virtual void recover(RecoverableMessage::shared_ptr msg) = 0; virtual ~RecoverableQueue() {}; + + virtual const std::string& getName() const = 0; + virtual void setExternalQueueStore(ExternalQueueStore* inst) = 0; + + }; }} diff --git a/cpp/src/qpid/broker/RecoveryManagerImpl.cpp b/cpp/src/qpid/broker/RecoveryManagerImpl.cpp index 4bd82a321d..51fc99fa3e 100644 --- a/cpp/src/qpid/broker/RecoveryManagerImpl.cpp +++ b/cpp/src/qpid/broker/RecoveryManagerImpl.cpp @@ -62,6 +62,8 @@ public: RecoverableQueueImpl(Queue::shared_ptr& _queue) : queue(_queue) {} ~RecoverableQueueImpl() {}; void setPersistenceId(uint64_t id); + const std::string& getName() const; + void setExternalQueueStore(ExternalQueueStore* inst); void recover(RecoverableMessage::shared_ptr msg); void enqueue(DtxBuffer::shared_ptr buffer, RecoverableMessage::shared_ptr msg); void dequeue(DtxBuffer::shared_ptr buffer, RecoverableMessage::shared_ptr msg); @@ -155,6 +157,16 @@ void RecoverableQueueImpl::setPersistenceId(uint64_t id) queue->setPersistenceId(id); } +const std::string& RecoverableQueueImpl::getName() const +{ + return queue->getName(); +} + +void RecoverableQueueImpl::setExternalQueueStore(ExternalQueueStore* inst) +{ + queue->setExternalQueueStore(inst); +} + void RecoverableExchangeImpl::setPersistenceId(uint64_t id) { exchange->setPersistenceId(id); |