hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r937477 [5/9] - in /httpcomponents/httpcore/trunk/httpcore-nio/src: main/java/org/apache/http/impl/nio/ main/java/org/apache/http/impl/nio/codecs/ main/java/org/apache/http/impl/nio/reactor/ main/java/org/apache/http/impl/nio/ssl/ main/java...
Date Fri, 23 Apr 2010 19:11:57 GMT
Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java Fri Apr 23 19:11:53 2010
@@ -61,31 +61,31 @@ import org.apache.http.protocol.HttpCont
 import org.apache.http.protocol.HttpProcessor;
 
 /**
- * Client protocol handler implementation that provide compatibility with 
- * the blocking I/O by utilizing shared content buffers and a fairly small pool 
- * of worker threads. The throttling protocol handler allocates input / output 
- * buffers of a constant length upon initialization and controls the rate of 
- * I/O events in order to ensure those content buffers do not ever get 
- * overflown. This helps ensure nearly constant memory footprint for HTTP 
- * connections and avoid the out of memory condition while streaming content 
+ * Client protocol handler implementation that provide compatibility with
+ * the blocking I/O by utilizing shared content buffers and a fairly small pool
+ * of worker threads. The throttling protocol handler allocates input / output
+ * buffers of a constant length upon initialization and controls the rate of
+ * I/O events in order to ensure those content buffers do not ever get
+ * overflown. This helps ensure nearly constant memory footprint for HTTP
+ * connections and avoid the out of memory condition while streaming content
  * in and out. The {@link HttpRequestExecutionHandler#handleResponse(HttpResponse, HttpContext)}
- * method will fire immediately when a message is received. The protocol handler 
- * delegate the task of processing requests and generating response content to 
- * an {@link Executor}, which is expected to perform those tasks using 
- * dedicated worker threads in order to avoid blocking the I/O thread.  
+ * method will fire immediately when a message is received. The protocol handler
+ * delegate the task of processing requests and generating response content to
+ * an {@link Executor}, which is expected to perform those tasks using
+ * dedicated worker threads in order to avoid blocking the I/O thread.
  * <p/>
- * Usually throttling protocol handlers need only a modest number of worker 
- * threads, much fewer than the number of concurrent connections. If the length 
- * of the message is smaller or about the size of the shared content buffer 
- * worker thread will just store content in the buffer and terminate almost 
- * immediately without blocking. The I/O dispatch thread in its turn will take 
- * care of sending out the buffered content asynchronously. The worker thread 
- * will have to block only when processing large messages and the shared buffer 
- * fills up. It is generally advisable to allocate shared buffers of a size of 
+ * Usually throttling protocol handlers need only a modest number of worker
+ * threads, much fewer than the number of concurrent connections. If the length
+ * of the message is smaller or about the size of the shared content buffer
+ * worker thread will just store content in the buffer and terminate almost
+ * immediately without blocking. The I/O dispatch thread in its turn will take
+ * care of sending out the buffered content asynchronously. The worker thread
+ * will have to block only when processing large messages and the shared buffer
+ * fills up. It is generally advisable to allocate shared buffers of a size of
  * an average content body for optimal performance.
  * <p>
- * The following parameters can be used to customize the behavior of this 
- * class: 
+ * The following parameters can be used to customize the behavior of this
+ * class:
  * <ul>
  *  <li>{@link org.apache.http.params.CoreProtocolPNames#WAIT_FOR_CONTINUE}</li>
  *  <li>{@link org.apache.http.nio.params.NIOReactorPNames#CONTENT_BUFFER_SIZE}</li>
@@ -98,9 +98,9 @@ public class ThrottlingHttpClientHandler
 
     protected HttpRequestExecutionHandler execHandler;
     protected final Executor executor;
-    
+
     public ThrottlingHttpClientHandler(
-            final HttpProcessor httpProcessor, 
+            final HttpProcessor httpProcessor,
             final HttpRequestExecutionHandler execHandler,
             final ConnectionReuseStrategy connStrategy,
             final ByteBufferAllocator allocator,
@@ -116,38 +116,38 @@ public class ThrottlingHttpClientHandler
         this.execHandler = execHandler;
         this.executor = executor;
     }
-    
+
     public ThrottlingHttpClientHandler(
-            final HttpProcessor httpProcessor, 
+            final HttpProcessor httpProcessor,
             final HttpRequestExecutionHandler execHandler,
             final ConnectionReuseStrategy connStrategy,
             final Executor executor,
             final HttpParams params) {
-        this(httpProcessor, execHandler, connStrategy, 
+        this(httpProcessor, execHandler, connStrategy,
                 new DirectByteBufferAllocator(), executor, params);
     }
-    
+
     public void connected(final NHttpClientConnection conn, final Object attachment) {
         HttpContext context = conn.getContext();
 
         initialize(conn, attachment);
-        
+
         int bufsize = this.params.getIntParameter(
                 NIOReactorPNames.CONTENT_BUFFER_SIZE, 20480);
-        ClientConnState connState = new ClientConnState(bufsize, conn, this.allocator); 
+        ClientConnState connState = new ClientConnState(bufsize, conn, this.allocator);
         context.setAttribute(CONN_STATE, connState);
 
         if (this.eventListener != null) {
             this.eventListener.connectionOpen(conn);
         }
-        
-        requestReady(conn);        
+
+        requestReady(conn);
     }
 
     public void closed(final NHttpClientConnection conn) {
         HttpContext context = conn.getContext();
         ClientConnState connState = (ClientConnState) context.getAttribute(CONN_STATE);
-        
+
         if (connState != null) {
             synchronized (connState) {
                 connState.close();
@@ -158,9 +158,9 @@ public class ThrottlingHttpClientHandler
         if (this.eventListener != null) {
             this.eventListener.connectionClosed(conn);
         }
-        
+
         this.execHandler.finalizeContext(context);
-        
+
         if (this.eventListener != null) {
             this.eventListener.connectionClosed(conn);
         }
@@ -180,12 +180,12 @@ public class ThrottlingHttpClientHandler
         }
     }
 
-    
+
     public void requestReady(final NHttpClientConnection conn) {
         HttpContext context = conn.getContext();
 
         ClientConnState connState = (ClientConnState) context.getAttribute(CONN_STATE);
-        
+
         try {
 
             synchronized (connState) {
@@ -197,18 +197,18 @@ public class ThrottlingHttpClientHandler
                 if (request == null) {
                     return;
                 }
-                
+
                 request.setParams(
                         new DefaultedHttpParams(request.getParams(), this.params));
-                
+
                 context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
                 this.httpProcessor.process(request, context);
                 connState.setRequest(request);
                 conn.submitRequest(request);
                 connState.setOutputState(ClientConnState.REQUEST_SENT);
-                
+
                 conn.requestInput();
-                
+
                 if (request instanceof HttpEntityEnclosingRequest) {
                     if (((HttpEntityEnclosingRequest) request).expectContinue()) {
                         int timeout = conn.getSocketTimeout();
@@ -224,10 +224,10 @@ public class ThrottlingHttpClientHandler
                                 conn);
                     }
                 }
-                
+
                 connState.notifyAll();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
@@ -263,7 +263,7 @@ public class ThrottlingHttpClientHandler
 
                 connState.notifyAll();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
@@ -277,18 +277,18 @@ public class ThrottlingHttpClientHandler
         ClientConnState connState = (ClientConnState) context.getAttribute(CONN_STATE);
 
         try {
-            
+
             synchronized (connState) {
                 HttpResponse response = conn.getHttpResponse();
                 response.setParams(
                         new DefaultedHttpParams(response.getParams(), this.params));
-                
+
                 HttpRequest request = connState.getRequest();
-                
+
                 int statusCode = response.getStatusLine().getStatusCode();
                 if (statusCode < HttpStatus.SC_OK) {
                     // 1xx intermediate response
-                    if (statusCode == HttpStatus.SC_CONTINUE 
+                    if (statusCode == HttpStatus.SC_CONTINUE
                             && connState.getOutputState() == ClientConnState.EXPECT_CONTINUE) {
                         connState.setOutputState(ClientConnState.REQUEST_SENT);
                         continueRequest(conn, connState);
@@ -297,19 +297,19 @@ public class ThrottlingHttpClientHandler
                 } else {
                     connState.setResponse(response);
                     connState.setInputState(ClientConnState.RESPONSE_RECEIVED);
-                    
+
                     if (connState.getOutputState() == ClientConnState.EXPECT_CONTINUE) {
                         int timeout = connState.getTimeout();
                         conn.setSocketTimeout(timeout);
                         conn.resetOutput();
                     }
                 }
-                
+
                 if (!canResponseHaveBody(request, response)) {
                     conn.resetInput();
                     response.setEntity(null);
                     connState.setInputState(ClientConnState.RESPONSE_DONE);
-                    
+
                     if (!this.connStrategy.keepAlive(response, context)) {
                         conn.close();
                     }
@@ -317,19 +317,19 @@ public class ThrottlingHttpClientHandler
 
                 if (response.getEntity() != null) {
                     response.setEntity(new ContentBufferEntity(
-                            response.getEntity(), 
+                            response.getEntity(),
                             connState.getInbuffer()));
                 }
-                
+
                 context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
-                
+
                 this.httpProcessor.process(response, context);
-                
+
                 handleResponse(response, connState, conn);
-                
+
                 connState.notifyAll();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
@@ -356,7 +356,7 @@ public class ThrottlingHttpClientHandler
                 buffer.consumeContent(decoder);
                 if (decoder.isCompleted()) {
                     connState.setInputState(ClientConnState.RESPONSE_BODY_DONE);
-                    
+
                     if (!this.connStrategy.keepAlive(response, context)) {
                         conn.close();
                     }
@@ -366,7 +366,7 @@ public class ThrottlingHttpClientHandler
 
                 connState.notifyAll();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
@@ -380,17 +380,17 @@ public class ThrottlingHttpClientHandler
         ClientConnState connState = (ClientConnState) context.getAttribute(CONN_STATE);
 
         try {
-            
+
             synchronized (connState) {
                 if (connState.getOutputState() == ClientConnState.EXPECT_CONTINUE) {
                     connState.setOutputState(ClientConnState.REQUEST_SENT);
                     continueRequest(conn, connState);
-                    
+
                     connState.notifyAll();
                     return;
                 }
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
@@ -400,7 +400,7 @@ public class ThrottlingHttpClientHandler
 
         handleTimeout(conn);
     }
-    
+
     private void initialize(
             final NHttpClientConnection conn,
             final Object attachment) {
@@ -409,9 +409,9 @@ public class ThrottlingHttpClientHandler
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         this.execHandler.initalizeContext(context, attachment);
     }
-    
+
     private void continueRequest(
-            final NHttpClientConnection conn, 
+            final NHttpClientConnection conn,
             final ClientConnState connState) throws IOException {
 
         HttpRequest request = connState.getRequest();
@@ -424,9 +424,9 @@ public class ThrottlingHttpClientHandler
                 connState,
                 conn);
     }
-    
+
     /**
-     * @throws IOException - not thrown currently 
+     * @throws IOException - not thrown currently
      */
     private void sendRequestBody(
             final HttpEntityEnclosingRequest request,
@@ -434,13 +434,13 @@ public class ThrottlingHttpClientHandler
             final NHttpClientConnection conn) throws IOException {
         HttpEntity entity = request.getEntity();
         if (entity != null) {
-            
+
             this.executor.execute(new Runnable() {
-                
+
                 public void run() {
                     try {
 
-                        // Block until previous request is fully processed and 
+                        // Block until previous request is fully processed and
                         // the worker thread no longer holds the shared buffer
                         synchronized (connState) {
                             try {
@@ -460,7 +460,7 @@ public class ThrottlingHttpClientHandler
                             }
                             connState.setWorkerRunning(true);
                         }
-                        
+
                         HttpEntity entity = request.getEntity();
                         OutputStream outstream = new ContentOutputStream(
                                 connState.getOutbuffer());
@@ -472,7 +472,7 @@ public class ThrottlingHttpClientHandler
                             connState.setWorkerRunning(false);
                             connState.notifyAll();
                         }
-                        
+
                     } catch (IOException ex) {
                         shutdownConnection(conn, ex);
                         if (eventListener != null) {
@@ -480,24 +480,24 @@ public class ThrottlingHttpClientHandler
                         }
                     }
                 }
-                
+
             });
         }
     }
