activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r1399781 [1/3] - in /activemq/activemq-cpp/trunk/activemq-cpp/src/main: ./ activemq/library/ activemq/state/ activemq/threads/ activemq/transport/mock/ activemq/util/ activemq/wireformat/ activemq/wireformat/openwire/marshal/
Date Thu, 18 Oct 2012 18:58:04 GMT
Author: tabish
Date: Thu Oct 18 18:58:02 2012
New Revision: 1399781

URL: http://svn.apache.org/viewvc?rev=1399781&view=rev
Log:
Code cleanup and fix some throw clauses so they preserve exception types, remove unneeded includes from some headers and remove some old throw clauses. 

Added:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.cpp   (with props)
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp   (with props)
Modified:
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/SessionState.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/Tracked.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Scheduler.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/SchedulerTimerTask.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/mock/InternalCommandListener.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/transport/mock/MockTransport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ActiveMQProperties.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ActiveMQProperties.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/CMSExceptionSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/CMSExceptionSupport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/CompositeData.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/CompositeData.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/IdGenerator.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/IdGenerator.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/LongSequenceGenerator.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/LongSequenceGenerator.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/MarshallingSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/MarshallingSupport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/MemoryUsage.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/MemoryUsage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveList.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveList.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveMap.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueConverter.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceStopper.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.cpp
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.h
    activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.h

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/Makefile.am Thu Oct 18 18:58:02 2012
@@ -125,6 +125,8 @@ cc_sources = \
     activemq/io/LoggingInputStream.cpp \
     activemq/io/LoggingOutputStream.cpp \
     activemq/library/ActiveMQCPP.cpp \
+    activemq/state/CommandVisitor.cpp \
+    activemq/state/CommandVisitorAdapter.cpp \
     activemq/state/ConnectionState.cpp \
     activemq/state/ConnectionStateTracker.cpp \
     activemq/state/ConsumerState.cpp \
@@ -132,10 +134,13 @@ cc_sources = \
     activemq/state/SessionState.cpp \
     activemq/state/Tracked.cpp \
     activemq/state/TransactionState.cpp \
+    activemq/threads/CompositeTask.cpp \
     activemq/threads/CompositeTaskRunner.cpp \
     activemq/threads/DedicatedTaskRunner.cpp \
     activemq/threads/Scheduler.cpp \
     activemq/threads/SchedulerTimerTask.cpp \
+    activemq/threads/Task.cpp \
+    activemq/threads/TaskRunner.cpp \
     activemq/transport/AbstractTransportFactory.cpp \
     activemq/transport/CompositeTransport.cpp \
     activemq/transport/DefaultTransportListener.cpp \
@@ -183,12 +188,18 @@ cc_sources = \
     activemq/util/ServiceStopper.cpp \
     activemq/util/ServiceSupport.cpp \
     activemq/util/URISupport.cpp \
+    activemq/util/Usage.cpp \
+    activemq/wireformat/MarshalAware.cpp \
+    activemq/wireformat/WireFormat.cpp \
+    activemq/wireformat/WireFormatFactory.cpp \
+    activemq/wireformat/WireFormatNegotiator.cpp \
     activemq/wireformat/WireFormatRegistry.cpp \
     activemq/wireformat/openwire/OpenWireFormat.cpp \
     activemq/wireformat/openwire/OpenWireFormatFactory.cpp \
     activemq/wireformat/openwire/OpenWireFormatNegotiator.cpp \
     activemq/wireformat/openwire/OpenWireResponseBuilder.cpp \
     activemq/wireformat/openwire/marshal/BaseDataStreamMarshaller.cpp \
+    activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp \
     activemq/wireformat/openwire/marshal/PrimitiveTypesMarshaller.cpp \
     activemq/wireformat/openwire/marshal/generated/ActiveMQBlobMessageMarshaller.cpp \
     activemq/wireformat/openwire/marshal/generated/ActiveMQBytesMessageMarshaller.cpp \

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.cpp Thu Oct 18 18:58:02 2012
@@ -41,10 +41,20 @@ using namespace activemq::transport::fai
 using namespace activemq::wireformat;
 
 ////////////////////////////////////////////////////////////////////////////////
