You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2011/12/26 19:34:28 UTC

svn commit: r1224785 - in /httpcomponents/httpcore/trunk/httpcore-nio/src: main/java/org/apache/http/nio/entity/ main/java/org/apache/http/nio/protocol/ test/java/org/apache/http/nio/integration/ test/java/org/apache/http/nio/protocol/

Author: olegk
Date: Mon Dec 26 18:34:28 2011
New Revision: 1224785

URL: http://svn.apache.org/viewvc?rev=1224785&view=rev
Log:
Renamed HttpAsyncServiceExchange TO HttpAsyncExchange; updated javadocs

Added:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java   (with props)
Removed:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncServiceExchange.java
Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/HttpAsyncContentProducer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExpectationVerifier.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestConsumer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestProducer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseConsumer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseProducer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncServerProtocolHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncServerProtocolHandler.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/HttpAsyncContentProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/HttpAsyncContentProducer.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/HttpAsyncContentProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/entity/HttpAsyncContentProducer.java Mon Dec 26 18:34:28 2011
@@ -35,8 +35,7 @@ import org.apache.http.nio.IOControl;
 
 /**
  * <tt>HttpAsyncContentProducer</tt> is a callback interface whose methods
- * get invoked to stream out message content to a non-blocking HTTP connection
- * through a {@link ContentEncoder}.
+ * get invoked to stream out message content to a non-blocking HTTP connection.
  *
  * @since 4.2
  */

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestHandler.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/BasicAsyncRequestHandler.java Mon Dec 26 18:34:28 2011
@@ -63,7 +63,7 @@ public class BasicAsyncRequestHandler im
 
     public void handle(
             final HttpRequest request,
-            final HttpAsyncServiceExchange httpexchange,
+            final HttpAsyncExchange httpexchange,
             final HttpContext context) throws HttpException, IOException {
         this.handler.handle(request, httpexchange.getResponse(), context);
         httpexchange.submitResponse();

Added: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java?rev=1224785&view=auto
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java (added)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java Mon Dec 26 18:34:28 2011
@@ -0,0 +1,93 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.nio.protocol;
+
+import org.apache.http.HttpRequest;
+import org.apache.http.HttpResponse;
+import org.apache.http.concurrent.Cancellable;
+import org.apache.http.nio.entity.HttpAsyncContentProducer;
+
+/**
+ * <tt>HttpAsyncExchange</tt> represents a server-side HTTP message exchange where an HTTP response 
+ * can be deferred without blocking the I/O event thread and triggered asynchronously at a later 
+ * point of later time.
+ * 
+ * @since 4.2
+ */
+public interface HttpAsyncExchange {
+
+    /**
+     * Returns the received HTTP request message.
+     * 
+     * @return received HTTP request message.
+     */
+    HttpRequest getRequest();
+
+    /**
+     * Returns the default HTTP response message. Once ready the response message can submitted
+     * using {@link #submitResponse()} method.
+     * 
+     * @return default HTTP response message.
+     */
+    HttpResponse getResponse();
+
+    /**
+     * Submits the default HTTP response and completed the message exchange. If the response
+     * encloses an {@link HttpEntity} instance the entity is also expected to implement 
+     * the {@link HttpAsyncContentProducer} interface for efficient content streaming
+     * to a non-blocking HTTP connection.
+     * 
+     * @throws IllegalStateException if a response has already been submitted.
+     */
+    void submitResponse();
+
+    /**
+     * Submits an HTTP response using a custom {@link HttpAsyncResponseProducer}.
+     * 
+     * @throws IllegalStateException if a response has already been submitted.
+     */
+    void submitResponse(HttpAsyncResponseProducer responseProducer);
+
+    /**
+     * Determines whether or not the message exchange has been completed.
+     * 
+     * @return <code>true</code> if the message exchange has been completed, <code>false</code>
+     * otherwise.
+     */
+    boolean isCompleted();
+
+    /**
+     * Sets {@link Cancellable} callback to be invoked in case the underlying connection 
+     * times out or gets terminated prematurely by the client. This callback can be used to
+     * cancel a long running response generating process if a response is no longer needed.
+     * 
+     * @param cancellable
+     */
+    void setCallback(Cancellable cancellable);
+
+}

Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExchange.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExpectationVerifier.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExpectationVerifier.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExpectationVerifier.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncExpectationVerifier.java Mon Dec 26 18:34:28 2011
@@ -48,7 +48,7 @@ import org.apache.http.protocol.HttpCont
 public interface HttpAsyncExpectationVerifier {
 
     void verify(
-            HttpAsyncServiceExchange httpExchange,
+            HttpAsyncExchange httpExchange,
             HttpContext context) throws HttpException, IOException;
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestConsumer.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestConsumer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestConsumer.java Mon Dec 26 18:34:28 2011
@@ -39,7 +39,7 @@ import org.apache.http.protocol.HttpCont
 /**
  * <tt>HttpAsyncRequestConsumer</tt> is a callback interface whose methods
  * get invoked to process an HTTP request message and to stream message
- * content from a non-blocking HTTP connection through a {@link ContentDecoder}.
+ * content from a non-blocking HTTP connection.
  *
  * @since 4.2
  */

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestHandler.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestHandler.java Mon Dec 26 18:34:28 2011
@@ -52,7 +52,7 @@ public interface HttpAsyncRequestHandler
      * the request and consume message content if enclosed. The consumer
      * can optionally parse or transform the message content into a structured
      * object which is then passed onto
-     * the {@link #handle(Object, HttpAsyncServiceExchange, HttpContext)}
+     * the {@link #handle(Object, HttpAsyncExchange, HttpContext)}
      * method for further processing.
      *
      * @param request the entity enclosing request.
@@ -73,7 +73,7 @@ public interface HttpAsyncRequestHandler
      * the client without blocking the I/O thread by delegating the process
      * of request handling to another service or a worker thread. HTTP response
      * can be submitted as a later a later point of time using
-     * {@link HttpAsyncServiceExchange} once response content becomes available.
+     * {@link HttpAsyncExchange} once response content becomes available.
      *
      * @param data request data returned by the request consumer.
      * @param httpExchange HTTP exchange.
@@ -84,7 +84,7 @@ public interface HttpAsyncRequestHandler
      */
     void handle(
             T data,
-            HttpAsyncServiceExchange httpExchange,
+            HttpAsyncExchange httpExchange,
             HttpContext context) throws HttpException, IOException;
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestProducer.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestProducer.java Mon Dec 26 18:34:28 2011
@@ -40,7 +40,7 @@ import org.apache.http.protocol.HttpCont
 /**
  * <tt>HttpAsyncRequestProducer</tt> is a callback interface whose methods
  * get invoked to generate an HTTP request message and to stream message
- * content to a non-blocking HTTP connection through a {@link ContentEncoder}.
+ * content to a non-blocking HTTP connection.
  * <p/>
  * Repeatable request producers capable of generating the same request
  * message more than once can be reset to their initial state by calling

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseConsumer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseConsumer.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseConsumer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseConsumer.java Mon Dec 26 18:34:28 2011
@@ -39,7 +39,7 @@ import org.apache.http.protocol.HttpCont
 /**
  * <tt>HttpAsyncResponseConsumer</tt> is a callback interface whose methods
  * get invoked to process an HTTP response message and to stream message
- * content from a non-blocking HTTP connection through a {@link ContentDecoder}.
+ * content from a non-blocking HTTP connection.
  *
  * @since 4.2
  */

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseProducer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseProducer.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseProducer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncResponseProducer.java Mon Dec 26 18:34:28 2011
@@ -39,7 +39,7 @@ import org.apache.http.protocol.HttpCont
 /**
  * <tt>HttpAsyncResponseProducer</tt> is a callback interface whose methods
  * get invoked to generate an HTTP response message and to stream message
- * content to a non-blocking HTTP connection through a {@link ContentEncoder}.
+ * content to a non-blocking HTTP connection.
  *
  * @since 4.2
  */

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncServerProtocolHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncServerProtocolHandler.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncServerProtocolHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncServerProtocolHandler.java Mon Dec 26 18:34:28 2011
@@ -246,7 +246,7 @@ public class HttpAsyncServerProtocolHand
                             HttpStatus.SC_CONTINUE, context);
                     if (this.expectationVerifier != null) {
                         conn.suspendInput();
-                        HttpAsyncServiceExchange httpex = new Exchange(
+                        HttpAsyncExchange httpex = new Exchange(
                                 request, ack, state, conn);
                         this.expectationVerifier.verify(httpex, context);
                     } else {
@@ -688,7 +688,7 @@ public class HttpAsyncServerProtocolHand
 
     }
 
-    static class Exchange implements HttpAsyncServiceExchange {
+    static class Exchange implements HttpAsyncExchange {
 
         private final HttpRequest request;
         private final HttpResponse response;

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/NullRequestHandler.java Mon Dec 26 18:34:28 2011
@@ -46,7 +46,7 @@ class NullRequestHandler implements Http
 
     public void handle(
             final Object obj,
-            final HttpAsyncServiceExchange httpexchange,
+            final HttpAsyncExchange httpexchange,
             final HttpContext context) {
         HttpResponse response = httpexchange.getResponse();
         response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java Mon Dec 26 18:34:28 2011
@@ -64,7 +64,7 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.protocol.HttpAsyncRequestHandler;
 import org.apache.http.nio.protocol.HttpAsyncRequestHandlerRegistry;
 import org.apache.http.nio.protocol.HttpAsyncRequestHandlerResolver;
-import org.apache.http.nio.protocol.HttpAsyncServiceExchange;
+import org.apache.http.nio.protocol.HttpAsyncExchange;
 import org.apache.http.nio.protocol.HttpAsyncServerProtocolHandler;
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
@@ -391,7 +391,7 @@ public class TestHttpAsyncHandlers exten
         HttpAsyncExpectationVerifier expectationVerifier = new HttpAsyncExpectationVerifier() {
 
             public void verify(
-                    final HttpAsyncServiceExchange httpexchange,
+                    final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException {
                 HttpRequest request = httpexchange.getRequest();
                 ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
@@ -474,7 +474,7 @@ public class TestHttpAsyncHandlers exten
 
             public void handle(
                     final HttpRequest request,
-                    final HttpAsyncServiceExchange httpexchange,
+                    final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException, IOException {
                 ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
                 if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
@@ -534,7 +534,7 @@ public class TestHttpAsyncHandlers exten
         HttpAsyncExpectationVerifier expectationVerifier = new HttpAsyncExpectationVerifier() {
 
             public void verify(
-                    final HttpAsyncServiceExchange httpexchange,
+                    final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException {
                 new Thread() {
                     @Override
@@ -622,7 +622,7 @@ public class TestHttpAsyncHandlers exten
 
             public void handle(
                     final HttpRequest request,
-                    final HttpAsyncServiceExchange httpexchange,
+                    final HttpAsyncExchange httpexchange,
                     final HttpContext context) throws HttpException, IOException {
                 throw new HttpException("Boom");
             }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBasicAsyncRequestHandler.java Mon Dec 26 18:34:28 2011
@@ -48,7 +48,7 @@ public class TestBasicAsyncRequestHandle
     private HttpContext context;
     private HttpRequest request;
     private HttpResponse response;
-    private HttpAsyncServiceExchange httpexchange;
+    private HttpAsyncExchange httpexchange;
 
     @Before
     public void setUp() throws Exception {
@@ -57,7 +57,7 @@ public class TestBasicAsyncRequestHandle
         this.context = new BasicHttpContext();
         this.request = Mockito.mock(HttpRequest.class);
         this.response = Mockito.mock(HttpResponse.class);
-        this.httpexchange = Mockito.mock(HttpAsyncServiceExchange.class);
+        this.httpexchange = Mockito.mock(HttpAsyncExchange.class);
         Mockito.when(this.httpexchange.getRequest()).thenReturn(this.request);
         Mockito.when(this.httpexchange.getResponse()).thenReturn(this.response);
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncServerProtocolHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncServerProtocolHandler.java?rev=1224785&r1=1224784&r2=1224785&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncServerProtocolHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestHttpAsyncServerProtocolHandler.java Mon Dec 26 18:34:28 2011
@@ -308,7 +308,7 @@ public class TestHttpAsyncServerProtocol
         Mockito.verify(this.requestConsumer).requestCompleted(exchangeContext);
         Mockito.verify(this.requestHandler).handle(
                 Mockito.eq(data),
-                Mockito.any(HttpAsyncServiceExchange.class),
+                Mockito.any(HttpAsyncExchange.class),
                 Mockito.eq(exchangeContext));
     }
 
@@ -433,7 +433,7 @@ public class TestHttpAsyncServerProtocol
         Mockito.verify(this.requestConsumer).requestReceived(request);
         Mockito.verify(this.conn).suspendInput();
         Mockito.verify(expectationVerifier).verify(
-                Mockito.any(HttpAsyncServiceExchange.class),
+                Mockito.any(HttpAsyncExchange.class),
                 Mockito.eq(exchangeContext));
     }
 
@@ -443,7 +443,7 @@ public class TestHttpAsyncServerProtocol
         state.setRequestState(MessageState.ACK_EXPECTED);
         this.connContext.setAttribute(HttpAsyncServerProtocolHandler.HTTP_EXCHANGE_STATE, state);
 
-        HttpAsyncServiceExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
+        HttpAsyncExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
                 new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1),
                 new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"),
                 state, this.conn);
@@ -470,7 +470,7 @@ public class TestHttpAsyncServerProtocol
         state.setRequestState(MessageState.ACK_EXPECTED);
         this.connContext.setAttribute(HttpAsyncServerProtocolHandler.HTTP_EXCHANGE_STATE, state);
 
-        HttpAsyncServiceExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
+        HttpAsyncExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
                 new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1),
                 new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"),
                 state, this.conn);
@@ -483,7 +483,7 @@ public class TestHttpAsyncServerProtocol
         state.setRequestState(MessageState.ACK_EXPECTED);
         this.connContext.setAttribute(HttpAsyncServerProtocolHandler.HTTP_EXCHANGE_STATE, state);
 
-        HttpAsyncServiceExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
+        HttpAsyncExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
                 new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1),
                 new BasicHttpResponse(HttpVersion.HTTP_1_1, 100, "Continue"),
                 state, this.conn);
@@ -553,7 +553,7 @@ public class TestHttpAsyncServerProtocol
         Mockito.verify(this.requestConsumer).requestCompleted(exchangeContext);
         Mockito.verify(this.requestHandler).handle(
                 Mockito.eq(data),
-                Mockito.any(HttpAsyncServiceExchange.class),
+                Mockito.any(HttpAsyncExchange.class),
                 Mockito.eq(exchangeContext));
     }
 
@@ -584,7 +584,7 @@ public class TestHttpAsyncServerProtocol
         Mockito.verify(this.conn).requestOutput();
         Mockito.verify(this.requestHandler, Mockito.never()).handle(
                 Mockito.any(),
-                Mockito.any(HttpAsyncServiceExchange.class),
+                Mockito.any(HttpAsyncExchange.class),
                 Mockito.any(HttpContext.class));
     }
 
@@ -606,7 +606,7 @@ public class TestHttpAsyncServerProtocol
         Mockito.doThrow(new UnsupportedHttpVersionException()).when(
                 this.requestHandler).handle(
                         Mockito.eq(data),
-                        Mockito.any(HttpAsyncServiceExchange.class),
+                        Mockito.any(HttpAsyncExchange.class),
                         Mockito.eq(exchangeContext));
 
         this.protocolHandler.inputReady(conn, this.decoder);
@@ -854,7 +854,7 @@ public class TestHttpAsyncServerProtocol
         state.setResponseState(MessageState.READY);
         this.connContext.setAttribute(HttpAsyncServerProtocolHandler.HTTP_EXCHANGE_STATE, state);
 
-        HttpAsyncServiceExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
+        HttpAsyncExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
                 new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1),
                 new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"),
                 state, this.conn);
@@ -881,7 +881,7 @@ public class TestHttpAsyncServerProtocol
         state.setRequestState(MessageState.ACK_EXPECTED);
         this.connContext.setAttribute(HttpAsyncServerProtocolHandler.HTTP_EXCHANGE_STATE, state);
 
-        HttpAsyncServiceExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
+        HttpAsyncExchange httpexchanage = new HttpAsyncServerProtocolHandler.Exchange(
                 new BasicHttpRequest("GET", "/", HttpVersion.HTTP_1_1),
                 new BasicHttpResponse(HttpVersion.HTTP_1_1, 200, "OK"),
                 state, this.conn);