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/08/12 14:04:28 UTC

svn commit: r1157061 - in /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio: ./ pool/ ssl/

Author: olegk
Date: Fri Aug 12 12:04:27 2011
New Revision: 1157061

URL: http://svn.apache.org/viewvc?rev=1157061&view=rev
Log:
TABS -> SPACES

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIOEventDispatch.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIOEventDispatch.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIOEventDispatch.java?rev=1157061&r1=1157060&r2=1157061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIOEventDispatch.java Fri Aug 12 12:04:27 2011
@@ -124,37 +124,37 @@ public class DefaultClientIOEventDispatc
      * @return newly created HTTP connection.
      */
     protected NHttpClientIOTarget createConnection(final IOSession session) {
-    	try {
-    		return new DefaultNHttpClientConnection(
+        try {
+            return new DefaultNHttpClientConnection(
                     session,
                     createHttpResponseFactory(),
                     this.allocator,
                     this.params);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void connected(final IOSession session) {
-    	try {
+        try {
             NHttpClientIOTarget conn = createConnection(session);
             Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
             session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
 
             int timeout = HttpConnectionParams.getSoTimeout(this.params);
-    		conn.setSocketTimeout(timeout);
+            conn.setSocketTimeout(timeout);
 
-    		this.handler.connected(conn, attachment);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+            this.handler.connected(conn, attachment);
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void disconnected(final IOSession session) {
         NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-        		ExecutionContext.HTTP_CONNECTION);
+                ExecutionContext.HTTP_CONNECTION);
         if (conn != null) {
             this.handler.closed(conn);
         }
@@ -167,39 +167,39 @@ public class DefaultClientIOEventDispatc
     }
 
     public void inputReady(final IOSession session) {
-    	try {
+        try {
             NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             conn.consumeInput(this.handler);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void outputReady(final IOSession session) {
-    	try {
+        try {
             NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             conn.produceOutput(this.handler);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void timeout(final IOSession session) {
-    	try {
+        try {
             NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             this.handler.timeout(conn);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIOEventDispatch.java?rev=1157061&r1=1157060&r2=1157061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIOEventDispatch.java Fri Aug 12 12:04:27 2011
@@ -124,7 +124,7 @@ public class DefaultServerIOEventDispatc
      * @return newly created HTTP connection.
      */
     protected NHttpServerIOTarget createConnection(final IOSession session) {
-		return new DefaultNHttpServerConnection(
+        return new DefaultNHttpServerConnection(
                 session,
                 createHttpRequestFactory(),
                 this.allocator,
@@ -132,23 +132,23 @@ public class DefaultServerIOEventDispatc
     }
 
     public void connected(final IOSession session) {
-    	try {
+        try {
             NHttpServerIOTarget conn = createConnection(session);
             session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
 
             int timeout = HttpConnectionParams.getSoTimeout(this.params);
-    		session.setSocketTimeout(timeout);
+            session.setSocketTimeout(timeout);
 
-    		this.handler.connected(conn);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+            this.handler.connected(conn);
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void disconnected(final IOSession session) {
         NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-        		ExecutionContext.HTTP_CONNECTION);
+                ExecutionContext.HTTP_CONNECTION);
         if (conn != null) {
             this.handler.closed(conn);
         }
@@ -161,39 +161,39 @@ public class DefaultServerIOEventDispatc
     }
 
     public void inputReady(final IOSession session) {
-    	try {
+        try {
             NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             conn.consumeInput(this.handler);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void outputReady(final IOSession session) {
-    	try {
+        try {
             NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             conn.produceOutput(this.handler);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void timeout(final IOSession session) {
-    	try {
+        try {
             NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             this.handler.timeout(conn);
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java?rev=1157061&r1=1157060&r2=1157061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java Fri Aug 12 12:04:27 2011
@@ -62,7 +62,7 @@ public class BasicNIOConnPool extends Ab
     public BasicNIOConnPool(final ConnectingIOReactor ioreactor, final HttpParams params) {
         super(ioreactor, 2, 20);
         if (params == null) {
-        	throw new IllegalArgumentException("HTTP parameters may not be null");
+            throw new IllegalArgumentException("HTTP parameters may not be null");
         }
         this.params = params;
     }
@@ -93,19 +93,19 @@ public class BasicNIOConnPool extends Ab
         iosession.shutdown();
     }
 
-	@Override
-	public Future<BasicNIOPoolEntry> lease(
-			final HttpHost route,
-			final Object state,
-			final FutureCallback<BasicNIOPoolEntry> callback) {
-		int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
-		return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, callback);
-	}
-
-	@Override
-	public Future<BasicNIOPoolEntry> lease(final HttpHost route, final Object state) {
-		int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
-		return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, null);
-	}
+    @Override
+    public Future<BasicNIOPoolEntry> lease(
+            final HttpHost route,
+            final Object state,
+            final FutureCallback<BasicNIOPoolEntry> callback) {
+        int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
+        return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, callback);
+    }
+
+    @Override
+    public Future<BasicNIOPoolEntry> lease(final HttpHost route, final Object state) {
+        int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
+        return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, null);
+    }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java?rev=1157061&r1=1157060&r2=1157061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLClientIOEventDispatch.java Fri Aug 12 12:04:27 2011
@@ -190,7 +190,7 @@ public class SSLClientIOEventDispatch im
     }
 
     public void connected(final IOSession session) {
-    	try {
+        try {
             SSLIOSession sslSession = createSSLIOSession(
                     session,
                     this.sslcontext,
@@ -202,10 +202,10 @@ public class SSLClientIOEventDispatch im
             session.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
             session.setAttribute(SSL_SESSION, sslSession);
 
-    		int timeout = HttpConnectionParams.getSoTimeout(this.params);
-    		conn.setSocketTimeout(timeout);
+            int timeout = HttpConnectionParams.getSoTimeout(this.params);
+            conn.setSocketTimeout(timeout);
 
-    		Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
+            Object attachment = session.getAttribute(IOSession.ATTACHMENT_KEY);
             this.handler.connected(conn, attachment);
 
             try {
@@ -214,15 +214,15 @@ public class SSLClientIOEventDispatch im
                 this.handler.exception(conn, ex);
                 sslSession.shutdown();
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void disconnected(final IOSession session) {
         NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-        		ExecutionContext.HTTP_CONNECTION);
+                ExecutionContext.HTTP_CONNECTION);
         if (conn != null) {
             this.handler.closed(conn);
         }
@@ -241,9 +241,9 @@ public class SSLClientIOEventDispatch im
     }
 
     public void inputReady(final IOSession session) {
-    	try {
-	        NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-	        		ExecutionContext.HTTP_CONNECTION);
+        try {
+            NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             SSLIOSession sslSession =
                 (SSLIOSession) session.getAttribute(SSL_SESSION);
@@ -258,16 +258,16 @@ public class SSLClientIOEventDispatch im
                 this.handler.exception(conn, ex);
                 sslSession.shutdown();
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void outputReady(final IOSession session) {
-    	try {
-	        NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-	        		ExecutionContext.HTTP_CONNECTION);
+        try {
+            NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             SSLIOSession sslSession =
                 (SSLIOSession) session.getAttribute(SSL_SESSION);
@@ -282,32 +282,32 @@ public class SSLClientIOEventDispatch im
                 this.handler.exception(conn, ex);
                 sslSession.shutdown();
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void timeout(final IOSession session) {
-    	try {
-	        NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
-	        		ExecutionContext.HTTP_CONNECTION);
-	        ensureNotNull(conn);
-	        SSLIOSession sslSession =
-	            (SSLIOSession) session.getAttribute(SSL_SESSION);
-	        ensureNotNull(sslSession);
-
-	        this.handler.timeout(conn);
-	        synchronized (sslSession) {
-	            if (sslSession.isOutboundDone() && !sslSession.isInboundDone()) {
-	                // The session failed to terminate cleanly
-	                sslSession.shutdown();
-	            }
-	        }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        try {
+            NHttpClientIOTarget conn = (NHttpClientIOTarget) session.getAttribute(
+                    ExecutionContext.HTTP_CONNECTION);
+            ensureNotNull(conn);
+            SSLIOSession sslSession =
+                (SSLIOSession) session.getAttribute(SSL_SESSION);
+            ensureNotNull(sslSession);
+
+            this.handler.timeout(conn);
+            synchronized (sslSession) {
+                if (sslSession.isOutboundDone() && !sslSession.isInboundDone()) {
+                    // The session failed to terminate cleanly
+                    sslSession.shutdown();
+                }
+            }
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java?rev=1157061&r1=1157060&r2=1157061&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/ssl/SSLServerIOEventDispatch.java Fri Aug 12 12:04:27 2011
@@ -190,7 +190,7 @@ public class SSLServerIOEventDispatch im
     }
 
     public void connected(final IOSession session) {
-    	try {
+        try {
             SSLIOSession sslSession = createSSLIOSession(
                     session,
                     this.sslcontext,
@@ -203,7 +203,7 @@ public class SSLServerIOEventDispatch im
             session.setAttribute(SSL_SESSION, sslSession);
 
             int timeout = HttpConnectionParams.getSoTimeout(this.params);
-    		conn.setSocketTimeout(timeout);
+            conn.setSocketTimeout(timeout);
 
             this.handler.connected(conn);
 
@@ -213,15 +213,15 @@ public class SSLServerIOEventDispatch im
                 this.handler.exception(conn, ex);
                 sslSession.shutdown();
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void disconnected(final IOSession session) {
-    	NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-        		ExecutionContext.HTTP_CONNECTION);
+        NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
+                ExecutionContext.HTTP_CONNECTION);
         if (conn != null) {
             this.handler.closed(conn);
         }
@@ -240,9 +240,9 @@ public class SSLServerIOEventDispatch im
     }
 
     public void inputReady(final IOSession session) {
-    	try {
-        	NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+        try {
+            NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             SSLIOSession sslSession =
                 (SSLIOSession) session.getAttribute(SSL_SESSION);
@@ -257,16 +257,16 @@ public class SSLServerIOEventDispatch im
                 this.handler.exception(conn, ex);
                 sslSession.shutdown();
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void outputReady(final IOSession session) {
-    	try {
-        	NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+        try {
+            NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             SSLIOSession sslSession =
                 (SSLIOSession) session.getAttribute(SSL_SESSION);
@@ -281,16 +281,16 @@ public class SSLServerIOEventDispatch im
                 this.handler.exception(conn, ex);
                 sslSession.shutdown();
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
     public void timeout(final IOSession session) {
-    	try {
-        	NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
-            		ExecutionContext.HTTP_CONNECTION);
+        try {
+            NHttpServerIOTarget conn = (NHttpServerIOTarget) session.getAttribute(
+                    ExecutionContext.HTTP_CONNECTION);
             ensureNotNull(conn);
             SSLIOSession sslSession =
                 (SSLIOSession) session.getAttribute(SSL_SESSION);
@@ -303,10 +303,10 @@ public class SSLServerIOEventDispatch im
                     sslSession.shutdown();
                 }
             }
-    	} catch (RuntimeException ex) {
-    		session.shutdown();
-    		throw ex;
-    	}
+        } catch (RuntimeException ex) {
+            session.shutdown();
+            throw ex;
+        }
     }
 
 }