activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1197293 - /activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp
Date Thu, 03 Nov 2011 19:53:08 GMT
Author: tabish
Date: Thu Nov  3 19:53:08 2011
New Revision: 1197293

URL: http://svn.apache.org/viewvc?rev=1197293&view=rev
Log:
https://issues.apache.org/jira/browse/AMQCPP-383

Implements the recover method, not tested yet.

Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/core/ActiveMQSession.cpp

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=1197293&r1=1197292&r2=1197293&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
Nov  3 19:53:08 2011
@@ -412,9 +412,20 @@ void ActiveMQSession::recover() {
 
     try{
 
-        throw UnsupportedOperationException(
-            __FILE__, __LINE__,
-            "Recover Method is not yet supported." );
+        checkClosed();
+
+        if (isTransacted()) {
+            throw cms::IllegalStateException("This session is transacted");
+        }
+
+        synchronized( &this->consumers ) {
+            std::vector< ActiveMQConsumer* > consumers = this->consumers.values();
+
+            std::vector< ActiveMQConsumer* >::iterator iter = consumers.begin();
+            for( ; iter != consumers.end(); ++iter ) {
+                (*iter)->rollback();
+            }
+        }
     }
     AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
 }



Mime
View raw message