You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2013/09/03 18:10:56 UTC
git commit: fix for: https://issues.apache.org/jira/browse/AMQCPP-508
Updated Branches:
refs/heads/trunk f20d9688d -> a849f3b62
fix for: https://issues.apache.org/jira/browse/AMQCPP-508
Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/a849f3b6
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/a849f3b6
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/a849f3b6
Branch: refs/heads/trunk
Commit: a849f3b62b8a1b29a4e90361c339bd43eddc766a
Parents: f20d968
Author: Timothy Bish <ta...@gmai.com>
Authored: Tue Sep 3 12:10:53 2013 -0400
Committer: Timothy Bish <ta...@gmai.com>
Committed: Tue Sep 3 12:10:53 2013 -0400
----------------------------------------------------------------------
activemq-cpp/configure.ac | 2 +-
activemq-cpp/src/main/Makefile.am | 12 +
.../activemq/commands/ActiveMQBlobMessage.h | 5 -
.../activemq/commands/ActiveMQBytesMessage.h | 5 -
.../activemq/commands/ActiveMQDestination.h | 5 -
.../main/activemq/commands/ActiveMQMapMessage.h | 5 -
.../main/activemq/commands/ActiveMQMessage.h | 5 -
.../activemq/commands/ActiveMQObjectMessage.h | 5 -
.../src/main/activemq/commands/ActiveMQQueue.h | 31 +-
.../activemq/commands/ActiveMQStreamMessage.h | 5 -
.../activemq/commands/ActiveMQTempDestination.h | 5 -
.../main/activemq/commands/ActiveMQTempQueue.h | 20 +-
.../main/activemq/commands/ActiveMQTempTopic.h | 23 +-
.../activemq/commands/ActiveMQTextMessage.h | 5 -
.../src/main/activemq/commands/ActiveMQTopic.h | 40 +--
.../main/activemq/core/ActiveMQConnection.cpp | 6 +
.../src/main/activemq/core/ActiveMQConnection.h | 9 +-
.../activemq/core/ActiveMQDestinationEvent.cpp | 64 ++++
.../activemq/core/ActiveMQDestinationEvent.h | 67 ++++
.../activemq/core/ActiveMQDestinationSource.cpp | 328 +++++++++++++++++++
.../activemq/core/ActiveMQDestinationSource.h | 69 ++++
activemq-cpp/src/main/cms/DestinationEvent.cpp | 24 ++
activemq-cpp/src/main/cms/DestinationEvent.h | 64 ++++
.../src/main/cms/DestinationListener.cpp | 25 ++
activemq-cpp/src/main/cms/DestinationListener.h | 53 +++
activemq-cpp/src/main/cms/DestinationSource.cpp | 24 ++
activemq-cpp/src/main/cms/DestinationSource.h | 117 +++++++
.../src/main/cms/EnhancedConnection.cpp | 24 ++
activemq-cpp/src/main/cms/EnhancedConnection.h | 53 +++
activemq-cpp/src/test-integration/Makefile.am | 2 +
.../src/test-integration/TestRegistry.cpp | 50 +--
.../openwire/OpenwireEnhancedConnectionTest.cpp | 264 +++++++++++++++
.../openwire/OpenwireEnhancedConnectionTest.h | 56 ++++
33 files changed, 1331 insertions(+), 141 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/configure.ac
----------------------------------------------------------------------
diff --git a/activemq-cpp/configure.ac b/activemq-cpp/configure.ac
index ee88b8b..7b3bf9e 100644
--- a/activemq-cpp/configure.ac
+++ b/activemq-cpp/configure.ac
@@ -39,7 +39,7 @@ ACTIVEMQ_API_VERSION=${ACTIVEMQ_VERSION}
## Define the Version variables for the CMS API Library
## ------------------------------------------------------------
CMSAPI_MAJOR_VERSION=3
-CMSAPI_MINOR_VERSION=1
+CMSAPI_MINOR_VERSION=2
CMSAPI_VERSION=${CMSAPI_MAJOR_VERSION}.${CMSAPI_MINOR_VERSION}
AC_SUBST(CMSAPI_MAJOR_VERSION)
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/Makefile.am
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/Makefile.am b/activemq-cpp/src/main/Makefile.am
index d766611..5d117aa 100644
--- a/activemq-cpp/src/main/Makefile.am
+++ b/activemq-cpp/src/main/Makefile.am
@@ -96,6 +96,8 @@ cc_sources = \
activemq/core/ActiveMQConnectionMetaData.cpp \
activemq/core/ActiveMQConstants.cpp \
activemq/core/ActiveMQConsumer.cpp \
+ activemq/core/ActiveMQDestinationEvent.cpp \
+ activemq/core/ActiveMQDestinationSource.cpp \
activemq/core/ActiveMQMessageAudit.cpp \
activemq/core/ActiveMQProducer.cpp \
activemq/core/ActiveMQQueueBrowser.cpp \
@@ -284,6 +286,10 @@ cc_sources = \
cms/ConnectionMetaData.cpp \
cms/DeliveryMode.cpp \
cms/Destination.cpp \
+ cms/DestinationEvent.cpp \
+ cms/DestinationListener.cpp \
+ cms/DestinationSource.cpp \
+ cms/EnhancedConnection.cpp \
cms/ExceptionListener.cpp \
cms/IllegalStateException.cpp \
cms/InvalidClientIdException.cpp \
@@ -734,6 +740,8 @@ h_sources = \
activemq/core/ActiveMQConnectionMetaData.h \
activemq/core/ActiveMQConstants.h \
activemq/core/ActiveMQConsumer.h \
+ activemq/core/ActiveMQDestinationEvent.h \
+ activemq/core/ActiveMQDestinationSource.h \
activemq/core/ActiveMQMessageAudit.h \
activemq/core/ActiveMQProducer.h \
activemq/core/ActiveMQQueueBrowser.h \
@@ -927,6 +935,10 @@ h_sources = \
cms/ConnectionMetaData.h \
cms/DeliveryMode.h \
cms/Destination.h \
+ cms/DestinationEvent.h \
+ cms/DestinationListener.h \
+ cms/DestinationSource.h \
+ cms/EnhancedConnection.h \
cms/ExceptionListener.h \
cms/IllegalStateException.h \
cms/InvalidClientIdException.h \
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
index 988e202..caa3c9f 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQBLOBMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
#include <cms/Message.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
index 993c12d..3b53c22 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQBYTESMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQBYTESMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
#include <decaf/io/ByteArrayOutputStream.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.h b/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.h
index 0521e24..ba6d9d8 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQDestination.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQDESTINATION_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQDESTINATION_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/BaseDataStructure.h>
#include <activemq/util/ActiveMQProperties.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
index 0343701..153c436 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQMAPMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQMAPMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
#include <activemq/util/PrimitiveMap.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
index 579f014..57fdac8 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <cms/Message.h>
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
index 17fbc62..79a0c3b 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQOBJECTMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQOBJECTMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/commands/ActiveMQMessageTemplate.h>
#include <cms/ObjectMessage.h>
#include <activemq/util/Config.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h b/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h
index e397fac..905ffeb 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQQueue.h
@@ -32,39 +32,38 @@
#include <string>
#include <memory>
-namespace activemq{
-namespace commands{
+namespace activemq {
+namespace commands {
- class AMQCPP_API ActiveMQQueue : public ActiveMQDestination,
- public cms::Queue {
+ class AMQCPP_API ActiveMQQueue : public ActiveMQDestination, public cms::Queue {
public:
const static unsigned char ID_ACTIVEMQQUEUE = 100;
private:
- ActiveMQQueue( const ActiveMQQueue& );
- ActiveMQQueue& operator= ( const ActiveMQQueue& );
+ ActiveMQQueue(const ActiveMQQueue&);
+ ActiveMQQueue& operator=(const ActiveMQQueue&);
public:
ActiveMQQueue();
- ActiveMQQueue( const std::string& name );
+ ActiveMQQueue(const std::string& name);
- virtual ~ActiveMQQueue() throw();
+ virtual ~ActiveMQQueue() throw ();
virtual unsigned char getDataStructureType() const;
virtual ActiveMQQueue* cloneDataStructure() const;
- virtual void copyDataStructure( const DataStructure* src );
+ virtual void copyDataStructure(const DataStructure* src);
virtual std::string toString() const;
- virtual bool equals( const DataStructure* value ) const;
+ virtual bool equals(const DataStructure* value) const;
- virtual const cms::Destination* getCMSDestination() const {
+ virtual const cms::Queue* getCMSDestination() const {
return this;
}
@@ -75,20 +74,18 @@ namespace commands{
}
virtual cms::Destination* clone() const {
- return dynamic_cast<cms::Destination*>(
- this->cloneDataStructure() );
+ return dynamic_cast<cms::Destination*>(this->cloneDataStructure());
}
- virtual void copy( const cms::Destination& source ) {
- this->copyDataStructure(
- dynamic_cast<const DataStructure*>( &source ) );
+ virtual void copy(const cms::Destination& source) {
+ this->copyDataStructure(dynamic_cast<const DataStructure*>(&source));
}
virtual const cms::CMSProperties& getCMSProperties() const {
return this->getOptions();
}
- virtual bool equals( const cms::Destination& other ) const;
+ virtual bool equals(const cms::Destination& other) const;
public: // CMS Queue
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
index d47e19f..0514131 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQSTREAMMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessage.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h b/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h
index 6d90e1e..d639749 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQTempDestination.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPDESTINATION_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPDESTINATION_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQDestination.h>
#include <activemq/exceptions/ActiveMQException.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h b/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h
index 4b80244..aab278f 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQTempQueue.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPQUEUE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPQUEUE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQTempDestination.h>
#include <cms/TemporaryQueue.h>
@@ -30,11 +25,10 @@
#include <string>
#include <memory>
-namespace activemq{
-namespace commands{
+namespace activemq {
+namespace commands {
- class AMQCPP_API ActiveMQTempQueue : public ActiveMQTempDestination,
- public cms::TemporaryQueue {
+ class AMQCPP_API ActiveMQTempQueue: public ActiveMQTempDestination, public cms::TemporaryQueue {
public:
const static unsigned char ID_ACTIVEMQTEMPQUEUE = 102;
@@ -60,22 +54,22 @@ namespace commands{
virtual bool equals(const DataStructure* value) const;
- virtual const cms::Destination* getCMSDestination() const {
+ virtual const cms::TemporaryQueue* getCMSDestination() const {
return this;
}
- public: // CMS Destination
+ public: // CMS Destination
virtual cms::Destination::DestinationType getDestinationType() const {
return cms::Destination::TEMPORARY_QUEUE;
}
virtual cms::Destination* clone() const {
- return dynamic_cast<cms::Destination*> (this->cloneDataStructure());
+ return dynamic_cast<cms::Destination*>(this->cloneDataStructure());
}
virtual void copy(const cms::Destination& source) {
- this->copyDataStructure(dynamic_cast<const DataStructure*> (&source));
+ this->copyDataStructure(dynamic_cast<const DataStructure*>(&source));
}
virtual const cms::CMSProperties& getCMSProperties() const {
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h b/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h
index 089faa8..33009fe 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQTempTopic.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPTOPIC_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPTOPIC_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQTempDestination.h>
#include <cms/TemporaryTopic.h>
@@ -30,11 +25,10 @@
#include <string>
#include <memory>
-namespace activemq{
-namespace commands{
+namespace activemq {
+namespace commands {
- class AMQCPP_API ActiveMQTempTopic : public ActiveMQTempDestination,
- public cms::TemporaryTopic {
+ class AMQCPP_API ActiveMQTempTopic: public ActiveMQTempDestination, public cms::TemporaryTopic {
public:
const static unsigned char ID_ACTIVEMQTEMPTOPIC = 103;
@@ -60,23 +54,22 @@ namespace commands{
virtual bool equals(const DataStructure* value) const;
- virtual const cms::Destination* getCMSDestination() const {
+ virtual const cms::TemporaryTopic* getCMSDestination() const {
return this;
}
- public:
- // CMS Destination
+ public: // CMS Destination
virtual cms::Destination::DestinationType getDestinationType() const {
return cms::Destination::TEMPORARY_TOPIC;
}
virtual cms::Destination* clone() const {
- return dynamic_cast<cms::Destination*> (this->cloneDataStructure());
+ return dynamic_cast<cms::Destination*>(this->cloneDataStructure());
}
virtual void copy(const cms::Destination& source) {
- this->copyDataStructure(dynamic_cast<const DataStructure*> (&source));
+ this->copyDataStructure(dynamic_cast<const DataStructure*>(&source));
}
virtual const cms::CMSProperties& getCMSProperties() const {
@@ -85,7 +78,7 @@ namespace commands{
virtual bool equals(const cms::Destination& other) const;
- public: // CMS Temporary Topic
+ public: // CMS Temporary Topic
virtual std::string getTopicName() const {
return this->getPhysicalName();
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h
index b514399..fbe2c4c 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQTextMessage.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQTEXTMESSAGE_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQTEXTMESSAGE_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
#include <cms/TextMessage.h>
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h b/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h
index 2bcadf3..26615b7 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQTopic.h
@@ -18,11 +18,6 @@
#ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQTOPIC_H_
#define _ACTIVEMQ_COMMANDS_ACTIVEMQTOPIC_H_
-// Turn off warning message for ignored exception specification
-#ifdef _MSC_VER
-#pragma warning( disable : 4290 )
-#endif
-
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQDestination.h>
#include <activemq/exceptions/ActiveMQException.h>
@@ -32,63 +27,60 @@
#include <string>
#include <memory>
-namespace activemq{
-namespace commands{
+namespace activemq {
+namespace commands {
- class AMQCPP_API ActiveMQTopic : public ActiveMQDestination,
- public cms::Topic {
+ class AMQCPP_API ActiveMQTopic: public ActiveMQDestination, public cms::Topic {
public:
const static unsigned char ID_ACTIVEMQTOPIC = 101;
private:
- ActiveMQTopic( const ActiveMQTopic& );
- ActiveMQTopic& operator= ( const ActiveMQTopic& );
+ ActiveMQTopic(const ActiveMQTopic&);
+ ActiveMQTopic& operator=(const ActiveMQTopic&);
public:
ActiveMQTopic();
- ActiveMQTopic( const std::string& name );
- virtual ~ActiveMQTopic() throw();
+ ActiveMQTopic(const std::string& name);
+ virtual ~ActiveMQTopic() throw ();
virtual unsigned char getDataStructureType() const;
virtual ActiveMQTopic* cloneDataStructure() const;
- virtual void copyDataStructure( const DataStructure* src );
+ virtual void copyDataStructure(const DataStructure* src);
virtual std::string toString() const;
- virtual bool equals( const DataStructure* value ) const;
+ virtual bool equals(const DataStructure* value) const;
- virtual const cms::Destination* getCMSDestination() const {
+ virtual const cms::Topic* getCMSDestination() const {
return this;
}
- public: // CMS Destination
+ public: // CMS Destination
virtual cms::Destination::DestinationType getDestinationType() const {
return cms::Destination::TOPIC;
}
virtual cms::Destination* clone() const {
- return dynamic_cast<cms::Destination*>(
- this->cloneDataStructure() );
+ return dynamic_cast<cms::Destination*>(this->cloneDataStructure());
}
- virtual void copy( const cms::Destination& source ) {
- this->copyDataStructure(
- dynamic_cast<const DataStructure*>( &source ) );
+ virtual void copy(const cms::Destination& source) {
+ this->copyDataStructure(dynamic_cast<const DataStructure*>(&source));
}
virtual const cms::CMSProperties& getCMSProperties() const {
return this->getOptions();
}
- virtual bool equals( const cms::Destination& other ) const;
+ virtual bool equals(const cms::Destination& other) const;
- public: // CMS Topic
+ public: // CMS Topic
virtual std::string getTopicName() const {
return this->getPhysicalName();
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp b/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
index 6b056a8..0569f97 100644
--- a/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
+++ b/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
@@ -23,6 +23,7 @@
#include <activemq/core/ActiveMQConstants.h>
#include <activemq/core/ActiveMQConnectionMetaData.h>
#include <activemq/core/ActiveMQMessageAudit.h>
+#include <activemq/core/ActiveMQDestinationSource.h>
#include <activemq/core/AdvisoryConsumer.h>
#include <activemq/core/ConnectionAudit.h>
#include <activemq/core/kernels/ActiveMQSessionKernel.h>
@@ -1507,6 +1508,11 @@ cms::MessageTransformer* ActiveMQConnection::getMessageTransformer() const {
}
////////////////////////////////////////////////////////////////////////////////
+cms::DestinationSource* ActiveMQConnection::getDestinationSource() {
+ return new ActiveMQDestinationSource(this);
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ActiveMQConnection::setPrefetchPolicy(PrefetchPolicy* policy) {
this->config->defaultPrefetchPolicy.reset(policy);
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h b/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
index df4d716..4b5a10c 100644
--- a/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
+++ b/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
@@ -18,7 +18,7 @@
#ifndef _ACTIVEMQ_CORE_ACTIVEMQCONNECTION_H_
#define _ACTIVEMQ_CORE_ACTIVEMQCONNECTION_H_
-#include <cms/Connection.h>
+#include <cms/EnhancedConnection.h>
#include <activemq/util/Config.h>
#include <activemq/core/Dispatcher.h>
#include <activemq/commands/ActiveMQTempDestination.h>
@@ -57,7 +57,7 @@ namespace core{
*
* @since 2.0
*/
- class AMQCPP_API ActiveMQConnection : public virtual cms::Connection,
+ class AMQCPP_API ActiveMQConnection : public virtual cms::EnhancedConnection,
public transport::TransportListener {
private:
@@ -324,6 +324,11 @@ namespace core{
*/
virtual cms::MessageTransformer* getMessageTransformer() const;
+ /**
+ * {@inheritDoc}
+ */
+ virtual cms::DestinationSource* getDestinationSource();
+
public: // Configuration Options
/**
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.cpp b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.cpp
new file mode 100644
index 0000000..646f03f
--- /dev/null
+++ b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+#include "ActiveMQDestinationEvent.h"
+
+#include <activemq/core/ActiveMQConstants.h>
+#include <activemq/commands/ActiveMQDestination.h>
+
+#include <decaf/lang/exceptions/NullPointerException.h>
+
+using namespace cms;
+using namespace activemq;
+using namespace activemq::core;
+using namespace activemq::commands;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQDestinationEvent::ActiveMQDestinationEvent(Pointer<DestinationInfo> destination) :
+ DestinationEvent(), destination(destination) {
+
+ if (destination == NULL) {
+ throw NullPointerException(__FILE__, __LINE__, "Events cannot have null destinations");
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQDestinationEvent::~ActiveMQDestinationEvent() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+const cms::Destination* ActiveMQDestinationEvent::getDestination() const {
+ Pointer<ActiveMQDestination> dest = this->destination->getDestination();
+ if (dest != NULL) {
+ return dest->getCMSDestination();
+ }
+
+ return NULL;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQDestinationEvent::isAddOperation() const {
+ return this->destination->getOperationType() == ActiveMQConstants::DESTINATION_ADD_OPERATION;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+bool ActiveMQDestinationEvent::isRemoveOperation() const {
+ return this->destination->getOperationType() == ActiveMQConstants::DESTINATION_REMOVE_OPERATION;
+}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.h b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.h
new file mode 100644
index 0000000..471bf1d
--- /dev/null
+++ b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationEvent.h
@@ -0,0 +1,67 @@
+/*
+ * 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.
+ */
+
+#ifndef _ACTIVEMQ_CORE_ACTIVEMQDESTINATIONEVENT_H_
+#define _ACTIVEMQ_CORE_ACTIVEMQDESTINATIONEVENT_H_
+
+#include <cms/DestinationEvent.h>
+
+#include <decaf/lang/Pointer.h>
+#include <activemq/commands/DestinationInfo.h>
+#include <activemq/util/Config.h>
+
+namespace activemq {
+namespace core {
+
+ class AMQCPP_API ActiveMQDestinationEvent : public cms::DestinationEvent {
+ private:
+
+ ActiveMQDestinationEvent(const ActiveMQDestinationEvent&);
+ ActiveMQDestinationEvent& operator= (const ActiveMQDestinationEvent&);
+
+ private:
+
+ decaf::lang::Pointer<commands::DestinationInfo> destination;
+
+ public:
+
+ ActiveMQDestinationEvent(decaf::lang::Pointer<commands::DestinationInfo> destination);
+
+ virtual ~ActiveMQDestinationEvent();
+
+ virtual const cms::Destination* getDestination() const;
+
+ virtual bool isAddOperation() const;
+
+ virtual bool isRemoveOperation() const;
+
+ public:
+
+ /**
+ * Returns the DestinationInfo object that triggered this event.
+ *
+ * @returns the DestinationInfo object that triggered this event.
+ */
+ decaf::lang::Pointer<commands::DestinationInfo> getDestinationInfo() const {
+ return this->destination;
+ }
+
+ };
+
+}}
+
+#endif /* _ACTIVEMQ_CORE_ACTIVEMQDESTINATIONEVENT_H_ */
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.cpp b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.cpp
new file mode 100644
index 0000000..a2707e8
--- /dev/null
+++ b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.cpp
@@ -0,0 +1,328 @@
+/*
+ * 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.
+ */
+
+#include "ActiveMQDestinationSource.h"
+
+#include <cms/DestinationListener.h>
+#include <cms/MessageListener.h>
+#include <cms/Session.h>
+#include <cms/Message.h>
+#include <cms/MessageConsumer.h>
+
+#include <decaf/lang/Pointer.h>
+#include <decaf/lang/exceptions/NullPointerException.h>
+#include <decaf/util/HashSet.h>
+#include <decaf/util/concurrent/Mutex.h>
+#include <decaf/util/concurrent/atomic/AtomicBoolean.h>
+
+#include <activemq/core/ActiveMQConnection.h>
+#include <activemq/core/ActiveMQDestinationEvent.h>
+#include <activemq/util/AdvisorySupport.h>
+#include <activemq/commands/ActiveMQDestination.h>
+#include <activemq/commands/ActiveMQQueue.h>
+#include <activemq/commands/ActiveMQTopic.h>
+#include <activemq/commands/ActiveMQTempTopic.h>
+#include <activemq/commands/ActiveMQTempQueue.h>
+#include <activemq/commands/DestinationInfo.h>
+
+using namespace cms;
+using namespace activemq;
+using namespace activemq::util;
+using namespace activemq::core;
+using namespace activemq::commands;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+using namespace decaf::util;
+using namespace decaf::util::concurrent;
+using namespace decaf::util::concurrent::atomic;
+
+////////////////////////////////////////////////////////////////////////////////
+namespace activemq {
+namespace core {
+
+ class DestinationSourceImpl : public cms::MessageListener {
+ private:
+
+ DestinationSourceImpl(const DestinationSourceImpl&);
+ DestinationSourceImpl& operator= (const DestinationSourceImpl&);
+
+ public:
+
+ AtomicBoolean started;
+ ActiveMQConnection* connection;
+ Pointer<Session> session;
+
+ Pointer<MessageConsumer> topicConsumer;
+ Pointer<MessageConsumer> queueConsumer;
+ Pointer<MessageConsumer> tempTopicConsumer;
+ Pointer<MessageConsumer> tempQueueConsumer;
+
+ HashSet< Pointer<ActiveMQDestination> > queues;
+ HashSet< Pointer<ActiveMQDestination> > topics;
+ HashSet< Pointer<ActiveMQDestination> > tempQueues;
+ HashSet< Pointer<ActiveMQDestination> > tempTopics;
+
+ DestinationListener* listener;
+ Mutex listenerLock;
+
+ public:
+
+ DestinationSourceImpl() : started(false),
+ connection(),
+ session(),
+ topicConsumer(),
+ queueConsumer(),
+ tempTopicConsumer(),
+ tempQueueConsumer(),
+ listener(),
+ listenerLock() {
+
+ }
+
+ virtual ~DestinationSourceImpl() {
+ try {
+ stop();
+ }
+ DECAF_CATCHALL_NOTHROW()
+ }
+
+ void start() {
+ if (started.compareAndSet(false, true)) {
+ session.reset(connection->createSession(Session::AUTO_ACKNOWLEDGE));
+
+ Pointer<ActiveMQDestination> queueAdvisories(AdvisorySupport::getQueueAdvisoryTopic());
+ Pointer<ActiveMQDestination> topicAdvisories(AdvisorySupport::getTopicAdvisoryTopic());
+ Pointer<ActiveMQDestination> tempQueueAdvisories(AdvisorySupport::getTempQueueAdvisoryTopic());
+ Pointer<ActiveMQDestination> tempTopicAdvisories(AdvisorySupport::getTempTopicAdvisoryTopic());
+
+ queueConsumer.reset(session->createConsumer(queueAdvisories->getCMSDestination()));
+ queueConsumer->setMessageListener(this);
+
+ topicConsumer.reset(session->createConsumer(topicAdvisories->getCMSDestination()));
+ topicConsumer->setMessageListener(this);
+
+ tempQueueConsumer.reset(session->createConsumer(tempQueueAdvisories->getCMSDestination()));
+ tempQueueConsumer->setMessageListener(this);
+
+ tempTopicConsumer.reset(session->createConsumer(tempTopicAdvisories->getCMSDestination()));
+ tempTopicConsumer->setMessageListener(this);
+ }
+ }
+
+ void stop() {
+ if (started.compareAndSet(true, false)) {
+ if (session != NULL) {
+ session->close();
+
+ queueConsumer.reset(NULL);
+ topicConsumer.reset(NULL);
+ tempQueueConsumer.reset(NULL);
+ tempTopicConsumer.reset(NULL);
+
+ session.reset(NULL);
+ }
+ }
+ }
+
+ virtual void onMessage(const cms::Message* message) {
+
+ if (!this->started.get()) {
+ return;
+ }
+
+ const commands::Message* amqMessage = dynamic_cast<const commands::Message*>(message);
+ if (amqMessage != NULL) {
+ Pointer<DataStructure> payload = amqMessage->getDataStructure();
+ try {
+ Pointer<DestinationInfo> destinationInfo = payload.dynamicCast<DestinationInfo>();
+ ActiveMQDestinationEvent event(destinationInfo);
+ handleDestinationEvent(event);
+ } catch(ClassCastException& ex) {
+ }
+ }
+ }
+
+ void handleDestinationEvent(ActiveMQDestinationEvent& event) {
+
+ Pointer<ActiveMQDestination> dest = event.getDestinationInfo()->getDestination();
+
+ if (dest->isTopic()) {
+ if (dest->isTemporary()) {
+ synchronized(&tempTopics) {
+ if (event.isAddOperation()) {
+ tempTopics.add(dest);
+ } else {
+ tempTopics.remove(dest);
+ }
+ }
+ } else {
+ synchronized(&topics) {
+ if (event.isAddOperation()) {
+ topics.add(dest);
+ } else {
+ topics.remove(dest);
+ }
+ }
+ }
+ } else {
+ if (dest->isTemporary()) {
+ synchronized(&tempQueues) {
+ if (event.isAddOperation()) {
+ tempQueues.add(dest);
+ } else {
+ tempQueues.remove(dest);
+ }
+ }
+ } else {
+ synchronized(&queues) {
+ if (event.isAddOperation()) {
+ queues.add(dest);
+ } else {
+ queues.remove(dest);
+ }
+ }
+ }
+ }
+
+ synchronized(&listenerLock) {
+ if (listener != NULL) {
+ listener->onDestinationEvent(&event);
+ }
+ }
+ }
+
+ std::vector<cms::Queue*> getQueues() {
+
+ std::vector<cms::Queue*> result;
+
+ synchronized(&queues) {
+ Pointer< Iterator<Pointer<ActiveMQDestination> > > iter(queues.iterator());
+ while (iter->hasNext()) {
+ cms::Destination* copy = iter->next()->getCMSDestination()->clone();
+ result.push_back(dynamic_cast<cms::Queue*>(copy));
+ }
+ }
+
+ return result;
+ }
+
+ std::vector<cms::Topic*> getTopics() {
+ std::vector<cms::Topic*> result;
+
+ synchronized(&topics) {
+ Pointer< Iterator<Pointer<ActiveMQDestination> > > iter(topics.iterator());
+ while (iter->hasNext()) {
+ cms::Destination* copy = iter->next()->getCMSDestination()->clone();
+ result.push_back(dynamic_cast<cms::Topic*>(copy));
+ }
+ }
+
+ return result;
+ }
+
+ std::vector<cms::TemporaryQueue*> getTemporaryQueues() {
+ std::vector<cms::TemporaryQueue*> result;
+
+ synchronized(&tempQueues) {
+ Pointer< Iterator<Pointer<ActiveMQDestination> > > iter(tempQueues.iterator());
+ while (iter->hasNext()) {
+ cms::Destination* copy = iter->next()->getCMSDestination()->clone();
+ result.push_back(dynamic_cast<cms::TemporaryQueue*>(copy));
+ }
+ }
+
+ return result;
+ }
+
+ std::vector<cms::TemporaryTopic*> getTemporaryTopics() {
+ std::vector<cms::TemporaryTopic*> result;
+
+ synchronized(&tempTopics) {
+ Pointer< Iterator<Pointer<ActiveMQDestination> > > iter(tempTopics.iterator());
+ while (iter->hasNext()) {
+ cms::Destination* copy = iter->next()->getCMSDestination()->clone();
+ result.push_back(dynamic_cast<cms::TemporaryTopic*>(copy));
+ }
+ }
+
+ return result;
+ }
+ };
+
+}}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQDestinationSource::ActiveMQDestinationSource(ActiveMQConnection* connection) :
+ DestinationSource(), impl(new DestinationSourceImpl()) {
+
+ if (connection == NULL) {
+ throw NullPointerException(__FILE__, __LINE__, "Connection passed was NULL");
+ }
+
+ this->impl->connection = connection;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQDestinationSource::~ActiveMQDestinationSource() {
+ try {
+ delete this->impl;
+ }
+ DECAF_CATCHALL_NOTHROW()
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQDestinationSource::setListener(cms::DestinationListener* listener) {
+ synchronized(&this->impl->listenerLock) {
+ this->impl->listener = listener;
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+cms::DestinationListener* ActiveMQDestinationSource::getListener() const {
+ return this->impl->listener;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQDestinationSource::start() {
+ this->impl->start();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQDestinationSource::stop() {
+ this->impl->stop();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<cms::Queue*> ActiveMQDestinationSource::getQueues() const {
+ return this->impl->getQueues();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<cms::Topic*> ActiveMQDestinationSource::getTopics() const {
+ return this->impl->getTopics();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<cms::TemporaryQueue*> ActiveMQDestinationSource::getTemporaryQueues() const {
+ return this->impl->getTemporaryQueues();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::vector<cms::TemporaryTopic*> ActiveMQDestinationSource::getTemporaryTopics() const {
+ return this->impl->getTemporaryTopics();
+}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.h b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.h
new file mode 100644
index 0000000..c508705
--- /dev/null
+++ b/activemq-cpp/src/main/activemq/core/ActiveMQDestinationSource.h
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+#ifndef _ACTIVEMQ_CORE_ACTIVEMQDESTINATIONSOURCE_H_
+#define _ACTIVEMQ_CORE_ACTIVEMQDESTINATIONSOURCE_H_
+
+#include <cms/DestinationSource.h>
+
+#include <activemq/util/Config.h>
+
+namespace activemq {
+namespace core {
+
+ class DestinationSourceImpl;
+ class ActiveMQConnection;
+
+ class AMQCPP_API ActiveMQDestinationSource : public cms::DestinationSource {
+ private:
+
+ ActiveMQDestinationSource(ActiveMQDestinationSource&);
+ ActiveMQDestinationSource& operator= (const ActiveMQDestinationSource&);
+
+ private:
+
+ DestinationSourceImpl* impl;
+
+ public:
+
+ ActiveMQDestinationSource(ActiveMQConnection* connection);
+
+ virtual ~ActiveMQDestinationSource();
+
+ public:
+
+ virtual void start();
+
+ virtual void stop();
+
+ virtual void setListener(cms::DestinationListener* listener);
+
+ virtual cms::DestinationListener* getListener() const;
+
+ virtual std::vector<cms::Queue*> getQueues() const;
+
+ virtual std::vector<cms::Topic*> getTopics() const;
+
+ virtual std::vector<cms::TemporaryQueue*> getTemporaryQueues() const;
+
+ virtual std::vector<cms::TemporaryTopic*> getTemporaryTopics() const;
+
+ };
+
+}}
+
+#endif /* _ACTIVEMQ_CORE_ACTIVEMQDESTINATIONSOURCE_H_ */
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/DestinationEvent.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/DestinationEvent.cpp b/activemq-cpp/src/main/cms/DestinationEvent.cpp
new file mode 100644
index 0000000..b3fb25e
--- /dev/null
+++ b/activemq-cpp/src/main/cms/DestinationEvent.cpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+#include "DestinationEvent.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+DestinationEvent::~DestinationEvent() {
+}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/DestinationEvent.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/DestinationEvent.h b/activemq-cpp/src/main/cms/DestinationEvent.h
new file mode 100644
index 0000000..4b272e6
--- /dev/null
+++ b/activemq-cpp/src/main/cms/DestinationEvent.h
@@ -0,0 +1,64 @@
+/*
+ * 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.
+ */
+
+#ifndef _CMS_DESTINATIONEVENT_H_
+#define _CMS_DESTINATIONEVENT_H_
+
+#include <cms/Config.h>
+#include <cms/Destination.h>
+
+namespace cms {
+
+ /**
+ * An event class that is used to wrap information related to Destination add and
+ * remove events from the CMS Provider.
+ *
+ * @since 3.2
+ */
+ class CMS_API DestinationEvent {
+ public:
+
+ virtual ~DestinationEvent();
+
+ /**
+ * Returns the destination that this event is related to, the returned
+ * destination remains the property of this event and should be cloned
+ * if the caller wishes to store it beyond the lifetime of this event
+ * object.
+ *
+ * @returns a cms::Destination instance that this event relates to.
+ */
+ virtual const cms::Destination* getDestination() const = 0;
+
+ /**
+ * Returns true if this events represents the addition of a Destination.
+ *
+ * @returns true if this events represents the addition of a Destination.
+ */
+ virtual bool isAddOperation() const = 0;
+
+ /**
+ * Returns true if this events represents the removal of a Destination.
+ *
+ * @returns true if this events represents the removal of a Destination.
+ */
+ virtual bool isRemoveOperation() const = 0;
+
+ };
+}
+
+#endif /* _CMS_DESTINATIONEVENT_H_ */
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/DestinationListener.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/DestinationListener.cpp b/activemq-cpp/src/main/cms/DestinationListener.cpp
new file mode 100644
index 0000000..ec9872a
--- /dev/null
+++ b/activemq-cpp/src/main/cms/DestinationListener.cpp
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+#include "DestinationListener.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+DestinationListener::~DestinationListener() {
+}
+
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/DestinationListener.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/DestinationListener.h b/activemq-cpp/src/main/cms/DestinationListener.h
new file mode 100644
index 0000000..a3cf236
--- /dev/null
+++ b/activemq-cpp/src/main/cms/DestinationListener.h
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+#ifndef _CMS_DESTINATIONLISTENER_H_
+#define _CMS_DESTINATIONLISTENER_H_
+
+#include <cms/Config.h>
+#include <cms/DestinationEvent.h>
+
+namespace cms {
+
+ /**
+ * A listener class that the client can implement to receive events related
+ * to Destination addition or removal on the CMS Provider.
+ *
+ * @since 3.2
+ */
+ class CMS_API DestinationListener {
+ public:
+
+ virtual ~DestinationListener();
+
+ /**
+ * Event call-back method that provides a pointer to an Event object which
+ * contains information on destination add / remove activity on the CMS Provider.
+ *
+ * The passed object remains the property of the caller and should never be
+ * deleted by the event listener implementation.
+ *
+ * @param event
+ * The destination event that triggers this call-back.
+ */
+ virtual void onDestinationEvent(cms::DestinationEvent* event) = 0;
+
+ };
+
+}
+
+#endif /* _CMS_DESTINATIONLISTENER_H_ */
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/DestinationSource.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/DestinationSource.cpp b/activemq-cpp/src/main/cms/DestinationSource.cpp
new file mode 100644
index 0000000..81d4326
--- /dev/null
+++ b/activemq-cpp/src/main/cms/DestinationSource.cpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+#include "DestinationSource.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+DestinationSource::~DestinationSource() {
+}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/DestinationSource.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/DestinationSource.h b/activemq-cpp/src/main/cms/DestinationSource.h
new file mode 100644
index 0000000..d27b8e7
--- /dev/null
+++ b/activemq-cpp/src/main/cms/DestinationSource.h
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+
+#ifndef _CMS_DESTINATIONSOURCE_H_
+#define _CMS_DESTINATIONSOURCE_H_
+
+#include <cms/Config.h>
+#include <cms/DestinationListener.h>
+#include <cms/Topic.h>
+#include <cms/Queue.h>
+#include <cms/TemporaryQueue.h>
+#include <cms/TemporaryTopic.h>
+#include <cms/Startable.h>
+#include <cms/Stoppable.h>
+
+namespace cms {
+
+ /**
+ * Provides an object that will provide a snapshot view of Destinations that exist
+ * on the Message provider.
+ *
+ * @since 3.2
+ */
+ class CMS_API DestinationSource : public cms::Startable, public cms::Stoppable {
+ public:
+
+ virtual ~DestinationSource();
+
+ /**
+ * Sets the current listener of Destination events.
+ *
+ * This class does not manage the lifetime of the configured listener, the client
+ * must ensure that it deletes the listener instance at the appropriate time.
+ *
+ * @param listener
+ * The new listener to provide destination events to.
+ */
+ virtual void setListener(cms::DestinationListener* listener) = 0;
+
+ /**
+ * Gets the currently configured DestiantionListener for this event source.
+ *
+ * The event source instance remains active in this DestinationSource until
+ * it is removed via a call to setListener(null) and should not be deleted
+ * until the client is sure it will not receive any future events.
+ *
+ * @returns the configured DestinationListener for this event source or null if none.
+ */
+ virtual cms::DestinationListener* getListener() const = 0;
+
+ /**
+ * Returns a snapshot of the currently known Queues that are active on the CMS
+ * provider, this state can change at any time as Destinations are added and deleted
+ * from the provider.
+ *
+ * The destinations are cloned and placed into the returned vector, the caller is
+ * responsible for deleting these cloned objects.
+ *
+ * @returns an STL vector containing the current list of known Queues.
+ */
+ virtual std::vector<cms::Queue*> getQueues() const = 0;
+
+ /**
+ * Returns a snapshot of the currently known Queues that are active on the CMS
+ * provider, this state can change at any time as Destinations are added and deleted
+ * from the provider.
+ *
+ * The destinations are cloned and placed into the returned vector, the caller is
+ * responsible for deleting these cloned objects.
+ *
+ * @returns an STL vector containing the current list of known Queues.
+ */
+ virtual std::vector<cms::Topic*> getTopics() const = 0;
+
+ /**
+ * Returns a snapshot of the currently known Queues that are active on the CMS
+ * provider, this state can change at any time as Destinations are added and deleted
+ * from the provider.
+ *
+ * The destinations are cloned and placed into the returned vector, the caller is
+ * responsible for deleting these cloned objects.
+ *
+ * @returns an STL vector containing the current list of known Queues.
+ */
+ virtual std::vector<cms::TemporaryQueue*> getTemporaryQueues() const = 0;
+
+ /**
+ * Returns a snapshot of the currently known Queues that are active on the CMS
+ * provider, this state can change at any time as Destinations are added and deleted
+ * from the provider.
+ *
+ * The destinations are cloned and placed into the returned vector, the caller is
+ * responsible for deleting these cloned objects.
+ *
+ * @returns an STL vector containing the current list of known Queues.
+ */
+ virtual std::vector<cms::TemporaryTopic*> getTemporaryTopics() const = 0;
+
+ };
+
+}
+
+#endif /* _CMS_DESTINATIONSOURCE_H_ */
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/EnhancedConnection.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/EnhancedConnection.cpp b/activemq-cpp/src/main/cms/EnhancedConnection.cpp
new file mode 100644
index 0000000..1c4f4b6
--- /dev/null
+++ b/activemq-cpp/src/main/cms/EnhancedConnection.cpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+
+#include "EnhancedConnection.h"
+
+using namespace cms;
+
+////////////////////////////////////////////////////////////////////////////////
+EnhancedConnection::~EnhancedConnection() {
+}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/main/cms/EnhancedConnection.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/cms/EnhancedConnection.h b/activemq-cpp/src/main/cms/EnhancedConnection.h
new file mode 100644
index 0000000..52a060b
--- /dev/null
+++ b/activemq-cpp/src/main/cms/EnhancedConnection.h
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+#ifndef _CMS_ENHANCEDCONNECTION_H_
+#define _CMS_ENHANCEDCONNECTION_H_
+
+#include <cms/Config.h>
+#include <cms/Connection.h>
+#include <cms/DestinationSource.h>
+
+namespace cms {
+
+ /**
+ * An enhanced CMS Connection instance that provides additional features above the
+ * default required features of a CMS Connection instance.
+ *
+ * @since 3.2
+ */
+ class CMS_API EnhancedConnection : public virtual cms::Connection {
+ public:
+
+ virtual ~EnhancedConnection();
+
+ /**
+ * Returns the DestinationSource} object which can be used to listen to destinations
+ * being created or destroyed or to enquire about the current destinations available
+ * on the message Provider.
+ *
+ * @return a new instance of a DestinationSource that is owned by the caller.
+ *
+ * @throws CMSException if an error occurs while creating the destination source.
+ */
+ virtual cms::DestinationSource* getDestinationSource() = 0;
+
+ };
+
+}
+
+#endif /* _CMS_ENHANCEDCONNECTION_H_ */
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/test-integration/Makefile.am
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test-integration/Makefile.am b/activemq-cpp/src/test-integration/Makefile.am
index 9a2ab20..a6ebf0d 100644
--- a/activemq-cpp/src/test-integration/Makefile.am
+++ b/activemq-cpp/src/test-integration/Makefile.am
@@ -41,6 +41,7 @@ cc_sources = \
activemq/test/openwire/OpenwireCmsConnectionStartStopTest.cpp \
activemq/test/openwire/OpenwireCmsTemplateTest.cpp \
activemq/test/openwire/OpenwireDurableTest.cpp \
+ activemq/test/openwire/OpenwireEnhancedConnectionTest.cpp \
activemq/test/openwire/OpenwireExpirationTest.cpp \
activemq/test/openwire/OpenwireIndividualAckTest.cpp \
activemq/test/openwire/OpenwireJmsMessageGroupsTest.cpp \
@@ -102,6 +103,7 @@ h_sources = \
activemq/test/openwire/OpenwireCmsConnectionStartStopTest.h \
activemq/test/openwire/OpenwireCmsTemplateTest.h \
activemq/test/openwire/OpenwireDurableTest.h \
+ activemq/test/openwire/OpenwireEnhancedConnectionTest.h \
activemq/test/openwire/OpenwireExpirationTest.h \
activemq/test/openwire/OpenwireIndividualAckTest.h \
activemq/test/openwire/OpenwireJmsMessageGroupsTest.h \
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/test-integration/TestRegistry.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test-integration/TestRegistry.cpp b/activemq-cpp/src/test-integration/TestRegistry.cpp
index 2541693..e117bda 100644
--- a/activemq-cpp/src/test-integration/TestRegistry.cpp
+++ b/activemq-cpp/src/test-integration/TestRegistry.cpp
@@ -23,6 +23,7 @@
#include "activemq/test/openwire/OpenwireCmsTemplateTest.h"
#include "activemq/test/openwire/OpenwireDurableTest.h"
#include "activemq/test/openwire/OpenwireExpirationTest.h"
+#include "activemq/test/openwire/OpenwireEnhancedConnectionTest.h"
#include "activemq/test/openwire/OpenwireIndividualAckTest.h"
#include "activemq/test/openwire/OpenwireJmsMessageGroupsTest.h"
#include "activemq/test/openwire/OpenwireJmsRecoverTest.h"
@@ -52,30 +53,31 @@
#include "activemq/test/stomp/StompJmsMessageGroupsTest.h"
// Openwire Tests
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireAdvisorysTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireAsyncSenderTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireClientAckTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireCmsConnectionStartStopTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenWireCmsSendWithAsyncCallbackTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireCmsTemplateTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireDurableTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireExpirationTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireIndividualAckTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireJmsMessageGroupsTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireJmsRecoverTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireMessageCompressionTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireMessagePriorityTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireMapMessageTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireNonBlockingRedeliveryTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireOptimizedAckTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireQueueBrowserTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSimpleRollbackTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSimpleTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireTransactionTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSlowListenerTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireTempDestinationTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireVirtualTopicTest );
-CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireXATransactionsTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireAdvisorysTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireAsyncSenderTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireClientAckTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireCmsConnectionStartStopTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenWireCmsSendWithAsyncCallbackTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireCmsTemplateTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireDurableTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireExpirationTest );
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireEnhancedConnectionTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireIndividualAckTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireJmsMessageGroupsTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireJmsRecoverTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireMessageCompressionTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireMessagePriorityTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireMapMessageTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireNonBlockingRedeliveryTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireOptimizedAckTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireQueueBrowserTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSimpleRollbackTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSimpleTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireTransactionTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireSlowListenerTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireTempDestinationTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireVirtualTopicTest );
+//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::openwire::OpenwireXATransactionsTest );
// Stomp Tests
//CPPUNIT_TEST_SUITE_REGISTRATION( activemq::test::stomp::StompAsyncSenderTest );
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.cpp b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.cpp
new file mode 100644
index 0000000..d099de5
--- /dev/null
+++ b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.cpp
@@ -0,0 +1,264 @@
+/*
+ * 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.
+ */
+
+#include "OpenwireEnhancedConnectionTest.h"
+
+#include <activemq/core/ActiveMQConnectionFactory.h>
+#include <activemq/core/ActiveMQConnection.h>
+#include <activemq/core/ActiveMQSession.h>
+#include <activemq/exceptions/ActiveMQException.h>
+
+#include <decaf/lang/Pointer.h>
+#include <decaf/lang/Thread.h>
+#include <decaf/lang/Thread.h>
+#include <decaf/util/UUID.h>
+#include <decaf/util/concurrent/TimeUnit.h>
+
+#include <cms/ConnectionFactory.h>
+#include <cms/Connection.h>
+#include <cms/Session.h>
+#include <cms/ConnectionFactory.h>
+#include <cms/Connection.h>
+#include <cms/DestinationListener.h>
+#include <cms/DestinationSource.h>
+#include <cms/EnhancedConnection.h>
+
+#include <memory>
+
+using namespace cms;
+using namespace std;
+using namespace decaf;
+using namespace decaf::lang;
+using namespace decaf::lang::exceptions;
+using namespace decaf::util;
+using namespace decaf::util::concurrent;
+using namespace activemq;
+using namespace activemq::core;
+using namespace activemq::commands;
+using namespace activemq::exceptions;
+using namespace activemq::test;
+using namespace activemq::test::openwire;
+
+////////////////////////////////////////////////////////////////////////////////
+OpenwireEnhancedConnectionTest::OpenwireEnhancedConnectionTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+OpenwireEnhancedConnectionTest::~OpenwireEnhancedConnectionTest() {
+}
+
+////////////////////////////////////////////////////////////////////////////////
+namespace {
+
+ class TestDestinationListener : public DestinationListener {
+ public:
+
+ int queueCount;
+ int topicCount;
+ int tempQueueCount;
+ int tempTopicCount;
+
+ TestDestinationListener() : DestinationListener(),
+ queueCount(0),
+ topicCount(0),
+ tempQueueCount(0),
+ tempTopicCount(0) {
+ }
+
+ virtual void onDestinationEvent(cms::DestinationEvent* event) {
+
+ cms::Destination::DestinationType type = event->getDestination()->getDestinationType();
+ switch (type) {
+ case cms::Destination::QUEUE:
+ if (event->isAddOperation()) {
+ queueCount++;
+ } else {
+ queueCount--;
+ }
+ break;
+ case cms::Destination::TOPIC:
+ if (event->isAddOperation()) {
+ topicCount++;
+ } else {
+ topicCount--;
+ }
+ break;
+ case cms::Destination::TEMPORARY_QUEUE:
+ if (event->isAddOperation()) {
+ tempQueueCount++;
+ } else {
+ tempQueueCount--;
+ }
+ break;
+ case cms::Destination::TEMPORARY_TOPIC:
+ if (event->isAddOperation()) {
+ tempTopicCount++;
+ } else {
+ tempTopicCount--;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ void reset() {
+ queueCount = 0;
+ topicCount = 0;
+ tempQueueCount = 0;
+ tempTopicCount = 0;
+ }
+ };
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void OpenwireEnhancedConnectionTest::testDestinationSourceGetters() {
+
+ TestDestinationListener listener;
+
+ std::auto_ptr<ConnectionFactory> factory(
+ ConnectionFactory::createCMSConnectionFactory( getBrokerURL() ) );
+ CPPUNIT_ASSERT( factory.get() != NULL );
+
+ std::auto_ptr<Connection> connection( factory->createConnection() );
+ CPPUNIT_ASSERT( connection.get() != NULL );
+
+ std::auto_ptr<Session> session( connection->createSession() );
+ CPPUNIT_ASSERT( session.get() != NULL );
+
+ ActiveMQConnection* amq = dynamic_cast<ActiveMQConnection*>(connection.get());
+ CPPUNIT_ASSERT(amq != NULL);
+
+ cms::EnhancedConnection* enhanced = dynamic_cast<cms::EnhancedConnection*>(connection.get());
+ CPPUNIT_ASSERT(enhanced != NULL);
+
+ std::auto_ptr<cms::DestinationSource> source(enhanced->getDestinationSource());
+ CPPUNIT_ASSERT(source.get() != NULL);
+
+ source->setListener(&listener);
+
+ connection->start();
+ source->start();
+
+ std::auto_ptr<Destination> destination1( session->createTopic("Test.Topic") );
+ std::auto_ptr<MessageConsumer> consumer1( session->createConsumer( destination1.get() ) );
+ std::auto_ptr<Destination> destination2( session->createQueue("Test.Queue") );
+ std::auto_ptr<MessageConsumer> consumer2( session->createConsumer( destination2.get() ) );
+
+ consumer1->close();
+ consumer2->close();
+
+ std::auto_ptr<Destination> destination3( session->createTemporaryQueue() );
+ std::auto_ptr<Destination> destination4( session->createTemporaryTopic() );
+
+ Thread::sleep(1500);
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be one Queue", 1, listener.queueCount);
+ CPPUNIT_ASSERT_MESSAGE("Should be at least Topic", listener.topicCount >= 1);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be one temp Queue", 1, listener.tempQueueCount);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be one temp Topic", 1, listener.tempTopicCount);
+
+ amq->destroyDestination(destination1.get());
+ amq->destroyDestination(destination2.get());
+
+ Thread::sleep(1500);
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be no Queues", 0, listener.queueCount);
+
+ source->stop();
+
+ std::auto_ptr<Destination> destination5( session->createTemporaryQueue() );
+ std::auto_ptr<Destination> destination6( session->createTemporaryTopic() );
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be one temp Queue", 1, listener.tempQueueCount);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be one temp Topic", 1, listener.tempTopicCount);
+
+ listener.reset();
+ source->start();
+
+ std::auto_ptr<Destination> destination7( session->createTemporaryQueue() );
+ std::auto_ptr<Destination> destination8( session->createTemporaryTopic() );
+
+ Thread::sleep(1500);
+
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be two temp Queues", 3, listener.tempQueueCount);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be two temp Topics", 3, listener.tempTopicCount);
+
+ source->stop();
+ connection->close();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void OpenwireEnhancedConnectionTest::testDestinationSource() {
+
+ TestDestinationListener listener;
+
+ std::auto_ptr<ConnectionFactory> factory(
+ ConnectionFactory::createCMSConnectionFactory( getBrokerURL() ) );
+ CPPUNIT_ASSERT( factory.get() != NULL );
+
+ std::auto_ptr<Connection> connection( factory->createConnection() );
+ CPPUNIT_ASSERT( connection.get() != NULL );
+
+ std::auto_ptr<Session> session( connection->createSession() );
+ CPPUNIT_ASSERT( session.get() != NULL );
+
+ ActiveMQConnection* amq = dynamic_cast<ActiveMQConnection*>(connection.get());
+ CPPUNIT_ASSERT(amq != NULL);
+
+ cms::EnhancedConnection* enhanced = dynamic_cast<cms::EnhancedConnection*>(connection.get());
+ CPPUNIT_ASSERT(enhanced != NULL);
+
+ std::auto_ptr<cms::DestinationSource> source(enhanced->getDestinationSource());
+ CPPUNIT_ASSERT(source.get() != NULL);
+
+ source->setListener(&listener);
+
+ connection->start();
+ source->start();
+
+ TimeUnit::SECONDS.sleep(1);
+
+ CPPUNIT_ASSERT_EQUAL(0, (int)source->getQueues().size());
+ CPPUNIT_ASSERT_EQUAL(0, (int)source->getTopics().size());
+ CPPUNIT_ASSERT_EQUAL(0, (int)source->getTemporaryQueues().size());
+ CPPUNIT_ASSERT_EQUAL(0, (int)source->getTemporaryTopics().size());
+
+ std::auto_ptr<Destination> destination1(session->createTemporaryQueue());
+ std::auto_ptr<Destination> destination2(session->createTemporaryTopic());
+ std::auto_ptr<Destination> destination3(session->createTemporaryQueue());
+ std::auto_ptr<Destination> destination4(session->createTemporaryTopic());
+ std::auto_ptr<Destination> destination5(session->createTemporaryQueue());
+ std::auto_ptr<Destination> destination6(session->createTemporaryTopic());
+
+ TimeUnit::SECONDS.sleep(2);
+
+ std::vector<cms::TemporaryQueue*> tempQueues = source->getTemporaryQueues();
+ std::vector<cms::TemporaryTopic*> tempTopics = source->getTemporaryTopics();
+
+ CPPUNIT_ASSERT_EQUAL(3, (int)tempQueues.size());
+ CPPUNIT_ASSERT_EQUAL(3, (int)tempTopics.size());
+
+ for (int i = 0; i < 3; ++i) {
+ delete tempQueues[i];
+ delete tempTopics[i];
+ }
+
+ source->stop();
+ connection->close();
+}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/a849f3b6/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.h b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.h
new file mode 100644
index 0000000..26f029c
--- /dev/null
+++ b/activemq-cpp/src/test-integration/activemq/test/openwire/OpenwireEnhancedConnectionTest.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.
+ */
+
+#ifndef _ACTIVEMQ_TEST_OPENWIRE_OPENWIREENHANCEDCONNECTIONTEST_H_
+#define _ACTIVEMQ_TEST_OPENWIRE_OPENWIREENHANCEDCONNECTIONTEST_H_
+
+#include <cppunit/TestFixture.h>
+#include <cppunit/extensions/HelperMacros.h>
+
+#include <activemq/util/IntegrationCommon.h>
+
+namespace activemq {
+namespace test {
+namespace openwire {
+
+ class OpenwireEnhancedConnectionTest : public CppUnit::TestFixture {
+
+ CPPUNIT_TEST_SUITE( OpenwireEnhancedConnectionTest );
+ CPPUNIT_TEST( testDestinationSource );
+ CPPUNIT_TEST( testDestinationSourceGetters );
+ CPPUNIT_TEST_SUITE_END();
+
+ public:
+
+ OpenwireEnhancedConnectionTest();
+ virtual ~OpenwireEnhancedConnectionTest();
+
+ virtual std::string getBrokerURL() const {
+ return activemq::util::IntegrationCommon::getInstance().getOpenwireURL();
+ }
+
+ virtual void setUp() {}
+ virtual void tearDown() {}
+
+ void testDestinationSource();
+ void testDestinationSourceGetters();
+
+ };
+
+}}}
+
+#endif /* _ACTIVEMQ_TEST_OPENWIRE_OPENWIREENHANCEDCONNECTIONTEST_H_ */