-void ActiveMQCPP::initializeLibrary( int argc, char** argv ) {
+ActiveMQCPP::ActiveMQCPP() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQCPP::~ActiveMQCPP() {
+
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQCPP::initializeLibrary(int argc, char** argv) {
 
     // Initialize the Decaf Library by requesting its runtime.
-    decaf::lang::Runtime::initializeRuntime( argc, argv );
+    decaf::lang::Runtime::initializeRuntime(argc, argv);
 
     // Register all WireFormats
     ActiveMQCPP::registerWireFormats();
@@ -58,7 +68,7 @@ void ActiveMQCPP::initializeLibrary( int
 
 ////////////////////////////////////////////////////////////////////////////////
 void ActiveMQCPP::initializeLibrary() {
-    ActiveMQCPP::initializeLibrary( 0, NULL );
+    ActiveMQCPP::initializeLibrary(0, NULL);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -81,10 +91,8 @@ void ActiveMQCPP::registerWireFormats() 
     // with the WireFormat Registry
     WireFormatRegistry::initialize();
 
-    WireFormatRegistry::getInstance().registerFactory(
-        "openwire", new wireformat::openwire::OpenWireFormatFactory() );
-    WireFormatRegistry::getInstance().registerFactory(
-        "stomp", new wireformat::stomp::StompWireFormatFactory() );
+    WireFormatRegistry::getInstance().registerFactory("openwire", new wireformat::openwire::OpenWireFormatFactory());
+    WireFormatRegistry::getInstance().registerFactory("stomp", new wireformat::stomp::StompWireFormatFactory());
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -94,12 +102,8 @@ void ActiveMQCPP::registerTransports() {
     // with the Transport Registry
     TransportRegistry::initialize();
 
-    TransportRegistry::getInstance().registerFactory(
-        "tcp", new TcpTransportFactory() );
-    TransportRegistry::getInstance().registerFactory(
-        "ssl", new SslTransportFactory() );
-    TransportRegistry::getInstance().registerFactory(
-        "mock", new MockTransportFactory() );
-    TransportRegistry::getInstance().registerFactory(
-        "failover", new FailoverTransportFactory() );
+    TransportRegistry::getInstance().registerFactory("tcp", new TcpTransportFactory());
+    TransportRegistry::getInstance().registerFactory("ssl", new SslTransportFactory());
+    TransportRegistry::getInstance().registerFactory("mock", new MockTransportFactory());
+    TransportRegistry::getInstance().registerFactory("failover", new FailoverTransportFactory());
 }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/library/ActiveMQCPP.h Thu Oct 18 18:58:02 2012
@@ -26,13 +26,13 @@ namespace library {
     class AMQCPP_API ActiveMQCPP {
     protected:
 
-        ActiveMQCPP() {};
-        ActiveMQCPP( const ActiveMQCPP& );
-        ActiveMQCPP& operator= ( const ActiveMQCPP& );
+    ActiveMQCPP();
+    ActiveMQCPP(const ActiveMQCPP&);
+    ActiveMQCPP& operator=(const ActiveMQCPP&);
 
     public:
 
-        virtual ~ActiveMQCPP() {}
+        virtual ~ActiveMQCPP();
 
         /**
          * Initialize the ActiveMQ-CPP Library constructs, this method will
@@ -55,7 +55,7 @@ namespace library {
          *
          * @throws runtime_error if an error occurs while initializing this library.
          */
-        static void initializeLibrary( int argc, char** argv );
+        static void initializeLibrary(int argc, char** argv);
 
         /**
          * Shutdown the ActiveMQ-CPP Library, freeing any resources

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.cpp Thu Oct 18 18:58:02 2012
@@ -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 "CommandVisitor.h"
+
+using namespace activemq;
+using namespace activemq::state;
+
+////////////////////////////////////////////////////////////////////////////////
+CommandVisitor::~CommandVisitor() {}
+

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitor.h Thu Oct 18 18:58:02 2012
@@ -69,8 +69,7 @@ namespace state {
     class AMQCPP_API CommandVisitor {
     public:
 
-        virtual ~CommandVisitor() {
-        }
+        virtual ~CommandVisitor();
 
         virtual decaf::lang::Pointer<commands::Command> processTransactionInfo(commands::TransactionInfo* info) = 0;
 

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,82 @@
+/*
+ * 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 "CommandVisitorAdapter.h"
+
+using namespace activemq;
+using namespace activemq::state;
+using namespace decaf;
+using namespace decaf::lang;
+
+////////////////////////////////////////////////////////////////////////////////
+CommandVisitorAdapter::~CommandVisitorAdapter() {}
+
+////////////////////////////////////////////////////////////////////////////////
+Pointer<commands::Command> CommandVisitorAdapter::processTransactionInfo(commands::TransactionInfo* info) {
+
+    if (info != decaf::lang::Pointer<commands::Command>()) {
+        switch (info->getType()) {
+            case core::ActiveMQConstants::TRANSACTION_STATE_BEGIN:
+                return this->processBeginTransaction(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_COMMITONEPHASE:
+                return this->processCommitTransactionOnePhase(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_COMMITTWOPHASE:
+                return this->processCommitTransactionTwoPhase(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_END:
+                return this->processEndTransaction(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_FORGET:
+                return this->processForgetTransaction(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_PREPARE:
+                return this->processPrepareTransaction(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_RECOVER:
+                return this->processRecoverTransactions(info);
+            case core::ActiveMQConstants::TRANSACTION_STATE_ROLLBACK:
+                return this->processRollbackTransaction(info);
+            default:
+                throw exceptions::ActiveMQException(
+                    __FILE__, __LINE__, "Unknown Transaction Info Type.");
+        }
+    }
+
+    return Pointer<commands::Command>();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+Pointer<commands::Command> CommandVisitorAdapter::processRemoveInfo(commands::RemoveInfo* info) {
+
+    if (info != decaf::lang::Pointer<commands::Command>()) {
+        switch (info->getObjectId()->getDataStructureType()) {
+            case commands::ConnectionId::ID_CONNECTIONID:
+                return this->processRemoveConnection(
+                    dynamic_cast<commands::ConnectionId*> (info->getObjectId().get()));
+            case commands::SessionId::ID_SESSIONID:
+                return this->processRemoveSession(
+                    dynamic_cast<commands::SessionId*> (info->getObjectId().get()));
+            case commands::ConsumerId::ID_CONSUMERID:
+                return this->processRemoveConsumer(
+                    dynamic_cast<commands::ConsumerId*> (info->getObjectId().get()));
+            case commands::ProducerId::ID_PRODUCERID:
+                return this->processRemoveProducer(
+                    dynamic_cast<commands::ProducerId*> (info->getObjectId().get()));
+            default:
+                throw exceptions::ActiveMQException(
+                    __FILE__, __LINE__, "Unknown Remove Info Type.");
+        }
+    }
+
+    return Pointer<commands::Command>();
+}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/CommandVisitorAdapter.h Thu Oct 18 18:58:02 2012
@@ -63,213 +63,163 @@ namespace state {
      *
      * @since 3.0
      */
-    class AMQCPP_API CommandVisitorAdapter: public CommandVisitor {
+    class AMQCPP_API CommandVisitorAdapter : public CommandVisitor {
     public:
 
-        virtual ~CommandVisitorAdapter() {
-        }
-
-        virtual decaf::lang::Pointer<commands::Command> processRemoveConnection(commands::ConnectionId* id AMQCPP_UNUSED ) {
-            return decaf::lang::Pointer<commands::Command>();
-        }
+        virtual ~CommandVisitorAdapter();
 
-        virtual decaf::lang::Pointer<commands::Command> processRemoveSession(commands::SessionId* id AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRemoveConnection(commands::ConnectionId* id AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRemoveProducer(commands::ProducerId* id AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRemoveSession(commands::SessionId* id AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRemoveConsumer(commands::ConsumerId* id AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRemoveProducer(commands::ProducerId* id AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processDestinationInfo(commands::DestinationInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRemoveConsumer(commands::ConsumerId* id AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRemoveDestination(commands::DestinationInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processDestinationInfo(commands::DestinationInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRemoveSubscriptionInfo(commands::RemoveSubscriptionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRemoveDestination(commands::DestinationInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processMessage(commands::Message* send AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRemoveSubscriptionInfo(commands::RemoveSubscriptionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processMessageAck(commands::MessageAck* ack AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processMessage(commands::Message* send AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processMessagePull(commands::MessagePull* pull AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processMessageAck(commands::MessageAck* ack AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processBeginTransaction(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processMessagePull(commands::MessagePull* pull AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processPrepareTransaction(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processBeginTransaction(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processCommitTransactionOnePhase(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processPrepareTransaction(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processCommitTransactionTwoPhase(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processCommitTransactionOnePhase(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRollbackTransaction(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processCommitTransactionTwoPhase(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processWireFormat(commands::WireFormatInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRollbackTransaction(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processKeepAliveInfo(commands::KeepAliveInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processWireFormat(commands::WireFormatInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processShutdownInfo(commands::ShutdownInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processKeepAliveInfo(commands::KeepAliveInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processFlushCommand(commands::FlushCommand* command AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processShutdownInfo(commands::ShutdownInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processBrokerInfo(commands::BrokerInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processFlushCommand(commands::FlushCommand* command AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRecoverTransactions(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processBrokerInfo(commands::BrokerInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processForgetTransaction(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processRecoverTransactions(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processEndTransaction(commands::TransactionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processForgetTransaction(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processMessageDispatchNotification(commands::MessageDispatchNotification* notification AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processEndTransaction(commands::TransactionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processProducerAck(commands::ProducerAck* ack AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processMessageDispatchNotification(commands::MessageDispatchNotification* notification AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processMessageDispatch(commands::MessageDispatch* dispatch AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processProducerAck(commands::ProducerAck* ack AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processControlCommand(commands::ControlCommand* command AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processMessageDispatch(commands::MessageDispatch* dispatch AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processConnectionError(commands::ConnectionError* error AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processControlCommand(commands::ControlCommand* command AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processConnectionControl(commands::ConnectionControl* control AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processConnectionError(commands::ConnectionError* error AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processConsumerControl(commands::ConsumerControl* control AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processConnectionControl(commands::ConnectionControl* control AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processBrokerError(commands::BrokerError* error AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processConsumerControl(commands::ConsumerControl* control AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processReplayCommand(commands::ReplayCommand* replay AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processBrokerError(commands::BrokerError* error AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processResponse(commands::Response* response AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processReplayCommand(commands::ReplayCommand* replay AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processConnectionInfo(commands::ConnectionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processResponse(commands::Response* response AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processSessionInfo(commands::SessionInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processConnectionInfo(commands::ConnectionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processProducerInfo(commands::ProducerInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processSessionInfo(commands::SessionInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processConsumerInfo(commands::ConsumerInfo* info AMQCPP_UNUSED ) {
+        virtual decaf::lang::Pointer<commands::Command> processProducerInfo(commands::ProducerInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processTransactionInfo(commands::TransactionInfo* info) {
-
-            if (info != decaf::lang::Pointer<commands::Command>()) {
-                switch (info->getType()) {
-                    case core::ActiveMQConstants::TRANSACTION_STATE_BEGIN:
-                        return this->processBeginTransaction(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_COMMITONEPHASE:
-                        return this->processCommitTransactionOnePhase(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_COMMITTWOPHASE:
-                        return this->processCommitTransactionTwoPhase(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_END:
-                        return this->processEndTransaction(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_FORGET:
-                        return this->processForgetTransaction(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_PREPARE:
-                        return this->processPrepareTransaction(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_RECOVER:
-                        return this->processRecoverTransactions(info);
-                    case core::ActiveMQConstants::TRANSACTION_STATE_ROLLBACK:
-                        return this->processRollbackTransaction(info);
-                    default:
-                        throw exceptions::ActiveMQException(
-                            __FILE__, __LINE__, "Unknown Transaction Info Type.");
-                }
-            }
-
+        virtual decaf::lang::Pointer<commands::Command> processConsumerInfo(commands::ConsumerInfo* info AMQCPP_UNUSED) {
             return decaf::lang::Pointer<commands::Command>();
         }
 
-        virtual decaf::lang::Pointer<commands::Command> processRemoveInfo(commands::RemoveInfo* info) {
+        virtual decaf::lang::Pointer<commands::Command> processTransactionInfo(commands::TransactionInfo* info);
 
-            if (info != decaf::lang::Pointer<commands::Command>()) {
-                switch (info->getObjectId()->getDataStructureType()) {
-                    case commands::ConnectionId::ID_CONNECTIONID:
-                        return this->processRemoveConnection(
-                            dynamic_cast<commands::ConnectionId*> (info->getObjectId().get()));
-                    case commands::SessionId::ID_SESSIONID:
-                        return this->processRemoveSession(
-                            dynamic_cast<commands::SessionId*> (info->getObjectId().get()));
-                    case commands::ConsumerId::ID_CONSUMERID:
-                        return this->processRemoveConsumer(
-                            dynamic_cast<commands::ConsumerId*> (info->getObjectId().get()));
-                    case commands::ProducerId::ID_PRODUCERID:
-                        return this->processRemoveProducer(
-                            dynamic_cast<commands::ProducerId*> (info->getObjectId().get()));
-                    default:
-                        throw exceptions::ActiveMQException(
-                            __FILE__, __LINE__, "Unknown Remove Info Type.");
-                }
-            }
+        virtual decaf::lang::Pointer<commands::Command> processRemoveInfo(commands::RemoveInfo* info);
 
-            return decaf::lang::Pointer<commands::Command>();
-        }
     };
 
 }}

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/ConnectionStateTracker.cpp Thu Oct 18 18:58:02 2012
@@ -103,9 +103,9 @@ Pointer<Tracked> ConnectionStateTracker:
             return result.dynamicCast<Tracked>();
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -127,17 +127,17 @@ void ConnectionStateTracker::trackBack(P
             }
         }
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 void ConnectionStateTracker::restore(Pointer<transport::Transport> transport) {
 
-    try{
+    try {
 
-        Pointer< Iterator< Pointer<ConnectionState> > > iterator(this->connectionStates.values().iterator());
+        Pointer<Iterator<Pointer<ConnectionState> > > iterator(this->connectionStates.values().iterator());
         while (iterator->hasNext()) {
             Pointer<ConnectionState> state = iterator->next();
 
@@ -157,24 +157,23 @@ void ConnectionStateTracker::restore(Poi
         }
 
         // Now we flush messages
-        Pointer< Iterator< Pointer<Command> > > messages(this->messageCache.values().iterator());
+        Pointer<Iterator<Pointer<Command> > > messages(this->messageCache.values().iterator());
         while (messages->hasNext()) {
             transport->oneway(messages->next());
         }
 
-        Pointer< Iterator< Pointer<Command> > > messagePullIter(this->messagePullCache.values().iterator());
+        Pointer<Iterator<Pointer<Command> > > messagePullIter(this->messagePullCache.values().iterator());
         while (messagePullIter->hasNext()) {
             transport->oneway(messagePullIter->next());
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectionStateTracker::doRestoreTransactions(Pointer<transport::Transport> transport,
-                                                   Pointer<ConnectionState> connectionState) {
+void ConnectionStateTracker::doRestoreTransactions(Pointer<transport::Transport> transport, Pointer<ConnectionState> connectionState) {
 
     try {
 
@@ -182,7 +181,7 @@ void ConnectionStateTracker::doRestoreTr
 
         // For any completed transactions we don't know if the commit actually made it to the broker
         // or was lost along the way, so they need to be rolled back.
-        Pointer< Iterator< Pointer<TransactionState> > > iter(connectionState->getTransactionStates().iterator());
+        Pointer<Iterator<Pointer<TransactionState> > > iter(connectionState->getTransactionStates().iterator());
         while (iter->hasNext()) {
 
             Pointer<TransactionState> txState = iter->next();
@@ -196,7 +195,7 @@ void ConnectionStateTracker::doRestoreTr
             }
 
             // replay short lived producers that may have been involved in the transaction
-            Pointer< Iterator< Pointer<ProducerState> > > state(txState->getProducerStates().iterator());
+            Pointer<Iterator<Pointer<ProducerState> > > state(txState->getProducerStates().iterator());
             while (state->hasNext()) {
                 transport->oneway(state->next()->getInfo());
             }
@@ -220,25 +219,23 @@ void ConnectionStateTracker::doRestoreTr
             Pointer<BrokerError> exception(new BrokerError());
             exception->setExceptionClass("TransactionRolledBackException");
             exception->setMessage(
-                std::string("Transaction completion in doubt due to failover. Forcing rollback of ") +
-                (*command)->getTransactionId()->toString());
+                    std::string("Transaction completion in doubt due to failover. Forcing rollback of ") + (*command)->getTransactionId()->toString());
             response->setException(exception);
             response->setCorrelationId((*command)->getCommandId());
             transport->getTransportListener()->onCommand(response);
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectionStateTracker::doRestoreSessions(Pointer<transport::Transport> transport,
-                                               Pointer<ConnectionState> connectionState) {
+void ConnectionStateTracker::doRestoreSessions(Pointer<transport::Transport> transport, Pointer<ConnectionState> connectionState) {
 
     try {
 
-        Pointer< Iterator< Pointer<SessionState> > > iter(connectionState->getSessionStates().iterator());
+        Pointer<Iterator<Pointer<SessionState> > > iter(connectionState->getSessionStates().iterator());
         while (iter->hasNext()) {
             Pointer<SessionState> state = iter->next();
             transport->oneway(state->getInfo());
@@ -252,77 +249,71 @@ void ConnectionStateTracker::doRestoreSe
             }
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectionStateTracker::doRestoreConsumers(Pointer<transport::Transport> transport, Pointer<SessionState> sessionState ) {
+void ConnectionStateTracker::doRestoreConsumers(Pointer<transport::Transport> transport, Pointer<SessionState> sessionState) {
 
     try {
 
         // Restore the session's consumers but possibly in pull only (prefetch 0 state) till recovery complete
-        Pointer<ConnectionState> connectionState =
-            connectionStates.get(sessionState->getInfo()->getSessionId()->getParentId());
-        bool connectionInterruptionProcessingComplete =
-            connectionState->isConnectionInterruptProcessingComplete();
+        Pointer<ConnectionState> connectionState = connectionStates.get(sessionState->getInfo()->getSessionId()->getParentId());
+        bool connectionInterruptionProcessingComplete = connectionState->isConnectionInterruptProcessingComplete();
 
-        Pointer< Iterator< Pointer<ConsumerState> > > state(sessionState->getConsumerStates().iterator());
+        Pointer<Iterator<Pointer<ConsumerState> > > state(sessionState->getConsumerStates().iterator());
         while (state->hasNext()) {
 
             Pointer<ConsumerInfo> infoToSend = state->next()->getInfo();
             Pointer<wireformat::WireFormat> wireFormat = transport->getWireFormat();
 
-            if (!connectionInterruptionProcessingComplete && infoToSend->getPrefetchSize() > 0 &&
-                wireFormat->getVersion() > 5) {
+            if (!connectionInterruptionProcessingComplete && infoToSend->getPrefetchSize() > 0 && wireFormat->getVersion() > 5) {
 
                 Pointer<ConsumerInfo> oldInfoToSend = infoToSend;
                 infoToSend.reset(oldInfoToSend->cloneDataStructure());
-                connectionState->getRecoveringPullConsumers().put(
-                    infoToSend->getConsumerId(), oldInfoToSend);
+                connectionState->getRecoveringPullConsumers().put(infoToSend->getConsumerId(), oldInfoToSend);
                 infoToSend->setPrefetchSize(0);
             }
 
             transport->oneway(infoToSend);
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectionStateTracker::doRestoreProducers(Pointer<transport::Transport> transport, Pointer<SessionState> sessionState ) {
+void ConnectionStateTracker::doRestoreProducers(Pointer<transport::Transport> transport, Pointer<SessionState> sessionState) {
 
     try {
 
         // Restore the session's producers
-        Pointer< Iterator< Pointer<ProducerState> > > iter(sessionState->getProducerStates().iterator());
+        Pointer<Iterator<Pointer<ProducerState> > > iter(sessionState->getProducerStates().iterator());
         while (iter->hasNext()) {
             Pointer<ProducerState> state = iter->next();
             transport->oneway(state->getInfo());
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectionStateTracker::doRestoreTempDestinations(Pointer<transport::Transport> transport,
-                                                       Pointer<ConnectionState> connectionState ) {
+void ConnectionStateTracker::doRestoreTempDestinations(Pointer<transport::Transport> transport, Pointer<ConnectionState> connectionState) {
     try {
-        std::auto_ptr<Iterator<Pointer<DestinationInfo> > > iter(
-            connectionState->getTempDesinations().iterator());
+        std::auto_ptr<Iterator<Pointer<DestinationInfo> > > iter(connectionState->getTempDesinations().iterator());
 
         while (iter->hasNext()) {
             transport->oneway(iter->next());
         }
     }
-    AMQ_CATCH_RETHROW( IOException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, IOException )
-    AMQ_CATCHALL_THROW( IOException )
+    AMQ_CATCH_RETHROW(IOException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, IOException)
+    AMQ_CATCHALL_THROW(IOException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -337,9 +328,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -354,9 +345,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -380,9 +371,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -406,9 +397,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -433,9 +424,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -459,9 +450,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -480,9 +471,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -501,9 +492,9 @@ Pointer<Command> ConnectionStateTracker:
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -512,14 +503,13 @@ Pointer<Command> ConnectionStateTracker:
     try {
         if (info != NULL) {
             Pointer<ConnectionInfo> infoCopy(info->cloneDataStructure());
-            connectionStates.put(
-                info->getConnectionId(), Pointer<ConnectionState>(new ConnectionState(infoCopy)));
+            connectionStates.put(info->getConnectionId(), Pointer<ConnectionState>(new ConnectionState(infoCopy)));
         }
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -532,9 +522,9 @@ Pointer<Command> ConnectionStateTracker:
 
         return TRACKED_RESPONSE_MARKER;
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -550,8 +540,7 @@ Pointer<Command> ConnectionStateTracker:
                 if (connectionId != NULL) {
                     Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                     if (cs != NULL) {
-                        Pointer<TransactionState> transactionState =
-                            cs->getTransactionState(message->getTransactionId());
+                        Pointer<TransactionState> transactionState = cs->getTransactionState(message->getTransactionId());
                         if (transactionState != NULL) {
                             transactionState->addCommand(Pointer<Command>(message->cloneDataStructure()));
 
@@ -566,15 +555,15 @@ Pointer<Command> ConnectionStateTracker:
                 }
                 return TRACKED_RESPONSE_MARKER;
             } else if (trackMessages) {
-                messageCache.put(message->getMessageId(), Pointer<Message> (message->cloneDataStructure()));
+                messageCache.put(message->getMessageId(), Pointer<Message>(message->cloneDataStructure()));
             }
         }
 
         return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -588,8 +577,7 @@ Pointer<Command> ConnectionStateTracker:
                 Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                 if (cs != NULL) {
                     cs->addTransactionState(info->getTransactionId());
-                    Pointer<TransactionState> transactionState =
-                        cs->getTransactionState(info->getTransactionId());
+                    Pointer<TransactionState> transactionState = cs->getTransactionState(info->getTransactionId());
                     transactionState->addCommand(Pointer<Command>(info->cloneDataStructure()));
                 }
             }
@@ -597,11 +585,11 @@ Pointer<Command> ConnectionStateTracker:
             return TRACKED_RESPONSE_MARKER;
         }
 
-        return Pointer<Response> ();
+        return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -614,8 +602,7 @@ Pointer<Command> ConnectionStateTracker:
             if (connectionId != NULL) {
                 Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                 if (cs != NULL) {
-                    Pointer<TransactionState> transactionState =
-                        cs->getTransactionState(info->getTransactionId());
+                    Pointer<TransactionState> transactionState = cs->getTransactionState(info->getTransactionId());
                     if (transactionState != NULL) {
                         transactionState->addCommand(Pointer<Command>(info->cloneDataStructure()));
                     }
@@ -627,9 +614,9 @@ Pointer<Command> ConnectionStateTracker:
 
         return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -642,23 +629,21 @@ Pointer<Command> ConnectionStateTracker:
             if (connectionId != NULL) {
                 Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                 if (cs != NULL) {
-                    Pointer<TransactionState> transactionState =
-                        cs->getTransactionState(info->getTransactionId());
+                    Pointer<TransactionState> transactionState = cs->getTransactionState(info->getTransactionId());
                     if (transactionState != NULL) {
                         Pointer<TransactionInfo> infoCopy(info->cloneDataStructure());
                         transactionState->addCommand(infoCopy);
-                        return Pointer<Tracked>(
-                            new Tracked(Pointer<Runnable>(new RemoveTransactionAction(this, infoCopy))));
+                        return Pointer<Tracked>(new Tracked(Pointer<Runnable>(new RemoveTransactionAction(this, infoCopy))));
                     }
                 }
             }
         }
 
-        return Pointer<Response> ();
+        return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -671,13 +656,11 @@ Pointer<Command> ConnectionStateTracker:
             if (connectionId != NULL) {
                 Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                 if (cs != NULL) {
-                    Pointer<TransactionState> transactionState =
-                        cs->getTransactionState(info->getTransactionId());
+                    Pointer<TransactionState> transactionState = cs->getTransactionState(info->getTransactionId());
                     if (transactionState != NULL) {
                         Pointer<TransactionInfo> infoCopy(info->cloneDataStructure());
                         transactionState->addCommand(infoCopy);
-                        return Pointer<Tracked>(
-                            new Tracked(Pointer<Runnable>(new RemoveTransactionAction(this, infoCopy))));
+                        return Pointer<Tracked>(new Tracked(Pointer<Runnable>(new RemoveTransactionAction(this, infoCopy))));
                     }
                 }
             }
@@ -685,9 +668,9 @@ Pointer<Command> ConnectionStateTracker:
 
         return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -700,13 +683,11 @@ Pointer<Command> ConnectionStateTracker:
             if (connectionId != NULL) {
                 Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                 if (cs != NULL) {
-                    Pointer<TransactionState> transactionState =
-                        cs->getTransactionState(info->getTransactionId());
+                    Pointer<TransactionState> transactionState = cs->getTransactionState(info->getTransactionId());
                     if (transactionState != NULL) {
                         Pointer<TransactionInfo> infoCopy(info->cloneDataStructure());
                         transactionState->addCommand(infoCopy);
-                        return Pointer<Tracked>(
-                            new Tracked(Pointer<Runnable>(new RemoveTransactionAction(this, infoCopy))));
+                        return Pointer<Tracked>(new Tracked(Pointer<Runnable>(new RemoveTransactionAction(this, infoCopy))));
                     }
                 }
             }
@@ -714,9 +695,9 @@ Pointer<Command> ConnectionStateTracker:
 
         return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -729,10 +710,9 @@ Pointer<Command> ConnectionStateTracker:
             if (connectionId != NULL) {
                 Pointer<ConnectionState> cs = connectionStates.get(connectionId);
                 if (cs != NULL) {
-                    Pointer<TransactionState> transactionState =
-                        cs->getTransactionState(info->getTransactionId());
+                    Pointer<TransactionState> transactionState = cs->getTransactionState(info->getTransactionId());
                     if (transactionState != NULL) {
-                        transactionState->addCommand(Pointer<Command> (info->cloneDataStructure()));
+                        transactionState->addCommand(Pointer<Command>(info->cloneDataStructure()));
                     }
                 }
             }
@@ -742,9 +722,9 @@ Pointer<Command> ConnectionStateTracker:
 
         return Pointer<Response>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -757,16 +737,15 @@ Pointer<Command> ConnectionStateTracker:
             messagePullCache.put(id, Pointer<Command>(pull->cloneDataStructure()));
         }
 
-        return Pointer<Command> ();
+        return Pointer<Command>();
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCH_EXCEPTION_CONVERT(Exception, ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void ConnectionStateTracker::connectionInterruptProcessingComplete(
-    transport::Transport* transport, Pointer<ConnectionId> connectionId) {
+void ConnectionStateTracker::connectionInterruptProcessingComplete(transport::Transport* transport, Pointer<ConnectionId> connectionId) {
 
     Pointer<ConnectionState> connectionState = connectionStates.get(connectionId);
 
@@ -774,10 +753,9 @@ void ConnectionStateTracker::connectionI
 
         connectionState->setConnectionInterruptProcessingComplete(true);
 
-        StlMap<Pointer<ConsumerId>, Pointer<ConsumerInfo>, ConsumerId::COMPARATOR> stalledConsumers =
-            connectionState->getRecoveringPullConsumers();
+        StlMap<Pointer<ConsumerId>, Pointer<ConsumerInfo>, ConsumerId::COMPARATOR> stalledConsumers = connectionState->getRecoveringPullConsumers();
 
-        Pointer< Iterator< Pointer<ConsumerId> > > key(stalledConsumers.keySet().iterator());
+        Pointer<Iterator<Pointer<ConsumerId> > > key(stalledConsumers.keySet().iterator());
         while (key->hasNext()) {
             Pointer<ConsumerControl> control(new ConsumerControl());
 
@@ -800,7 +778,7 @@ void ConnectionStateTracker::connectionI
 ////////////////////////////////////////////////////////////////////////////////
 void ConnectionStateTracker::transportInterrupted() {
 
-    Pointer< Iterator< Pointer<ConnectionState> > > state(this->connectionStates.values().iterator());
+    Pointer<Iterator<Pointer<ConnectionState> > > state(this->connectionStates.values().iterator());
     while (state->hasNext()) {
         state->next()->setConnectionInterruptProcessingComplete(false);
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/SessionState.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/SessionState.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/SessionState.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/SessionState.cpp Thu Oct 18 18:58:02 2012
@@ -37,7 +37,7 @@ SessionState::~SessionState() {
     try {
         this->shutdown();
     }
-    DECAF_CATCHALL_NOTHROW()
+    AMQ_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/Tracked.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/Tracked.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/Tracked.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/state/Tracked.cpp Thu Oct 18 18:58:02 2012
@@ -41,6 +41,6 @@ void Tracked::onResponse() {
             this->runnable.reset(NULL);
         }
     }
-    AMQ_CATCH_RETHROW( ActiveMQException )
-    AMQ_CATCHALL_THROW( ActiveMQException )
+    AMQ_CATCH_RETHROW(ActiveMQException)
+    AMQ_CATCHALL_THROW(ActiveMQException)
 }

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.cpp Thu Oct 18 18:58:02 2012
@@ -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 "CompositeTask.h"
+
+using namespace activemq;
+using namespace activemq::threads;
+
+////////////////////////////////////////////////////////////////////////////////
+CompositeTask::~CompositeTask() {}
+

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTask.h Thu Oct 18 18:58:02 2012
@@ -33,7 +33,7 @@ namespace threads {
     class AMQCPP_API CompositeTask : public activemq::threads::Task {
     public:
 
-        virtual ~CompositeTask() {}
+        virtual ~CompositeTask();
 
         /**
          * Indicates whether this task has any pending work that needs to be

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.cpp Thu Oct 18 18:58:02 2012
@@ -51,7 +51,7 @@ CompositeTaskRunner::~CompositeTaskRunne
 ////////////////////////////////////////////////////////////////////////////////
 void CompositeTaskRunner::shutdown(unsigned int timeout) {
 
-    synchronized( &mutex ) {
+    synchronized(&mutex) {
         shutDown = true;
         pending = true;
         mutex.notifyAll();
@@ -67,7 +67,7 @@ void CompositeTaskRunner::shutdown(unsig
 ////////////////////////////////////////////////////////////////////////////////
 void CompositeTaskRunner::shutdown() {
 
-    synchronized( &mutex ) {
+    synchronized(&mutex) {
         shutDown = true;
         pending = true;
         mutex.notifyAll();
@@ -109,7 +109,7 @@ void CompositeTaskRunner::run() {
             if( !this->iterate() ) {
 
                 // wait to be notified.
-                synchronized( &mutex ) {
+                synchronized(&mutex) {
                     if (shutDown) {
                         return;
                     }
@@ -121,7 +121,6 @@ void CompositeTaskRunner::run() {
 
         }
     }
-    AMQ_CATCH_NOTHROW( Exception )
     AMQ_CATCHALL_NOTHROW()
 
     // Make sure we notify any waiting threads that thread
@@ -157,7 +156,7 @@ void CompositeTaskRunner::removeTask(Com
 ////////////////////////////////////////////////////////////////////////////////
 bool CompositeTaskRunner::iterate() {
 
-    synchronized( &tasks ) {
+    synchronized(&tasks) {
 
         auto_ptr<Iterator<CompositeTask*> > iter(tasks.iterator());
 

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/CompositeTaskRunner.h Thu Oct 18 18:58:02 2012
@@ -55,8 +55,8 @@ namespace threads {
 
     private:
 
-        CompositeTaskRunner( const CompositeTaskRunner& );
-        CompositeTaskRunner& operator= ( const CompositeTaskRunner& );
+        CompositeTaskRunner(const CompositeTaskRunner&);
+        CompositeTaskRunner& operator=(const CompositeTaskRunner&);
 
     public:
 
@@ -68,13 +68,13 @@ namespace threads {
          * Adds a new CompositeTask to the Set of Tasks that this class manages.
          * @param task - Pointer to a CompositeTask instance.
          */
-        void addTask( CompositeTask* task );
+        void addTask(CompositeTask* task);
 
         /**
          * Removes a CompositeTask that was added previously
          * @param task - Pointer to a CompositeTask instance.
          */
-        void removeTask( CompositeTask* task );
+        void removeTask(CompositeTask* task);
 
         /**
          * Shutdown after a timeout, does not guarantee that the task's iterate
@@ -82,7 +82,7 @@ namespace threads {
          *
          * @param timeout - Time in Milliseconds to wait for the task to stop.
          */
-        virtual void shutdown( unsigned int timeout );
+        virtual void shutdown(unsigned int timeout);
 
         /**
          * Shutdown once the task has finished and the TaskRunner's thread has exited.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.cpp Thu Oct 18 18:58:02 2012
@@ -27,38 +27,37 @@ using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-DedicatedTaskRunner::DedicatedTaskRunner( Task* task ) :
+DedicatedTaskRunner::DedicatedTaskRunner(Task* task) :
     mutex(), thread(), threadTerminated(false), pending(false), shutDown(false), task(task) {
 
-    if( this->task == NULL ) {
-        throw NullPointerException(
-            __FILE__, __LINE__, "Task passed was null" );
+    if (this->task == NULL) {
+        throw NullPointerException(__FILE__, __LINE__, "Task passed was null");
     }
 
-    this->thread.reset( new Thread( this ) );
+    this->thread.reset(new Thread(this));
     this->thread->start();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 DedicatedTaskRunner::~DedicatedTaskRunner() {
-    try{
+    try {
         this->shutdown();
     }
     AMQ_CATCHALL_NOTHROW()
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-void DedicatedTaskRunner::shutdown( unsigned int timeout ) {
+void DedicatedTaskRunner::shutdown(unsigned int timeout) {
 
-    synchronized( &mutex ) {
+    synchronized(&mutex) {
         shutDown = true;
         pending = true;
         mutex.notifyAll();
 
         // Wait till the thread stops ( no need to wait if shutdown
         // is called from thread that is shutting down)
-        if( Thread::currentThread() != this->thread.get() && !threadTerminated ) {
-            mutex.wait( timeout );
+        if (Thread::currentThread() != this->thread.get() && !threadTerminated) {
+            mutex.wait(timeout);
         }
     }
 }
@@ -66,7 +65,7 @@ void DedicatedTaskRunner::shutdown( unsi
 ////////////////////////////////////////////////////////////////////////////////
 void DedicatedTaskRunner::shutdown() {
 
-    synchronized( &mutex ) {
+    synchronized(&mutex) {
         shutDown = true;
         pending = true;
         mutex.notifyAll();
@@ -74,7 +73,7 @@ void DedicatedTaskRunner::shutdown() {
 
     // Wait till the thread stops ( no need to wait if shutdown
     // is called from thread that is shutting down)
-    if( Thread::currentThread() != this->thread.get() && !threadTerminated ) {
+    if (Thread::currentThread() != this->thread.get() && !threadTerminated) {
         this->thread->join();
     }
 }
@@ -82,8 +81,8 @@ void DedicatedTaskRunner::shutdown() {
 ////////////////////////////////////////////////////////////////////////////////
 void DedicatedTaskRunner::wakeup() {
 
-    synchronized( &mutex ) {
-        if( shutDown) {
+    synchronized(&mutex) {
+        if (shutDown) {
             return;
         }
         pending = true;
@@ -96,23 +95,23 @@ void DedicatedTaskRunner::run() {
 
     try {
 
-        while( true ) {
+        while (true) {
 
-            synchronized( &mutex ) {
+            synchronized(&mutex) {
                 pending = false;
-                if( shutDown ) {
+                if (shutDown) {
                     return;
                 }
             }
 
-            if( !this->task->iterate() ) {
+            if (!this->task->iterate()) {
 
                 // wait to be notified.
-                synchronized( &mutex ) {
-                    if( shutDown ) {
+                synchronized(&mutex) {
+                    if (shutDown) {
                         return;
                     }
-                    while( !pending ) {
+                    while (!pending) {
                         mutex.wait();
                     }
                 }
@@ -120,12 +119,11 @@ void DedicatedTaskRunner::run() {
 
         }
     }
-    AMQ_CATCH_NOTHROW( Exception )
     AMQ_CATCHALL_NOTHROW()
 
     // Make sure we notify any waiting threads that thread
     // has terminated.
-    synchronized( &mutex ) {
+    synchronized(&mutex) {
         threadTerminated = true;
         mutex.notifyAll();
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/DedicatedTaskRunner.h Thu Oct 18 18:58:02 2012
@@ -48,12 +48,12 @@ namespace threads {
 
     private:
 
-        DedicatedTaskRunner( const DedicatedTaskRunner& );
-        DedicatedTaskRunner& operator= ( const DedicatedTaskRunner& );
+        DedicatedTaskRunner(const DedicatedTaskRunner&);
+        DedicatedTaskRunner& operator=(const DedicatedTaskRunner&);
 
     public:
 
-        DedicatedTaskRunner( Task* task );
+        DedicatedTaskRunner(Task* task);
         virtual ~DedicatedTaskRunner();
 
         /**
@@ -62,7 +62,7 @@ namespace threads {
          *
          * @param timeout - Time in Milliseconds to wait for the task to stop.
          */
-        virtual void shutdown( unsigned int timeout );
+        virtual void shutdown(unsigned int timeout);
 
         /**
          * Shutdown once the task has finished and the TaskRunner's thread has exited.

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Scheduler.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Scheduler.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Scheduler.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Scheduler.cpp Thu Oct 18 18:58:02 2012
@@ -40,16 +40,16 @@ using namespace decaf::lang::exceptions;
 ////////////////////////////////////////////////////////////////////////////////
 Scheduler::Scheduler(const std::string& name) : name(name), timer(NULL), tasks() {
 
-    if(name.empty()) {
+    if (name.empty()) {
         throw IllegalArgumentException(__FILE__, __LINE__, "Scheduler name must not be empty.");
     }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 Scheduler::~Scheduler() {
-    try{
+    try {
 
-        if(this->timer != NULL) {
+        if (this->timer != NULL) {
             this->timer->cancel();
         }
 
@@ -63,7 +63,7 @@ Scheduler::~Scheduler() {
 ////////////////////////////////////////////////////////////////////////////////
 void Scheduler::executePeriodically(Runnable* task, long long period, bool ownsTask) {
 
-    if(!isStarted()) {
+    if (!isStarted()) {
         throw IllegalStateException(__FILE__, __LINE__, "Scheduler is not started.");
     }
 
@@ -77,7 +77,7 @@ void Scheduler::executePeriodically(Runn
 ////////////////////////////////////////////////////////////////////////////////
 void Scheduler::schedualPeriodically(Runnable* task, long long period, bool ownsTask) {
 
-    if(!isStarted()) {
+    if (!isStarted()) {
         throw IllegalStateException(__FILE__, __LINE__, "Scheduler is not started.");
     }
 
@@ -91,13 +91,13 @@ void Scheduler::schedualPeriodically(Run
 ////////////////////////////////////////////////////////////////////////////////
 void Scheduler::cancel(Runnable* task) {
 
-    if(!isStarted()) {
+    if (!isStarted()) {
         throw IllegalStateException(__FILE__, __LINE__, "Scheduler is not started.");
     }
 
     synchronized(&mutex) {
         TimerTask* ticket = this->tasks.remove(task);
-        if(ticket != NULL) {
+        if (ticket != NULL) {
             ticket->cancel();
             this->timer->purge();
         }
@@ -107,7 +107,7 @@ void Scheduler::cancel(Runnable* task) {
 ////////////////////////////////////////////////////////////////////////////////
 void Scheduler::executeAfterDelay(Runnable* task, long long delay, bool ownsTask) {
 
-    if(!isStarted()) {
+    if (!isStarted()) {
         throw IllegalStateException(__FILE__, __LINE__, "Scheduler is not started.");
     }
 
@@ -119,7 +119,7 @@ void Scheduler::executeAfterDelay(Runnab
 
 ////////////////////////////////////////////////////////////////////////////////
 void Scheduler::shutdown() {
-    if(this->timer != NULL) {
+    if (this->timer != NULL) {
         this->timer->cancel();
     }
 }
@@ -134,7 +134,7 @@ void Scheduler::doStart() {
 ////////////////////////////////////////////////////////////////////////////////
 void Scheduler::doStop(ServiceStopper* stopper AMQCPP_UNUSED) {
     synchronized(&mutex) {
-        if(this->timer != NULL) {
+        if (this->timer != NULL) {
             this->timer->cancel();
         }
     }

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/SchedulerTimerTask.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/SchedulerTimerTask.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/SchedulerTimerTask.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/SchedulerTimerTask.cpp Thu Oct 18 18:58:02 2012
@@ -28,9 +28,10 @@ using namespace decaf::lang;
 using namespace decaf::lang::exceptions;
 
 ////////////////////////////////////////////////////////////////////////////////
-SchedulerTimerTask::SchedulerTimerTask(Runnable* task, bool ownsTask) : task(task), ownsTask(ownsTask) {
+SchedulerTimerTask::SchedulerTimerTask(Runnable* task, bool ownsTask) :
+    task(task), ownsTask(ownsTask) {
 
-    if(task == NULL) {
+    if (task == NULL) {
         throw NullPointerException(__FILE__, __LINE__, "Assigned Task cannot be NULL.");
     }
 }
@@ -38,8 +39,8 @@ SchedulerTimerTask::SchedulerTimerTask(R
 ////////////////////////////////////////////////////////////////////////////////
 SchedulerTimerTask::~SchedulerTimerTask() {
 
-    try{
-        if(ownsTask) {
+    try {
+        if (ownsTask) {
             delete this->task;
         }
     }
@@ -48,7 +49,7 @@ SchedulerTimerTask::~SchedulerTimerTask(
 
 ////////////////////////////////////////////////////////////////////////////////
 void SchedulerTimerTask::run() {
-    if(this->task != NULL) {
+    if (this->task != NULL) {
         this->task->run();
     }
 }

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.cpp Thu Oct 18 18:58:02 2012
@@ -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 "Task.h"
+
+using namespace activemq;
+using namespace activemq::threads;
+
+////////////////////////////////////////////////////////////////////////////////
+Task::~Task() {}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/Task.h Thu Oct 18 18:58:02 2012
@@ -31,7 +31,7 @@ namespace threads {
     class AMQCPP_API Task {
     public:
 
-        virtual ~Task() {}
+        virtual ~Task();
 
         /**
          * Perform one iteration of work, returns true if the task needs

Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.cpp Thu Oct 18 18:58:02 2012
@@ -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 "TaskRunner.h"
+
+using namespace activemq;
+using namespace activemq::threads;
+
+////////////////////////////////////////////////////////////////////////////////
+TaskRunner::~TaskRunner() {}

Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/threads/TaskRunner.cpp
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message