activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1079885 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker: MapTransportConnectionStateRegister.java TransportConnection.java
Date Wed, 09 Mar 2011 17:01:55 GMT
Author: gtully
Date: Wed Mar  9 17:01:55 2011
New Revision: 1079885

URL: http://svn.apache.org/viewvc?rev=1079885&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3198 - unregister failed add connection but have
unregister respect the reference count such that it is only removed if the refcount is 1

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/MapTransportConnectionStateRegister.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/MapTransportConnectionStateRegister.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/MapTransportConnectionStateRegister.java?rev=1079885&r1=1079884&r2=1079885&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/MapTransportConnectionStateRegister.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/MapTransportConnectionStateRegister.java
Wed Mar  9 17:01:55 2011
@@ -43,6 +43,10 @@ public class MapTransportConnectionState
 
     public TransportConnectionState unregisterConnectionState(ConnectionId connectionId)
{
         TransportConnectionState rc = connectionStates.remove(connectionId);
+        if (rc.getReferenceCounter().get() > 1) {
+            rc.decrementReference();
+            connectionStates.put(connectionId, rc);
+        }
         return rc;
     }
 

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?rev=1079885&r1=1079884&r2=1079885&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Wed Mar  9 17:01:55 2011
@@ -697,6 +697,7 @@ public class TransportConnection impleme
             synchronized (brokerConnectionStates) {
                 brokerConnectionStates.remove(info.getConnectionId());
             }
+            unregisterConnectionState(info.getConnectionId());
             LOG.warn("Failed to add Connection " + info.getConnectionId() + ", reason: "
+  e.toString());
             if (LOG.isDebugEnabled()) {
                 LOG.debug("Exception detail:", e);



Mime
View raw message