activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r951042 - in /activemq/activemq-cpp/trunk/activemq-cpp/src: main/activemq/core/ActiveMQConnection.cpp main/activemq/core/ActiveMQConnection.h main/activemq/core/ActiveMQSession.cpp test/testRegistry.cpp
Date Thu, 03 Jun 2010 15:51:18 GMT
Author: tabish
Date: Thu Jun  3 15:51:18 2010
New Revision: 951042

URL: http://svn.apache.org/viewvc?rev=951042&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-293

Update session to use the dispatchAsync setting in the Connection when it creates the Consumers.
 Move the Mutex object in ActiveMQConnection.h into the d-pointer class in ActiveMQConnection.cpp
since its not needed in the header.

Updated test registry with new IdGenerator tests.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp?rev=951042&r1=951041&r2=951042&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
(original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.cpp
Thu Jun  3 15:51:18 2010
@@ -96,7 +96,9 @@ namespace core{
         bool clientIDSet;
         bool isConnectionInfoSentToBroker;
         bool userSpecifiedClientID;
+
         decaf::util::concurrent::Mutex ensureConnectionInfoSentMutex;
+        decaf::util::concurrent::Mutex mutex;
 
         bool dispatchAsync;
         bool alwaysSyncSend;
@@ -891,7 +893,7 @@ void ActiveMQConnection::waitForTranspor
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQConnection::setTransportInterruptionProcessingComplete() {
 
-    synchronized( &mutex ) {
+    synchronized( &( this->config->mutex ) ) {
 
         if( this->config->transportInterruptionProcessingComplete != NULL ) {
             this->config->transportInterruptionProcessingComplete->countDown();
@@ -908,7 +910,7 @@ void ActiveMQConnection::signalInterrupt
     throw( decaf::lang::exceptions::InterruptedException ) {
 
     if( this->config->transportInterruptionProcessingComplete->await( 0, TimeUnit::SECONDS
) ) {
-        synchronized( &mutex ) {
+        synchronized( &( this->config->mutex ) ) {
 
             this->config->transportInterruptionProcessingComplete.reset( NULL );
             FailoverTransport* failoverTransport =

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h?rev=951042&r1=951041&r2=951042&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQConnection.h Thu
Jun  3 15:51:18 2010
@@ -73,11 +73,6 @@ namespace core{
         ConnectionConfig* config;
 
         /**
-         * Sync object.
-         */
-        decaf::util::concurrent::Mutex mutex;
-
-        /**
          * The instance of ConnectionMetaData to return to clients.
          */
         std::auto_ptr<cms::ConnectionMetaData> connectionMetaData;

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp?rev=951042&r1=951041&r2=951042&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp Thu
Jun  3 15:51:18 2010
@@ -321,7 +321,7 @@ cms::MessageConsumer* ActiveMQSession::c
         std::auto_ptr<ActiveMQConsumer> consumer(
             new ActiveMQConsumer( this, this->getNextConsumerId(),
                                   dest, "", selector, 1000, 0, noLocal,
-                                  false, false, NULL ) );
+                                  false, this->connection->isDispatchAsync(), NULL
) );
 
         try{
             this->addConsumer( consumer.get() );
@@ -369,7 +369,7 @@ cms::MessageConsumer* ActiveMQSession::c
         std::auto_ptr<ActiveMQConsumer> consumer(
             new ActiveMQConsumer( this, this->getNextConsumerId(),
                                   dest, name, selector, 1000, 0, noLocal,
-                                  false, false, NULL ) );
+                                  false, this->connection->isDispatchAsync(), NULL
) );
 
         try{
             this->addConsumer( consumer.get() );

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp?rev=951042&r1=951041&r2=951042&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/test/testRegistry.cpp Thu Jun  3 15:51:18
2010
@@ -111,6 +111,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( activem
 #include <activemq/exceptions/ActiveMQExceptionTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::exceptions::ActiveMQExceptionTest );
 
+#include <activemq/util/IdGeneratorTest.h>
+CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::IdGeneratorTest );
 #include <activemq/util/LongSequenceGeneratorTest.h>
 CPPUNIT_TEST_SUITE_REGISTRATION( activemq::util::LongSequenceGeneratorTest );
 #include <activemq/util/PrimitiveValueNodeTest.h>



Mime
View raw message