You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ri...@apache.org on 2008/03/04 12:16:23 UTC

svn commit: r633427 - in /geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc: AsyncHttpClient.java codec/HttpIoHandler.java

Author: rickmcguire
Date: Tue Mar  4 03:16:15 2008
New Revision: 633427

URL: http://svn.apache.org/viewvc?rev=633427&view=rev
Log:
GERONIMO-3889 HttpIoHandler shuts down the scheduled executor service even if it is passed in by caller

Patch provided by Sangjin Lee. 


Modified:
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java
    geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java?rev=633427&r1=633426&r2=633427&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java (original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/AsyncHttpClient.java Tue Mar  4 03:16:15 2008
@@ -606,13 +606,11 @@
     }
 
     /**
-     * Shuts down the AsyncHttpClient object and releases references to associated thread pools.  
-     * Should always be called when the application is  
+     * Shuts down the AsyncHttpClient object and releases references to 
+     * associated thread pools.  Should always be called when the application is  
      * done using the object or a hang can occur.
      */
     public void destroyAll() {
-        handler.destroy();
-
         if (connector != null) {
             connector.dispose();
             //connector.setWorkerTimeout(0);

Modified: geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java?rev=633427&r1=633426&r2=633427&view=diff
==============================================================================
--- geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java (original)
+++ geronimo/sandbox/async-http-client-mina2/src/main/java/org/apache/ahc/codec/HttpIoHandler.java Tue Mar  4 03:16:15 2008
@@ -32,6 +32,7 @@
 import org.apache.ahc.auth.AuthPolicy;
 import org.apache.ahc.auth.AuthScheme;
 import org.apache.ahc.auth.AuthState;
+import org.apache.ahc.util.DaemonThreadFactory;
 import org.apache.ahc.util.MonitoringEvent;
 import org.apache.ahc.util.NameValuePair;
 import org.apache.mina.common.IoHandlerAdapter;
@@ -78,11 +79,12 @@
      * Instantiates a new HttpIoHandler with a new a single-threaded executor.
      */
     public HttpIoHandler() {
-        this(Executors.newSingleThreadScheduledExecutor());
+        this(Executors.newSingleThreadScheduledExecutor(new DaemonThreadFactory()));
     }
 
     /**
-     * Instantiates a new HttpIoHandler with the supplied scheduler.
+     * Instantiates a new HttpIoHandler with the supplied scheduler.  It is the
+     * caller's responsibility to dispose of the scheduler.
      *
      * @param scheduler the scheduler to use to track timeouts
      */
@@ -109,13 +111,6 @@
      */
     public SessionCache getSessionCache() {
         return sessionCache; 
-    }
-
-    /**
-     * Destroys the handler and shuts down the scheduler.
-     */
-    public void destroy() {
-        scheduler.shutdownNow();
     }
 
     /**