-    
+
     private void handleResponse(
             final HttpResponse response,
             final ClientConnState connState,
             final NHttpClientConnection conn) {
 
         final HttpContext context = conn.getContext();
-        
+
         this.executor.execute(new Runnable() {
-            
+
             public void run() {
                 try {
 
-                    // Block until previous request is fully processed and 
+                    // Block until previous request is fully processed and
                     // the worker thread no longer holds the shared buffer
                     synchronized (connState) {
                         try {
@@ -517,11 +517,11 @@ public class ThrottlingHttpClientHandler
                         }
                         connState.setWorkerRunning(true);
                     }
-                    
+
                     execHandler.handleResponse(response, context);
-                    
+
                     synchronized (connState) {
-                        
+
                         try {
                             for (;;) {
                                 int currentState = connState.getInputState();
@@ -536,7 +536,7 @@ public class ThrottlingHttpClientHandler
                         } catch (InterruptedException ex) {
                             connState.shutdown();
                         }
-                        
+
                         connState.resetInput();
                         connState.resetOutput();
                         if (conn.isOpen()) {
@@ -545,7 +545,7 @@ public class ThrottlingHttpClientHandler
                         connState.setWorkerRunning(false);
                         connState.notifyAll();
                     }
-                    
+
                 } catch (IOException ex) {
                     shutdownConnection(conn, ex);
                     if (eventListener != null) {
@@ -553,13 +553,13 @@ public class ThrottlingHttpClientHandler
                     }
                 }
             }
-            
+
         });
-        
+
     }
-    
+
     static class ClientConnState {
-        
+
         public static final int SHUTDOWN                   = -1;
         public static final int READY                      = 0;
         public static final int REQUEST_SENT               = 1;
@@ -570,23 +570,23 @@ public class ThrottlingHttpClientHandler
         public static final int RESPONSE_BODY_STREAM       = 32;
         public static final int RESPONSE_BODY_DONE         = 64;
         public static final int RESPONSE_DONE              = 64;
-        
-        private final SharedInputBuffer inbuffer; 
+
+        private final SharedInputBuffer inbuffer;
         private final SharedOutputBuffer outbuffer;
 
         private volatile int inputState;
         private volatile int outputState;
-        
+
         private volatile HttpRequest request;
         private volatile HttpResponse response;
 
         private volatile int timeout;
 
-        private volatile boolean workerRunning; 
-        
+        private volatile boolean workerRunning;
+
         public ClientConnState(
-                int bufsize, 
-                final IOControl ioControl, 
+                int bufsize,
+                final IOControl ioControl,
                 final ByteBufferAllocator allocator) {
             super();
             this.inbuffer = new SharedInputBuffer(bufsize, ioControl, allocator);
@@ -602,7 +602,7 @@ public class ThrottlingHttpClientHandler
         public ContentOutputBuffer getOutbuffer() {
             return this.outbuffer;
         }
-        
+
         public int getInputState() {
             return this.inputState;
         }
@@ -642,7 +642,7 @@ public class ThrottlingHttpClientHandler
         public void setTimeout(int timeout) {
             this.timeout = timeout;
         }
-            
+
         public boolean isWorkerRunning() {
             return this.workerRunning;
         }
@@ -670,13 +670,13 @@ public class ThrottlingHttpClientHandler
             this.request = null;
             this.inputState = READY;
         }
-        
+
         public void resetOutput() {
             this.outbuffer.reset();
             this.response = null;
             this.outputState = READY;
         }
-        
+
     }
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java Fri Apr 23 19:11:53 2010
@@ -72,31 +72,31 @@ import org.apache.http.util.EncodingUtil
 import org.apache.http.util.EntityUtils;
 
 /**
- * Service protocol handler implementation that provide compatibility with 
- * the blocking I/O by utilizing shared content buffers and a fairly small pool 
- * of worker threads. The throttling protocol handler allocates input / output 
- * buffers of a constant length upon initialization and controls the rate of 
- * I/O events in order to ensure those content buffers do not ever get 
- * overflown. This helps ensure nearly constant memory footprint for HTTP 
- * connections and avoid the out of memory condition while streaming content 
+ * Service protocol handler implementation that provide compatibility with
+ * the blocking I/O by utilizing shared content buffers and a fairly small pool
+ * of worker threads. The throttling protocol handler allocates input / output
+ * buffers of a constant length upon initialization and controls the rate of
+ * I/O events in order to ensure those content buffers do not ever get
+ * overflown. This helps ensure nearly constant memory footprint for HTTP
+ * connections and avoid the out of memory condition while streaming content
  * in and out. The {@link HttpRequestHandler#handle(HttpRequest, HttpResponse, HttpContext)}
- * method will fire immediately when a message is received. The protocol handler 
- * delegate the task of processing requests and generating response content to 
- * an {@link Executor}, which is expected to perform those tasks using 
- * dedicated worker threads in order to avoid blocking the I/O thread.  
+ * method will fire immediately when a message is received. The protocol handler
+ * delegate the task of processing requests and generating response content to
+ * an {@link Executor}, which is expected to perform those tasks using
+ * dedicated worker threads in order to avoid blocking the I/O thread.
  * <p/>
- * Usually throttling protocol handlers need only a modest number of worker 
- * threads, much fewer than the number of concurrent connections. If the length 
- * of the message is smaller or about the size of the shared content buffer 
- * worker thread will just store content in the buffer and terminate almost 
- * immediately without blocking. The I/O dispatch thread in its turn will take 
- * care of sending out the buffered content asynchronously. The worker thread 
- * will have to block only when processing large messages and the shared buffer 
- * fills up. It is generally advisable to allocate shared buffers of a size of 
+ * Usually throttling protocol handlers need only a modest number of worker
+ * threads, much fewer than the number of concurrent connections. If the length
+ * of the message is smaller or about the size of the shared content buffer
+ * worker thread will just store content in the buffer and terminate almost
+ * immediately without blocking. The I/O dispatch thread in its turn will take
+ * care of sending out the buffered content asynchronously. The worker thread
+ * will have to block only when processing large messages and the shared buffer
+ * fills up. It is generally advisable to allocate shared buffers of a size of
  * an average content body for optimal performance.
- * 
+ *
  * @see NIOReactorPNames#CONTENT_BUFFER_SIZE
- * 
+ *
  *
  * @since 4.0
  */
@@ -108,9 +108,9 @@ public class ThrottlingHttpServiceHandle
 
     protected HttpRequestHandlerResolver handlerResolver;
     protected HttpExpectationVerifier expectationVerifier;
-    
+
     public ThrottlingHttpServiceHandler(
-            final HttpProcessor httpProcessor, 
+            final HttpProcessor httpProcessor,
             final HttpResponseFactory responseFactory,
             final ConnectionReuseStrategy connStrategy,
             final ByteBufferAllocator allocator,
@@ -128,19 +128,19 @@ public class ThrottlingHttpServiceHandle
     }
 
     public ThrottlingHttpServiceHandler(
-            final HttpProcessor httpProcessor, 
+            final HttpProcessor httpProcessor,
             final HttpResponseFactory responseFactory,
             final ConnectionReuseStrategy connStrategy,
             final Executor executor,
             final HttpParams params) {
-        this(httpProcessor, responseFactory, connStrategy, 
+        this(httpProcessor, responseFactory, connStrategy,
                 new DirectByteBufferAllocator(), executor, params);
     }
 
     public void setHandlerResolver(final HttpRequestHandlerResolver handlerResolver) {
         this.handlerResolver = handlerResolver;
     }
-    
+
     public void setExpectationVerifier(final HttpExpectationVerifier expectationVerifier) {
         this.expectationVerifier = expectationVerifier;
     }
@@ -150,7 +150,7 @@ public class ThrottlingHttpServiceHandle
 
         int bufsize = this.params.getIntParameter(
                 NIOReactorPNames.CONTENT_BUFFER_SIZE, 20480);
-        ServerConnState connState = new ServerConnState(bufsize, conn, allocator); 
+        ServerConnState connState = new ServerConnState(bufsize, conn, allocator);
         context.setAttribute(CONN_STATE, connState);
 
         if (this.eventListener != null) {
@@ -161,7 +161,7 @@ public class ThrottlingHttpServiceHandle
     public void closed(final NHttpServerConnection conn) {
         HttpContext context = conn.getContext();
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
-        
+
         if (connState != null) {
             synchronized (connState) {
                 connState.close();
@@ -173,7 +173,7 @@ public class ThrottlingHttpServiceHandle
             this.eventListener.connectionClosed(conn);
         }
     }
-    
+
     public void exception(final NHttpServerConnection conn, final HttpException httpex) {
         if (conn.isResponseSubmitted()) {
             if (eventListener != null) {
@@ -181,30 +181,30 @@ public class ThrottlingHttpServiceHandle
             }
             return;
         }
-        
+
         HttpContext context = conn.getContext();
-        
+
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
-        
+
         try {
 
             HttpResponse response = this.responseFactory.newHttpResponse(
-                    HttpVersion.HTTP_1_0, 
-                    HttpStatus.SC_INTERNAL_SERVER_ERROR, 
+                    HttpVersion.HTTP_1_0,
+                    HttpStatus.SC_INTERNAL_SERVER_ERROR,
                     context);
             response.setParams(
                     new DefaultedHttpParams(response.getParams(), this.params));
             handleException(httpex, response);
             response.setEntity(null);
-            
+
             this.httpProcessor.process(response, context);
-            
+
             synchronized (connState) {
                 connState.setResponse(response);
                 // Response is ready to be committed
                 conn.requestOutput();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (eventListener != null) {
@@ -232,7 +232,7 @@ public class ThrottlingHttpServiceHandle
 
     public void requestReceived(final NHttpServerConnection conn) {
         HttpContext context = conn.getContext();
-        
+
         final HttpRequest request = conn.getHttpRequest();
         final ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
 
@@ -244,18 +244,18 @@ public class ThrottlingHttpServiceHandle
                     contentExpected = true;
                 }
             }
-            
+
             if (!contentExpected) {
                 conn.suspendInput();
             }
-            
+
             this.executor.execute(new Runnable() {
-                
+
                 public void run() {
                     try {
 
                         handleRequest(request, connState, conn);
-                        
+
                     } catch (IOException ex) {
                         shutdownConnection(conn, ex);
                         if (eventListener != null) {
@@ -268,19 +268,19 @@ public class ThrottlingHttpServiceHandle
                         }
                     }
                 }
-                
+
             });
-        
+
             connState.notifyAll();
         }
-        
+
     }
 
     public void inputReady(final NHttpServerConnection conn, final ContentDecoder decoder) {
         HttpContext context = conn.getContext();
 
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
-        
+
         try {
 
             synchronized (connState) {
@@ -292,27 +292,27 @@ public class ThrottlingHttpServiceHandle
                 } else {
                     connState.setInputState(ServerConnState.REQUEST_BODY_STREAM);
                 }
-                
+
                 connState.notifyAll();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
                 this.eventListener.fatalIOException(ex, conn);
             }
         }
-        
+
     }
-    
+
     public void responseReady(final NHttpServerConnection conn) {
         HttpContext context = conn.getContext();
 
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
 
         try {
-            
-            synchronized (connState) {                
+
+            synchronized (connState) {
                 if (connState.isExpectationFailed()) {
                     // Server expection failed
                     // Well-behaved client will not be sending
@@ -320,10 +320,10 @@ public class ThrottlingHttpServiceHandle
                     conn.resetInput();
                     connState.setExpectationFailed(false);
                 }
-                
+
                 HttpResponse response = connState.getResponse();
-                if (connState.getOutputState() == ServerConnState.READY 
-                        && response != null 
+                if (connState.getOutputState() == ServerConnState.READY
+                        && response != null
                         && !conn.isResponseSubmitted()) {
 
                     conn.submitResponse(response);
@@ -340,7 +340,7 @@ public class ThrottlingHttpServiceHandle
                         connState.setOutputState(ServerConnState.RESPONSE_SENT);
                     }
                 }
-                
+
                 connState.notifyAll();
             }
 
@@ -361,13 +361,13 @@ public class ThrottlingHttpServiceHandle
         HttpContext context = conn.getContext();
 
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
-        
+
         try {
 
             synchronized (connState) {
                 HttpResponse response = connState.getResponse();
                 ContentOutputBuffer buffer = connState.getOutbuffer();
-                
+
                 buffer.produceContent(encoder);
                 if (encoder.isCompleted()) {
                     connState.setOutputState(ServerConnState.RESPONSE_BODY_DONE);
@@ -378,10 +378,10 @@ public class ThrottlingHttpServiceHandle
                 } else {
                     connState.setOutputState(ServerConnState.RESPONSE_BODY_STREAM);
                 }
-                
+
                 connState.notifyAll();
             }
-            
+
         } catch (IOException ex) {
             shutdownConnection(conn, ex);
             if (this.eventListener != null) {
@@ -389,7 +389,7 @@ public class ThrottlingHttpServiceHandle
             }
         }
     }
- 
+
     private void handleException(final HttpException ex, final HttpResponse response) {
         if (ex instanceof MethodNotSupportedException) {
             response.setStatusCode(HttpStatus.SC_NOT_IMPLEMENTED);
@@ -405,7 +405,7 @@ public class ThrottlingHttpServiceHandle
         entity.setContentType("text/plain; charset=US-ASCII");
         response.setEntity(entity);
     }
-    
+
     private void handleRequest(
             final HttpRequest request,
             final ServerConnState connState,
@@ -413,7 +413,7 @@ public class ThrottlingHttpServiceHandle
 
         HttpContext context = conn.getContext();
 
-        // Block until previous request is fully processed and 
+        // Block until previous request is fully processed and
         // the worker thread no longer holds the shared buffer
         synchronized (connState) {
             try {
@@ -443,7 +443,7 @@ public class ThrottlingHttpServiceHandle
         ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
 
         if (!ver.lessEquals(HttpVersion.HTTP_1_1)) {
-            // Downgrade protocol version if greater than HTTP/1.1 
+            // Downgrade protocol version if greater than HTTP/1.1
             ver = HttpVersion.HTTP_1_1;
         }
 
@@ -451,11 +451,11 @@ public class ThrottlingHttpServiceHandle
 
         if (request instanceof HttpEntityEnclosingRequest) {
             HttpEntityEnclosingRequest eeRequest = (HttpEntityEnclosingRequest) request;
-            
+
             if (eeRequest.expectContinue()) {
                 response = this.responseFactory.newHttpResponse(
-                        ver, 
-                        HttpStatus.SC_CONTINUE, 
+                        ver,
+                        HttpStatus.SC_CONTINUE,
                         context);
                 response.setParams(
                         new DefaultedHttpParams(response.getParams(), this.params));
@@ -463,7 +463,7 @@ public class ThrottlingHttpServiceHandle
                     try {
                         this.expectationVerifier.verify(request, response, context);
                     } catch (HttpException ex) {
-                        response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 
+                        response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0,
                                 HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
                         response.setParams(
                                 new DefaultedHttpParams(response.getParams(), this.params));
@@ -477,7 +477,7 @@ public class ThrottlingHttpServiceHandle
                         // have been met
                         connState.setResponse(response);
                         conn.requestOutput();
-                        
+
                         // Block until 1xx response is sent to the client
                         try {
                             for (;;) {
@@ -508,22 +508,22 @@ public class ThrottlingHttpServiceHandle
             // Create a wrapper entity instead of the original one
             if (eeRequest.getEntity() != null) {
                 eeRequest.setEntity(new ContentBufferEntity(
-                        eeRequest.getEntity(), 
+                        eeRequest.getEntity(),
                         connState.getInbuffer()));
             }
-            
+
         }
 
         if (response == null) {
             response = this.responseFactory.newHttpResponse(
-                    ver, 
-                    HttpStatus.SC_OK, 
+                    ver,
+                    HttpStatus.SC_OK,
                     context);
             response.setParams(
                     new DefaultedHttpParams(response.getParams(), this.params));
 
             context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
-            
+
             try {
 
                 this.httpProcessor.process(request, context);
@@ -540,7 +540,7 @@ public class ThrottlingHttpServiceHandle
                 }
 
             } catch (HttpException ex) {
-                response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 
+                response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0,
                         HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
                 response.setParams(
                         new DefaultedHttpParams(response.getParams(), this.params));
@@ -553,16 +553,16 @@ public class ThrottlingHttpServiceHandle
             HttpEntity entity = eeRequest.getEntity();
             EntityUtils.consume(entity);
         }
-        
+
         // It should be safe to reset the input state at this point
         connState.resetInput();
-        
+
         this.httpProcessor.process(response, context);
 
         if (!canResponseHaveBody(request, response)) {
             response.setEntity(null);
         }
-        
+
         connState.setResponse(response);
         // Response is ready to be committed
         conn.requestOutput();
@@ -576,7 +576,7 @@ public class ThrottlingHttpServiceHandle
             outstream.flush();
             outstream.close();
         }
-        
+
         synchronized (connState) {
             try {
                 for (;;) {
@@ -598,22 +598,22 @@ public class ThrottlingHttpServiceHandle
             connState.notifyAll();
         }
     }
-    
+
     @Override
     protected void shutdownConnection(final NHttpConnection conn, final Throwable cause) {
         HttpContext context = conn.getContext();
 
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
-        
+
         super.shutdownConnection(conn, cause);
-        
+
         if (connState != null) {
             connState.shutdown();
         }
     }
-    
+
     static class ServerConnState {
-        
+
         public static final int SHUTDOWN                   = -1;
         public static final int READY                      = 0;
         public static final int REQUEST_RECEIVED           = 1;
@@ -623,21 +623,21 @@ public class ThrottlingHttpServiceHandle
         public static final int RESPONSE_BODY_STREAM       = 16;
         public static final int RESPONSE_BODY_DONE         = 32;
         public static final int RESPONSE_DONE              = 32;
-        
-        private final SharedInputBuffer inbuffer; 
+
+        private final SharedInputBuffer inbuffer;
         private final SharedOutputBuffer outbuffer;
 
         private volatile int inputState;
         private volatile int outputState;
-        
+
         private volatile HttpRequest request;
         private volatile HttpResponse response;
 
         private volatile boolean expectationFailure;
-        
+
         public ServerConnState(
-                int bufsize, 
-                final IOControl ioControl, 
+                int bufsize,
+                final IOControl ioControl,
                 final ByteBufferAllocator allocator) {
             super();
             this.inbuffer = new SharedInputBuffer(bufsize, ioControl, allocator);
@@ -653,7 +653,7 @@ public class ThrottlingHttpServiceHandle
         public ContentOutputBuffer getOutbuffer() {
             return this.outbuffer;
         }
-        
+
         public int getInputState() {
             return this.inputState;
         }
@@ -713,14 +713,14 @@ public class ThrottlingHttpServiceHandle
             this.request = null;
             this.inputState = READY;
         }
-        
+
         public void resetOutput() {
             this.outbuffer.reset();
             this.response = null;
             this.outputState = READY;
             this.expectationFailure = false;
         }
-        
-    }    
-    
+
+    }
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/package.html
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/package.html?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/package.html (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/package.html Fri Apr 23 19:11:53 2010
@@ -30,7 +30,7 @@
 -->
 </head>
 <body>
-Non-blocking HTTP protocol execution framework. This package contains protocol 
-handler implementations based on NIO model. 
+Non-blocking HTTP protocol execution framework. This package contains protocol
+handler implementations based on NIO model.
 </body>
 </html>

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ConnectingIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ConnectingIOReactor.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ConnectingIOReactor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ConnectingIOReactor.java Fri Apr 23 19:11:53 2010
@@ -30,7 +30,7 @@ package org.apache.http.nio.reactor;
 import java.net.SocketAddress;
 
 /**
- * ConnectingIOReactor represents an I/O reactor capable of establishing 
+ * ConnectingIOReactor represents an I/O reactor capable of establishing
  * connections to remote hosts.
  *
  * @since 4.0
@@ -40,28 +40,28 @@ public interface ConnectingIOReactor ext
     /**
      * Requests a connection to a remote host.
      * <p>
-     * Opening a connection to a remote host usually tends to be a time 
-     * consuming process and may take a while to complete. One can monitor and 
-     * control the process of session initialization by means of the 
+     * Opening a connection to a remote host usually tends to be a time
+     * consuming process and may take a while to complete. One can monitor and
+     * control the process of session initialization by means of the
      * {@link SessionRequest} interface.
      * <p>
-     * There are several parameters one can use to exert a greater control over 
+     * There are several parameters one can use to exert a greater control over
      * the process of session initialization:
      * <p>
-     * A non-null local socket address parameter can be used to bind the socket 
+     * A non-null local socket address parameter can be used to bind the socket
      * to a specific local address.
      * <p>
-     * An attachment object can added to the new session's context upon 
-     * initialization. This object can be used to pass an initial processing 
+     * An attachment object can added to the new session's context upon
+     * initialization. This object can be used to pass an initial processing
      * state to the protocol handler.
      * <p>
-     * It is often desirable to be able to react to the completion of a session 
-     * request asynchronously without having to wait for it, blocking the 
-     * current thread of execution. One can optionally provide an implementation 
-     * {@link SessionRequestCallback} instance to get notified of events related 
-     * to session requests, such as request completion, cancellation, failure or 
+     * It is often desirable to be able to react to the completion of a session
+     * request asynchronously without having to wait for it, blocking the
+     * current thread of execution. One can optionally provide an implementation
+     * {@link SessionRequestCallback} instance to get notified of events related
+     * to session requests, such as request completion, cancellation, failure or
      * timeout.
-     * 
+     *
      * @param remoteAddress the socket address of the remote host.
      * @param localAddress the local socket address. Can be <code>null</code>,
      *    in which can the default local address and a random port will be used.
@@ -70,9 +70,9 @@ public interface ConnectingIOReactor ext
      * @return session request object.
      */
     SessionRequest connect(
-            SocketAddress remoteAddress, 
-            SocketAddress localAddress, 
+            SocketAddress remoteAddress,
+            SocketAddress localAddress,
             Object attachment,
             SessionRequestCallback callback);
-        
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/EventMask.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/EventMask.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/EventMask.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/EventMask.java Fri Apr 23 19:11:53 2010
@@ -30,25 +30,25 @@ package org.apache.http.nio.reactor;
 import java.nio.channels.SelectionKey;
 
 /**
- * Type of I/O event notifications I/O sessions can declare interest in. 
+ * Type of I/O event notifications I/O sessions can declare interest in.
  *
  * @since 4.0
  */
 public interface EventMask {
 
     /**
-     * Interest in data input.  
+     * Interest in data input.
      */
     public static final int READ = SelectionKey.OP_READ;
 
     /**
-     * Interest in data output.  
+     * Interest in data output.
      */
     public static final int WRITE = SelectionKey.OP_WRITE;
 
     /**
-     * Interest in data input/output.  
+     * Interest in data input/output.
      */
     public static final int READ_WRITE = READ | WRITE;
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOEventDispatch.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOEventDispatch.java Fri Apr 23 19:11:53 2010
@@ -28,50 +28,50 @@
 package org.apache.http.nio.reactor;
 
 /**
- * IOEventDispatch interface is used by I/O reactors to notify clients of I/O 
- * events pending for a particular session. All methods of this interface are 
- * executed on a dispatch thread of the I/O reactor. Therefore, it is important 
- * that processing that takes place in the event methods will not block the 
- * dispatch thread for too long, as the I/O reactor will be unable to react to 
- * other events. 
+ * IOEventDispatch interface is used by I/O reactors to notify clients of I/O
+ * events pending for a particular session. All methods of this interface are
+ * executed on a dispatch thread of the I/O reactor. Therefore, it is important
+ * that processing that takes place in the event methods will not block the
+ * dispatch thread for too long, as the I/O reactor will be unable to react to
+ * other events.
  *
  * @since 4.0
  */
 public interface IOEventDispatch {
-    
+
     /**
      * Triggered after the given session has been just created.
-     * 
+     *
      * @param session the I/O session.
      */
     void connected(IOSession session);
-    
+
     /**
      * Triggered when the given session has input pending.
-     * 
+     *
      * @param session the I/O session.
      */
     void inputReady(IOSession session);
-    
+
     /**
      * Triggered when the given session is ready for output.
-     * 
+     *
      * @param session the I/O session.
      */
     void outputReady(IOSession session);
-    
+
     /**
      * Triggered when the given session as timed out.
-     * 
+     *
      * @param session the I/O session.
      */
     void timeout(IOSession session);
-    
+
     /**
      * Triggered when the given session has been terminated.
-     * 
+     *
      * @param session the I/O session.
      */
     void disconnected(IOSession session);
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactor.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactor.java Fri Apr 23 19:11:53 2010
@@ -30,18 +30,18 @@ package org.apache.http.nio.reactor;
 import java.io.IOException;
 
 /**
- * HttpCore NIO is based on the Reactor pattern as described by Doug Lea. 
- * The purpose of I/O reactors is to react to I/O events and to dispatch event 
- * notifications to individual I/O sessions. The main idea of I/O reactor 
- * pattern is to break away from the one thread per connection model imposed 
- * by the classic blocking I/O model. 
+ * HttpCore NIO is based on the Reactor pattern as described by Doug Lea.
+ * The purpose of I/O reactors is to react to I/O events and to dispatch event
+ * notifications to individual I/O sessions. The main idea of I/O reactor
+ * pattern is to break away from the one thread per connection model imposed
+ * by the classic blocking I/O model.
  * <p>
- * The IOReactor interface represents an abstract object implementing 
- * the Reactor pattern. 
+ * The IOReactor interface represents an abstract object implementing
+ * the Reactor pattern.
  * <p>
- * I/O reactors usually employ a small number of dispatch threads (often as 
- * few as one) to dispatch I/O event notifications to a much greater number 
- * (often as many as several thousands) of I/O sessions or connections. It is 
+ * I/O reactors usually employ a small number of dispatch threads (often as
+ * few as one) to dispatch I/O event notifications to a much greater number
+ * (often as many as several thousands) of I/O sessions or connections. It is
  * generally recommended to have one dispatch thread per CPU core.
  *
  * @since 4.0
@@ -50,43 +50,43 @@ public interface IOReactor {
 
     /**
      * Returns the current status of the reactor.
-     *  
+     *
      * @return reactor status.
      */
     IOReactorStatus getStatus();
-    
+
     /**
      * Starts the reactor and initiates the dispatch of I/O event notifications
      * to the given {@link IOEventDispatch}.
-     * 
+     *
      * @param eventDispatch the I/O event dispatch.
      * @throws IOException in case of an I/O error.
      */
-    void execute(IOEventDispatch eventDispatch) 
+    void execute(IOEventDispatch eventDispatch)
         throws IOException;
 
     /**
      * Initiates shutdown of the reactor and blocks approximately for the given
      * period of time in milliseconds waiting for the reactor to terminate all
-     * active connections, to shut down itself and to release system resources 
-     * it currently holds. 
-     * 
+     * active connections, to shut down itself and to release system resources
+     * it currently holds.
+     *
      * @param waitMs wait time in milliseconds.
      * @throws IOException in case of an I/O error.
      */
-    void shutdown(long waitMs) 
+    void shutdown(long waitMs)
         throws IOException;
 
     /**
-     * Initiates shutdown of the reactor and blocks for a default period of 
-     * time waiting for the reactor to terminate all active connections, to shut 
-     * down itself and to release system resources it currently holds. It is 
+     * Initiates shutdown of the reactor and blocks for a default period of
+     * time waiting for the reactor to terminate all active connections, to shut
+     * down itself and to release system resources it currently holds. It is
      * up to individual implementations to decide for how long this method can
-     * remain blocked.  
-     * 
+     * remain blocked.
+     *
      * @throws IOException in case of an I/O error.
      */
-    void shutdown() 
+    void shutdown()
         throws IOException;
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorException.java Fri Apr 23 19:11:53 2010
@@ -45,7 +45,7 @@ public class IOReactorException extends 
             initCause(cause);
         }
     }
-    
+
     public IOReactorException(final String message) {
         super(message);
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorExceptionHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorExceptionHandler.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorExceptionHandler.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorExceptionHandler.java Fri Apr 23 19:11:53 2010
@@ -30,35 +30,35 @@ package org.apache.http.nio.reactor;
 import java.io.IOException;
 
 /**
- * Abstract exception handler intended to deal with potentially recoverable 
+ * Abstract exception handler intended to deal with potentially recoverable
  * I/O exceptions thrown by an I/O reactor.
- * 
+ *
  * @since 4.0
  */
 public interface IOReactorExceptionHandler {
 
     /**
-     * This method is expected to examine the I/O exception passed as 
-     * a parameter and decide whether it is safe to continue execution of 
-     * the I/O reactor. 
-     * 
-     * @param ex potentially recoverable I/O exception 
-     * @return <code>true</code> if it is safe to ignore the exception 
+     * This method is expected to examine the I/O exception passed as
+     * a parameter and decide whether it is safe to continue execution of
+     * the I/O reactor.
+     *
+     * @param ex potentially recoverable I/O exception
+     * @return <code>true</code> if it is safe to ignore the exception
      * and continue execution of the I/O reactor; <code>false</code> if the
-     * I/O reactor must throw {@link IOReactorException} and terminate 
+     * I/O reactor must throw {@link IOReactorException} and terminate
      */
-    boolean handle(IOException ex); 
-    
+    boolean handle(IOException ex);
+
     /**
-     * This method is expected to examine the runtime exception passed as 
-     * a parameter and decide whether it is safe to continue execution of 
-     * the I/O reactor. 
-     * 
-     * @param ex potentially recoverable runtime exception 
-     * @return <code>true</code> if it is safe to ignore the exception 
+     * This method is expected to examine the runtime exception passed as
+     * a parameter and decide whether it is safe to continue execution of
+     * the I/O reactor.
+     *
+     * @param ex potentially recoverable runtime exception
+     * @return <code>true</code> if it is safe to ignore the exception
      * and continue execution of the I/O reactor; <code>false</code> if the
-     * I/O reactor must throw {@link RuntimeException} and terminate 
+     * I/O reactor must throw {@link RuntimeException} and terminate
      */
-    boolean handle(RuntimeException ex); 
-    
+    boolean handle(RuntimeException ex);
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorStatus.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorStatus.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorStatus.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOReactorStatus.java Fri Apr 23 19:11:53 2010
@@ -38,25 +38,25 @@ public enum IOReactorStatus {
      * The reactor is inactive / has not been started
      */
     INACTIVE,
-    
+
     /**
      * The reactor is active / processing I/O events.
      */
     ACTIVE,
-    
+
     /**
      * Shutdown of the reactor has been requested.
      */
     SHUTDOWN_REQUEST,
-    
+
     /**
      * The reactor is shutting down.
      */
     SHUTTING_DOWN,
-    
+
     /**
      * The reactor has shut down.
      */
     SHUT_DOWN;
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOSession.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOSession.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOSession.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/IOSession.java Fri Apr 23 19:11:53 2010
@@ -31,203 +31,203 @@ import java.net.SocketAddress;
 import java.nio.channels.ByteChannel;
 
 /**
- * IOSession interface represents a sequence of logically related data exchanges 
- * between two end points.  
+ * IOSession interface represents a sequence of logically related data exchanges
+ * between two end points.
  * <p>
- * The channel associated with implementations of this interface can be used to 
+ * The channel associated with implementations of this interface can be used to
  * read data from and write data to the session.
  * <p>
- * I/O sessions are not bound to an execution thread, therefore one cannot use 
- * the context of the thread to store a session's state. All details about 
- * a particular session must be stored within the session itself, usually 
- * using execution context associated with it. 
+ * I/O sessions are not bound to an execution thread, therefore one cannot use
+ * the context of the thread to store a session's state. All details about
+ * a particular session must be stored within the session itself, usually
+ * using execution context associated with it.
  * <p>
  * Implementations of this interface are expected to be threading safe.
- * 
+ *
  * @since 4.0
  */
 public interface IOSession {
 
-    /** 
+    /**
      * Name of the context attribute key, which can be used to obtain the
-     * session attachment object. 
+     * session attachment object.
      */
     public static final String ATTACHMENT_KEY = "http.session.attachment";
 
     public static final int ACTIVE       = 0;
     public static final int CLOSING      = 1;
     public static final int CLOSED       = Integer.MAX_VALUE;
-    
+
     /**
      * Returns the underlying I/O channel associated with this session.
-     * 
+     *
      * @return the I/O channel.
      */
     ByteChannel channel();
-    
+
     /**
      * Returns address of the remote peer.
-     * 
+     *
      * @return socket address.
      */
-    SocketAddress getRemoteAddress();    
-    
+    SocketAddress getRemoteAddress();
+
     /**
      * Returns local address.
-     * 
+     *
      * @return socket address.
      */
-    SocketAddress getLocalAddress();    
+    SocketAddress getLocalAddress();
 
     /**
-     * Returns mask of I/O evens this session declared interest in. 
-     * 
+     * Returns mask of I/O evens this session declared interest in.
+     *
      * @return I/O event mask.
      */
     int getEventMask();
-    
+
     /**
      * Declares interest in I/O event notifications by setting the event mask
      * associated with the session
-     *  
+     *
      * @param ops new I/O event mask.
      */
     void setEventMask(int ops);
-    
+
     /**
-     * Declares interest in a particular I/O event type by updating the event 
+     * Declares interest in a particular I/O event type by updating the event
      * mask associated with the session.
-     *  
+     *
      * @param op I/O event type.
      */
     void setEvent(int op);
 
     /**
-     * Clears interest in a particular I/O event type by updating the event 
+     * Clears interest in a particular I/O event type by updating the event
      * mask associated with the session.
-     *  
+     *
      * @param op I/O event type.
      */
     void clearEvent(int op);
 
     /**
      * Terminates the session gracefully and closes the underlying I/O channel.
-     * This method ensures that session termination handshake, such as the one 
+     * This method ensures that session termination handshake, such as the one
      * used by the SSL/TLS protocol, is correctly carried out.
      */
     void close();
-    
+
     /**
      * Terminates the session by shutting down the underlying I/O channel.
      */
     void shutdown();
-    
+
     /**
      * Returns status of the session:
      * <p>
      * {@link #ACTIVE}: session is active.
-     * <p> 
+     * <p>
      * {@link #CLOSING}: session is being closed.
-     * <p> 
+     * <p>
      * {@link #CLOSED}: session has been terminated.
-     * 
+     *
      * @return session status.
      */
     int getStatus();
-    
+
     /**
      * Determines if the session has been terminated.
-     *   
+     *
      * @return <code>true</code> if the session has been terminated,
-     *   <code>false</code> otherwise. 
+     *   <code>false</code> otherwise.
      */
     boolean isClosed();
 
     /**
-     * Returns value of the socket timeout in milliseconds. The value of 
+     * Returns value of the socket timeout in milliseconds. The value of
      * <code>0</code> signifies the session cannot time out.
-     *  
+     *
      * @return socket timeout.
      */
     int getSocketTimeout();
-    
+
     /**
-     * Sets value of the socket timeout in milliseconds. The value of 
+     * Sets value of the socket timeout in milliseconds. The value of
      * <code>0</code> signifies the session cannot time out.
-     *  
+     *
      * @param timeout socket timeout.
      */
     void setSocketTimeout(int timeout);
-    
+
     /**
-     * Quite often I/O sessions need to maintain internal I/O buffers in order 
-     * to transform input / output data prior to returning it to the consumer or 
-     * writing it to the underlying channel. Memory management in HttpCore NIO 
-     * is based on the fundamental principle that the data consumer can read 
-     * only as much input data as it can process without having to allocate more 
-     * memory. That means, quite often some input data may remain unread in one 
-     * of the internal or external session buffers. The I/O reactor can query 
-     * the status of these session buffers, and make sure the consumer gets 
-     * notified correctly as more data gets stored in one of the session 
-     * buffers, thus allowing the consumer to read the remaining data once it 
+     * Quite often I/O sessions need to maintain internal I/O buffers in order
+     * to transform input / output data prior to returning it to the consumer or
+     * writing it to the underlying channel. Memory management in HttpCore NIO
+     * is based on the fundamental principle that the data consumer can read
+     * only as much input data as it can process without having to allocate more
+     * memory. That means, quite often some input data may remain unread in one
+     * of the internal or external session buffers. The I/O reactor can query
+     * the status of these session buffers, and make sure the consumer gets
+     * notified correctly as more data gets stored in one of the session
+     * buffers, thus allowing the consumer to read the remaining data once it
      * is able to process it
      * <p>
-     * I/O sessions can be made aware of the status of external session buffers 
+     * I/O sessions can be made aware of the status of external session buffers
      * using the {@link SessionBufferStatus} interface.
-     * 
+     *
      * @param status
      */
     void setBufferStatus(SessionBufferStatus status);
-    
+
     /**
      * Determines if the input buffer associated with the session contains data.
-     * 
+     *
      * @return <code>true</code> if the session input buffer contains data,
      *   <code>false</code> otherwise.
      */
     boolean hasBufferedInput();
-    
+
     /**
-     * Determines if the output buffer associated with the session contains 
+     * Determines if the output buffer associated with the session contains
      * data.
-     * 
+     *
      * @return <code>true</code> if the session output buffer contains data,
      *   <code>false</code> otherwise.
      */
     boolean hasBufferedOutput();
-    
+
     /**
      * This method can be used to associate a particular object with the
      * session by the given attribute name.
      * <p>
-     * I/O sessions are not bound to an execution thread, therefore one cannot 
-     * use the context of the thread to store a session's state. All details 
+     * I/O sessions are not bound to an execution thread, therefore one cannot
+     * use the context of the thread to store a session's state. All details
      * about a particular session must be stored within the session itself.
-     * 
+     *
      * @param name name of the attribute.
      * @param obj value of the attribute.
      */
     void setAttribute(String name, Object obj);
-    
+
     /**
-     * Returns the value of the attribute with the given name. The value can be 
+     * Returns the value of the attribute with the given name. The value can be
      * <code>null</code> if not set.
      * <p>
-     * The value of the session attachment object can be obtained using 
+     * The value of the session attachment object can be obtained using
      * {@link #ATTACHMENT_KEY} name.
-     * 
+     *
      * @see #setAttribute(String, Object)
-     * 
+     *
      * @param name name of the attribute.
      * @return value of the attribute.
      */
     Object getAttribute(String name);
-    
+
     /**
-     * Removes attribute with the given name. 
-     * 
+     * Removes attribute with the given name.
+     *
      * @see #setAttribute(String, Object)
-     * 
+     *
      * @param name name of the attribute to be removed.
      * @return value of the removed attribute.
      */

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListenerEndpoint.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListenerEndpoint.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListenerEndpoint.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListenerEndpoint.java Fri Apr 23 19:11:53 2010
@@ -33,47 +33,47 @@ import java.net.SocketAddress;
 /**
  * ListenerEndpoint interface represents an endpoint used by an I/O reactor
  * to listen for incoming connection from remote clients.
- * 
+ *
  * @since 4.0
  */
 public interface ListenerEndpoint {
 
     /**
      * Returns the socket address of this endpoint.
-     * 
+     *
      * @return socket address.
      */
     SocketAddress getAddress();
-    
+
     /**
-     * Returns an instance of {@link IOException} thrown during initialization 
+     * Returns an instance of {@link IOException} thrown during initialization
      * of this endpoint or <code>null</code>, if initialization was successful.
-     * 
+     *
      * @return I/O exception object or <code>null</code>.
      */
     IOException getException();
 
     /**
      * Waits for completion of initialization process of this endpoint.
-     * 
-     * @throws InterruptedException in case the initialization process was 
+     *
+     * @throws InterruptedException in case the initialization process was
      *   interrupted.
      */
     void waitFor() throws InterruptedException;
-    
+
     /**
      * Determines if this endpoint has been closed and is no longer listens
      * for incoming connections.
-     * 
+     *
      * @return <code>true</code> if the endpoint has been closed,
      *   <code>false</code> otherwise.
      */
     boolean isClosed();
-    
+
     /**
-     * Closes this endpoint. The endpoint will stop accepting incoming 
+     * Closes this endpoint. The endpoint will stop accepting incoming
      * connection.
      */
     void close();
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListeningIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListeningIOReactor.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListeningIOReactor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/ListeningIOReactor.java Fri Apr 23 19:11:53 2010
@@ -32,25 +32,25 @@ import java.util.Set;
 import java.io.IOException;
 
 /**
- * ListeningIOReactor represents an I/O reactor capable of listening for 
+ * ListeningIOReactor represents an I/O reactor capable of listening for
  * incoming connections on one or several ports.
- * 
+ *
  * @since 4.0
  */
 public interface ListeningIOReactor extends IOReactor {
 
     /**
-     * Opens a new listener endpoint with the given socket address. Once 
-     * the endpoint is fully initialized it starts accepting incoming 
+     * Opens a new listener endpoint with the given socket address. Once
+     * the endpoint is fully initialized it starts accepting incoming
      * connections and propagates I/O activity notifications to the I/O event
-     * dispatcher. 
+     * dispatcher.
      * <p>
      * {@link ListenerEndpoint#waitFor()} can be used to wait for the
      *  listener to be come ready to accept incoming connections.
      * <p>
-     * {@link ListenerEndpoint#close()} can be used to shut down 
+     * {@link ListenerEndpoint#close()} can be used to shut down
      * the listener even before it is fully initialized.
-     * 
+     *
      * @param address the socket address to listen on.
      * @return listener endpoint.
      */
@@ -59,16 +59,16 @@ public interface ListeningIOReactor exte
     /**
      * Suspends the I/O reactor preventing it from accepting new connections on
      * all active endpoints.
-     * 
+     *
      * @throws IOException in case of an I/O error.
      */
     void pause()
         throws IOException;
 
     /**
-     * Resumes the I/O reactor restoring its ability to accept incoming 
+     * Resumes the I/O reactor restoring its ability to accept incoming
      * connections on all active endpoints.
-     * 
+     *
      * @throws IOException in case of an I/O error.
      */
     void resume()
@@ -76,9 +76,9 @@ public interface ListeningIOReactor exte
 
     /**
      * Returns a set of endpoints for this I/O reactor.
-     * 
-     * @return set of endpoints. 
+     *
+     * @return set of endpoints.
      */
     Set<ListenerEndpoint> getEndpoints();
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionBufferStatus.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionBufferStatus.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionBufferStatus.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionBufferStatus.java Fri Apr 23 19:11:53 2010
@@ -30,8 +30,8 @@
 package org.apache.http.nio.reactor;
 
 /**
- * SessionBufferStatus interface is intended to query the status of session 
- * I/O buffers. 
+ * SessionBufferStatus interface is intended to query the status of session
+ * I/O buffers.
  *
  * @since 4.0
  */
@@ -39,15 +39,15 @@ public interface SessionBufferStatus {
 
     /**
      * Determines if the session input buffer contains data.
-     * 
+     *
      * @return <code>true</code> if the session input buffer contains data,
      *   <code>false</code> otherwise.
      */
     boolean hasBufferedInput();
-    
+
     /**
      * Determines if the session output buffer contains data.
-     * 
+     *
      * @return <code>true</code> if the session output buffer contains data,
      *   <code>false</code> otherwise.
      */

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionInputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionInputBuffer.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionInputBuffer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionInputBuffer.java Fri Apr 23 19:11:53 2010
@@ -37,145 +37,145 @@ import org.apache.http.util.CharArrayBuf
 
 /**
  * Session input buffer for non-blocking connections. This interface facilitates
- * intermediate buffering of input data streamed from a source channel and 
- * reading buffered data to a destination, usually {@link ByteBuffer} or 
- * {@link WritableByteChannel}. This interface also provides methods for reading 
+ * intermediate buffering of input data streamed from a source channel and
+ * reading buffered data to a destination, usually {@link ByteBuffer} or
+ * {@link WritableByteChannel}. This interface also provides methods for reading
  * lines of text.
  *
  * @since 4.0
  */
 public interface SessionInputBuffer {
-    
+
     /**
      * Determines if the buffer contains data.
-     * 
+     *
      * @return <code>true</code> if there is data in the buffer,
      *   <code>false</code> otherwise.
      */
     boolean hasData();
-    
+
     /**
      * Returns the length of this buffer.
-     * 
+     *
      * @return buffer length.
      */
     int length();
-    
+
     /**
-     * Makes an attempt to fill the buffer with data from the given 
-     * {@link ReadableByteChannel}. 
-     * 
+     * Makes an attempt to fill the buffer with data from the given
+     * {@link ReadableByteChannel}.
+     *
      * @param src the source channel
      * @return The number of bytes read, possibly zero, or <tt>-1</tt> if the
      *   channel has reached end-of-stream.
      * @throws IOException in case of an I/O error.
      */
     int fill(ReadableByteChannel src) throws IOException;
-    
+
     /**
      * Reads one byte from the buffer. If the buffer is empty this method can
      * throw a runtime exception. The exact type of runtime exception thrown
-     * by this method depends on implementation. 
-     * 
+     * by this method depends on implementation.
+     *
      * @return one byte
      */
     int read();
-    
+
     /**
      * Reads a sequence of bytes from this buffer into the destination buffer,
-     * up to the given maximum limit. The exact number of bytes transferred 
-     * depends on availability of data in this buffer and capacity of the 
-     * destination buffer, but cannot be more than <code>maxLen</code> value.   
-     * 
+     * up to the given maximum limit. The exact number of bytes transferred
+     * depends on availability of data in this buffer and capacity of the
+     * destination buffer, but cannot be more than <code>maxLen</code> value.
+     *
      * @param dst the destination buffer.
-     * @param maxLen the maximum number of bytes to be read. 
+     * @param maxLen the maximum number of bytes to be read.
      * @return The number of bytes read, possibly zero.
      */
     int read(ByteBuffer dst, int maxLen);
-    
+
     /**
      * Reads a sequence of bytes from this buffer into the destination buffer.
      * The exact number of bytes transferred depends on availability of data
-     * in this buffer and capacity of the destination buffer.   
-     * 
+     * in this buffer and capacity of the destination buffer.
+     *
      * @param dst the destination buffer.
      * @return The number of bytes read, possibly zero.
      */
     int read(ByteBuffer dst);
-    
+
     /**
      * Reads a sequence of bytes from this buffer into the destination channel,
-     * up to the given maximum limit. The exact number of bytes transferred 
-     * depends on availability of data in this buffer, but cannot be more than 
-     * <code>maxLen</code> value.   
-     * 
+     * up to the given maximum limit. The exact number of bytes transferred
+     * depends on availability of data in this buffer, but cannot be more than
+     * <code>maxLen</code> value.
+     *
      * @param dst the destination channel.
-     * @param maxLen the maximum number of bytes to be read. 
+     * @param maxLen the maximum number of bytes to be read.
      * @return The number of bytes read, possibly zero.
      * @throws IOException in case of an I/O error.
      */
     int read(WritableByteChannel dst, int maxLen) throws IOException;
-    
+
     /**
-     * Reads a sequence of bytes from this buffer into the destination channel. 
-     * The exact number of bytes transferred depends on availability of data in 
-     * this buffer.   
-     * 
+     * Reads a sequence of bytes from this buffer into the destination channel.
+     * The exact number of bytes transferred depends on availability of data in
+     * this buffer.
+     *
      * @param dst the destination channel.
      * @return The number of bytes read, possibly zero.
      * @throws IOException in case of an I/O error.
      */
     int read(WritableByteChannel dst) throws IOException;
-    
+
     /**
-     * Attempts to transfer a complete line of characters up to a line delimiter 
-     * from this buffer to the destination buffer. If a complete line is 
-     * available in the buffer, the sequence of chars is transferred to the 
-     * destination buffer the method returns <code>true</code>. The line 
-     * delimiter itself is discarded. If a complete line is not available in 
-     * the buffer, this method returns <code>false</code> without transferring 
-     * anything to the destination buffer. If <code>endOfStream</code> parameter 
-     * is set to <code>true</code> this method assumes the end of stream has 
-     * been reached and the content currently stored in the buffer should be 
-     * treated as a complete line.  
+     * Attempts to transfer a complete line of characters up to a line delimiter
+     * from this buffer to the destination buffer. If a complete line is
+     * available in the buffer, the sequence of chars is transferred to the
+     * destination buffer the method returns <code>true</code>. The line
+     * delimiter itself is discarded. If a complete line is not available in
+     * the buffer, this method returns <code>false</code> without transferring
+     * anything to the destination buffer. If <code>endOfStream</code> parameter
+     * is set to <code>true</code> this method assumes the end of stream has
+     * been reached and the content currently stored in the buffer should be
+     * treated as a complete line.
      * <p>
-     * The choice of a char encoding and line delimiter sequence is up to the 
-     * specific implementations of this interface. 
-     * 
+     * The choice of a char encoding and line delimiter sequence is up to the
+     * specific implementations of this interface.
+     *
      * @param dst the destination buffer.
      * @param endOfStream
      * @return <code>true</code> if a sequence of chars representing a complete
      *  line has been transferred to the destination buffer, <code>false</code>
      *  otherwise.
-     *   
-     * @throws CharacterCodingException in case a character encoding or decoding 
+     *
+     * @throws CharacterCodingException in case a character encoding or decoding
      *   error occurs.
      */
-    boolean readLine(CharArrayBuffer dst, boolean endOfStream) 
+    boolean readLine(CharArrayBuffer dst, boolean endOfStream)
         throws CharacterCodingException;
-    
+
     /**
-     * Attempts to transfer a complete line of characters up to a line delimiter 
-     * from this buffer to a newly created string. If a complete line is 
+     * Attempts to transfer a complete line of characters up to a line delimiter
+     * from this buffer to a newly created string. If a complete line is
      * available in the buffer, the sequence of chars is transferred to a newly
-     * created string. The line delimiter itself is discarded. If a complete 
-     * line is not available in the buffer, this method returns 
-     * <code>null</code>. If <code>endOfStream</code> parameter 
-     * is set to <code>true</code> this method assumes the end of stream has 
-     * been reached and the content currently stored in the buffer should be 
-     * treated as a complete line.  
+     * created string. The line delimiter itself is discarded. If a complete
+     * line is not available in the buffer, this method returns
+     * <code>null</code>. If <code>endOfStream</code> parameter
+     * is set to <code>true</code> this method assumes the end of stream has
+     * been reached and the content currently stored in the buffer should be
+     * treated as a complete line.
      * <p>
-     * The choice of a char encoding and line delimiter sequence is up to the 
-     * specific implementations of this interface. 
-     * 
+     * The choice of a char encoding and line delimiter sequence is up to the
+     * specific implementations of this interface.
+     *
      * @param endOfStream
-     * @return a string representing a complete line, if available. 
+     * @return a string representing a complete line, if available.
      * <code>null</code> otherwise.
-     *   
-     * @throws CharacterCodingException in case a character encoding or decoding 
+     *
+     * @throws CharacterCodingException in case a character encoding or decoding
      *   error occurs.
      */
-    String readLine(boolean endOfStream) 
+    String readLine(boolean endOfStream)
         throws CharacterCodingException;
-    
+
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionOutputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionOutputBuffer.java?rev=937477&r1=937476&r2=937477&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionOutputBuffer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/reactor/SessionOutputBuffer.java Fri Apr 23 19:11:53 2010
@@ -36,10 +36,10 @@ import java.nio.charset.CharacterCodingE
 import org.apache.http.util.CharArrayBuffer;
 
 /**
- * Session output buffer for non-blocking connections. This interface 
- * facilitates intermediate buffering of output data streamed out to 
- * a destination channel and writing data to the buffer from a source, usually 
- * {@link ByteBuffer} or {@link ReadableByteChannel}. This interface also 
+ * Session output buffer for non-blocking connections. This interface
+ * facilitates intermediate buffering of output data streamed out to
+ * a destination channel and writing data to the buffer from a source, usually
+ * {@link ByteBuffer} or {@link ReadableByteChannel}. This interface also
  * provides methods for writing lines of text.
  *
  * @since 4.0
@@ -48,72 +48,72 @@ public interface SessionOutputBuffer {
 
     /**
      * Determines if the buffer contains data.
-     * 
+     *
      * @return <code>true</code> if there is data in the buffer,
      *   <code>false</code> otherwise.
      */
     boolean hasData();
-    
+
     /**
      * Returns the length of this buffer.
-     * 
+     *
      * @return buffer length.
      */
     int length();
-    
+
     /**
      * Makes an attempt to flush the content of this buffer to the given
      * destination {@link WritableByteChannel}.
-     *  
+     *
      * @param channel the destination channel.
      * @return The number of bytes written, possibly zero.
      * @throws IOException in case of an I/O error.
      */
-    int flush(WritableByteChannel channel) 
+    int flush(WritableByteChannel channel)
         throws IOException;
 
     /**
-     * Copies content of the source buffer into this buffer. The capacity of 
+     * Copies content of the source buffer into this buffer. The capacity of
      * the destination will be expanded in order to accommodate the entire
      * content of the source buffer.
-     *    
+     *
      * @param src the source buffer.
      */
     void write(ByteBuffer src);
 
     /**
      * Reads a sequence of bytes from the source channel into this buffer.
-     *    
+     *
      * @param src the source channel.
      */
-    void write(ReadableByteChannel src) 
+    void write(ReadableByteChannel src)
         throws IOException;
-    
+
     /**
      * Copies content of the source buffer into this buffer as one line of text
-     * including a line delimiter. The capacity of the destination will be 
+     * including a line delimiter. The capacity of the destination will be
      * expanded in order to accommodate the entire content of the source buffer.
      * <p>
-     * The choice of a char encoding and line delimiter sequence is up to the 
-     * specific implementations of this interface. 
-     *    
+     * The choice of a char encoding and line delimiter sequence is up to the
+     * specific implementations of this interface.
+     *
      * @param src the source buffer.
      */
-    void writeLine(CharArrayBuffer src) 
+    void writeLine(CharArrayBuffer src)
         throws CharacterCodingException;
-    
+
     /**
      * Copies content of the given string into this buffer as one line of text
-     * including a line delimiter. 
-     * The capacity of the destination will be expanded in order to accommodate 
+     * including a line delimiter.
+     * The capacity of the destination will be expanded in order to accommodate
      * the entire string.
      * <p>
-     * The choice of a char encoding and line delimiter sequence is up to the 
-     * specific implementations of this interface. 
-     *    
+     * The choice of a char encoding and line delimiter sequence is up to the
+     * specific implementations of this interface.
+     *
      * @param s the string.
      */
-    void writeLine(String s) 
+    void writeLine(String s)
         throws IOException;
-    
+
 }



Mime
View raw message