activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r511087 - in /activemq/branches/activemq-4.1: ./ activemq-core/src/main/java/org/apache/activemq/broker/ activemq-core/src/main/java/org/apache/activemq/thread/
Date Fri, 23 Feb 2007 20:25:03 GMT
Author: chirino
Date: Fri Feb 23 12:25:02 2007
New Revision: 511087

URL: http://svn.apache.org/viewvc?view=rev&rev=511087
Log:
 r243@34:  chirino | 2007-02-23 14:49:23 -0500
 Disconnect failed connections quicker
 

Modified:
    activemq/branches/activemq-4.1/   (props changed)
    activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
    activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
    activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
    activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunner.java

Propchange: activemq/branches/activemq-4.1/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Fri Feb 23 12:25:02 2007
@@ -1 +1 @@
-635f1f41-eb29-0410-ac9d-be9e2c357fdd:/local/amq-4.1-port:242
+635f1f41-eb29-0410-ac9d-be9e2c357fdd:/local/amq-4.1-port:243

Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?view=diff&rev=511087&r1=511086&r2=511087
==============================================================================
--- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Fri Feb 23 12:25:02 2007
@@ -882,14 +882,15 @@
 		        
                // Clear out what's on the queue so that we can send the Shutdown command
quicker.
                dispatchQueue.clear();
-               dispatchAsync(new ShutdownInfo());
-
-                // Wait up to 10 seconds for the shutdown command to be sent to 
-                // the client.
-                dispatchStopped.await(10, TimeUnit.SECONDS);
+               if( transportException==null ) {
+                    // Wait up to 10 seconds for the shutdown command to be sent to 
+                    // the client.
+                    dispatchAsync(new ShutdownInfo());
+                    dispatchStopped.await(10, TimeUnit.SECONDS);
+               }
 
 		        if( taskRunner!=null )
-		            taskRunner.shutdown();
+		            taskRunner.shutdownNoWait();
 		        
 		        // Clear out the dispatch queue to release any memory that
 		        // is being held on to.

Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java?view=diff&rev=511087&r1=511086&r2=511087
==============================================================================
--- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
(original)
+++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/DedicatedTaskRunner.java
Fri Feb 23 12:25:02 2007
@@ -73,6 +73,19 @@
         }
     }        
     
+
+    /**
+     * shut down the task
+     * @throws InterruptedException 
+     */
+    public void shutdownNoWait() throws InterruptedException{
+        synchronized(mutex){
+            shutdown=true;
+            pending=true;
+            mutex.notifyAll();
+        }
+    }        
+    
     private void runTask() {
         
         try {

Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java?view=diff&rev=511087&r1=511086&r2=511087
==============================================================================
--- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
(original)
+++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/PooledTaskRunner.java
Fri Feb 23 12:25:02 2007
@@ -90,6 +90,12 @@
                 }
             }
         }
+    }
+    
+    public void shutdownNoWait() throws InterruptedException{
+        synchronized(runable){
+            shutdown=true;
+        }
     }        
     
     private void runTask() {

Modified: activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunner.java
URL: http://svn.apache.org/viewvc/activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunner.java?view=diff&rev=511087&r1=511086&r2=511087
==============================================================================
--- activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunner.java
(original)
+++ activemq/branches/activemq-4.1/activemq-core/src/main/java/org/apache/activemq/thread/TaskRunner.java
Fri Feb 23 12:25:02 2007
@@ -25,4 +25,5 @@
 public interface TaskRunner {
     public abstract void wakeup() throws InterruptedException;
     public abstract void shutdown() throws InterruptedException;
+    public abstract void shutdownNoWait() throws InterruptedException;
 }



Mime
View raw message