activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r1210503 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Date Mon, 05 Dec 2011 15:44:27 GMT
Author: rajdavies
Date: Mon Dec  5 15:44:26 2011
New Revision: 1210503

URL: http://svn.apache.org/viewvc?rev=1210503&view=rev
Log:
only do delayStop () for SecurityExceptions

Modified:
    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/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?rev=1210503&r1=1210502&r2=1210503&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
Mon Dec  5 15:44:26 2011
@@ -290,8 +290,10 @@ public class TransportConnection impleme
             if (responseRequired) {
 
                 response = new ExceptionResponse(e);
-                //still need to close this down - incase the peer of this transport doesn't
play nice
-                delayedStop(2000);
+                if(e instanceof java.lang.SecurityException){
+                  //still need to close this down - incase the peer of this transport doesn't
play nice
+                  delayedStop(2000, "Failed with SecurityException: " + e.getLocalizedMessage());
+                }
             } else {
                 serviceException(e);
             }
@@ -909,7 +911,7 @@ public class TransportConnection impleme
         }
     }
 
-    public void delayedStop(final int waitTime) {
+    public void delayedStop(final int waitTime, final String reason) {
         if (waitTime > 0) {
             try {
                 DefaultThreadPools.getDefaultTaskRunnerFactory().execute(new Runnable() {
@@ -917,6 +919,7 @@ public class TransportConnection impleme
                         try {
                             Thread.sleep(waitTime);
                             stopAsync();
+                            LOG.info("Stopping " + transport.getRemoteAddress() + " because
" + reason);
                         } catch (InterruptedException e) {
                         }
                     }



Mime
View raw message