hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1482743 - in /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol: AbstractAsyncRequestConsumer.java AbstractAsyncResponseConsumer.java
Date Wed, 15 May 2013 10:02:40 GMT
Author: olegk
Date: Wed May 15 10:02:39 2013
New Revision: 1482743

URL: http://svn.apache.org/r1482743
Log:
Added #onClose() event method to AbstractAsyncRequestConsumer and AbstractAsyncResponseConsumer

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncRequestConsumer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncResponseConsumer.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncRequestConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncRequestConsumer.java?rev=1482743&r1=1482742&r2=1482743&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncRequestConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncRequestConsumer.java
Wed May 15 10:02:39 2013
@@ -111,6 +111,14 @@ public abstract class AbstractAsyncReque
     protected abstract void releaseResources();
 
     /**
+     * Invoked when the consumer is being closed.
+     *
+     * @since 4.3
+     */
+    protected void onClose() throws IOException {
+    }
+
+    /**
      * Use {@link #onRequestReceived(HttpRequest)} instead.
      */
     public final synchronized void requestReceived(
@@ -165,6 +173,7 @@ public abstract class AbstractAsyncReque
         }
         this.completed = true;
         releaseResources();
+        onClose();
     }
 
     public Exception getException() {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncResponseConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncResponseConsumer.java?rev=1482743&r1=1482742&r2=1482743&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncResponseConsumer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/AbstractAsyncResponseConsumer.java
Wed May 15 10:02:39 2013
@@ -109,6 +109,14 @@ public abstract class AbstractAsyncRespo
     protected abstract void releaseResources();
 
     /**
+     * Invoked when the consumer is being closed.
+     *
+     * @since 4.3
+     */
+    protected void onClose() throws IOException {
+    }
+
+    /**
      * Use {@link #onResponseReceived(HttpResponse)} instead.
      */
     public final synchronized void responseReceived(
@@ -164,12 +172,13 @@ public abstract class AbstractAsyncRespo
         releaseResources();
     }
 
-    public final synchronized void close() {
+    public final synchronized void close() throws IOException {
         if (this.completed) {
             return;
         }
         this.completed = true;
         releaseResources();
+        onClose();
     }
 
     public Exception getException() {



Mime
View raw message