activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r369174 - /incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
Date Sun, 15 Jan 2006 03:41:04 GMT
Author: chirino
Date: Sat Jan 14 19:41:03 2006
New Revision: 369174

URL: http://svn.apache.org/viewcvs?rev=369174&view=rev
Log:
Protect against recursing.

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java?rev=369174&r1=369173&r2=369174&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/AbstractConnection.java
Sat Jan 14 19:41:03 2006
@@ -78,6 +78,7 @@
     protected final TaskRunner taskRunner;
     protected final Connector connector;
     private ConnectionStatistics statistics = new ConnectionStatistics();
+    private boolean inServiceException=false;
 
     protected final ConcurrentHashMap connectionStates = new ConcurrentHashMap();
     
@@ -161,12 +162,17 @@
     }
         
     public void serviceException(Throwable e) {
-        if( !disposed ) {
-            if( log.isDebugEnabled() )
-                log.debug("Async error occurred: "+e,e);
-            ConnectionError ce = new ConnectionError();
-            ce.setException(e);
-            dispatchAsync(ce);
+        if( !disposed && !inServiceException ) {
+            inServiceException = true;
+                try {
+                if( log.isDebugEnabled() )
+                    log.debug("Async error occurred: "+e,e);
+                ConnectionError ce = new ConnectionError();
+                ce.setException(e);
+                dispatchAsync(ce);
+            } finally {
+                inServiceException = false;
+            }
         } 
     }
 



Mime
View raw message