activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r583934 - in /activemq/activemq-cpp/trunk/src/main/activemq/connector: Connector.h openwire/OpenWireConnector.cpp openwire/OpenWireConnector.h stomp/StompConnector.h
Date Thu, 11 Oct 2007 19:43:17 GMT
Author: tabish
Date: Thu Oct 11 12:43:17 2007
New Revision: 583934

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

Changed the OpenwireConnector to not use the transport after an error occurs

Modified:
    activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
    activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h
    activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h?rev=583934&r1=583933&r2=583934&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/Connector.h Thu Oct 11 12:43:17
2007
@@ -52,6 +52,17 @@
         public cms::Startable,
         public cms::Closeable
     {
+    protected:
+
+        // Flags the state we are in for connection to broker.
+        enum connectionState
+        {
+            DISCONNECTED,
+            CONNECTION_ERROR,
+            CONNECTING,
+            CONNECTED
+        };
+
     public:    // Connector Types
 
         enum AckType

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp?rev=583934&r1=583933&r2=583934&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.cpp
Thu Oct 11 12:43:17 2007
@@ -1251,7 +1251,9 @@
 {
     try {
 
-        if( resource == NULL ) {
+        // if we don't get a resource or we aren't connected then we can't do
+        // anything so we return quickly.
+        if( resource == NULL || state != CONNECTED ) {
             return;
         }
 
@@ -1406,6 +1408,9 @@
 
         // We were not closing - log the stack trace.
         //LOGCMS_WARN( logger, ex.getStackTraceString() );
+
+        // Mark the fact that we are in an error state
+        state = CONNECTION_ERROR;
 
         // Inform the user of the error.
         fire( ex );

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h?rev=583934&r1=583933&r2=583934&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/OpenWireConnector.h Thu
Oct 11 12:43:17 2007
@@ -73,14 +73,6 @@
     {
     private:
 
-        // Flags the state we are in for connection to broker.
-        enum connectionState
-        {
-            DISCONNECTED,
-            CONNECTING,
-            CONNECTED
-        };
-
         // Enumeration of Transaction State flags
         enum TransactionType
         {

Modified: activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h?rev=583934&r1=583933&r2=583934&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/connector/stomp/StompConnector.h Thu Oct
11 12:43:17 2007
@@ -52,14 +52,6 @@
 
     private:
 
-        // Flags the state we are in for connection to broker.
-        enum connectionState
-        {
-            DISCONNECTED,
-            CONNECTING,
-            CONNECTED
-        };
-
         // Maps Command Ids to listener that are interested
         typedef std::map< commands::CommandConstants::CommandId,
                           StompCommandListener* > CmdListenerMap;



Mime
View raw message