hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1164983 - in /httpcomponents/httpcore/trunk/httpcore-nio/src: examples/org/apache/http/examples/nio/ main/java/org/apache/http/impl/nio/
Date Sun, 04 Sep 2011 09:53:57 GMT
Author: olegk
Date: Sun Sep  4 09:53:57 2011
New Revision: 1164983

URL: http://svn.apache.org/viewvc?rev=1164983&view=rev
Log:
Updated NIO examples

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIODispatch.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIODispatch.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
Sun Sep  4 09:53:57 2011
@@ -37,7 +37,7 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpResponse;
 import org.apache.http.concurrent.FutureCallback;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
-import org.apache.http.impl.nio.DefaultClientIOEventDispatch;
+import org.apache.http.impl.nio.DefaultClientIODispatch;
 import org.apache.http.impl.nio.pool.BasicNIOConnPool;
 import org.apache.http.impl.nio.pool.BasicNIOPoolEntry;
 import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor;
@@ -98,7 +98,7 @@ public class NHttpClient {
                 new DefaultConnectionReuseStrategy(),
                 params);
 
-        final IOEventDispatch ioEventDispatch = new DefaultClientIOEventDispatch(handler,
params);
+        final IOEventDispatch ioEventDispatch = new DefaultClientIODispatch(handler, params);
 
         Thread t = new Thread(new Runnable() {
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
Sun Sep  4 09:53:57 2011
@@ -46,8 +46,8 @@ import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
-import org.apache.http.impl.nio.DefaultClientIOEventDispatch;
-import org.apache.http.impl.nio.DefaultServerIOEventDispatch;
+import org.apache.http.impl.nio.DefaultClientIODispatch;
+import org.apache.http.impl.nio.DefaultServerIODispatch;
 import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor;
 import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
 import org.apache.http.impl.nio.reactor.IOReactorConfig;
@@ -153,10 +153,10 @@ public class NHttpReverseProxy {
                 new DefaultConnectionReuseStrategy(),
                 params);
 
-        final IOEventDispatch connectingEventDispatch = new DefaultClientIOEventDispatch(
+        final IOEventDispatch connectingEventDispatch = new DefaultClientIODispatch(
                 connectingHandler, params);
 
-        final IOEventDispatch listeningEventDispatch = new DefaultServerIOEventDispatch(
+        final IOEventDispatch listeningEventDispatch = new DefaultServerIODispatch(
                 listeningHandler, params);
 
         Thread t = new Thread(new Runnable() {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java
Sun Sep  4 09:53:57 2011
@@ -39,10 +39,10 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpResponse;
 import org.apache.http.concurrent.FutureCallback;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
+import org.apache.http.impl.nio.DefaultClientIODispatch;
 import org.apache.http.impl.nio.pool.BasicNIOConnPool;
 import org.apache.http.impl.nio.pool.BasicNIOPoolEntry;
 import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor;
-import org.apache.http.impl.nio.ssl.SSLClientIOEventDispatch;
 import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.nio.NHttpClientConnection;
 import org.apache.http.nio.protocol.BufferingHttpClientHandler;
@@ -104,7 +104,7 @@ public class NHttpSSLClient {
                 new DefaultConnectionReuseStrategy(),
                 params);
 
-        final IOEventDispatch ioEventDispatch = new SSLClientIOEventDispatch(
+        final IOEventDispatch ioEventDispatch = new DefaultClientIODispatch(
                 handler,
                 sslcontext,
                 params);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java
Sun Sep  4 09:53:57 2011
@@ -51,8 +51,8 @@ import org.apache.http.MethodNotSupporte
 import org.apache.http.entity.ContentType;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
+import org.apache.http.impl.nio.DefaultServerIODispatch;
 import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
-import org.apache.http.impl.nio.ssl.SSLServerIOEventDispatch;
 import org.apache.http.nio.NHttpConnection;
 import org.apache.http.nio.entity.NFileEntity;
 import org.apache.http.nio.entity.NStringEntity;
@@ -133,7 +133,7 @@ public class NHttpSSLServer {
         // Provide an event logger
         handler.setEventListener(new EventLogger());
 
-        IOEventDispatch ioEventDispatch = new SSLServerIOEventDispatch(
+        IOEventDispatch ioEventDispatch = new DefaultServerIODispatch(
                 handler,
                 sslcontext,
                 params);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
Sun Sep  4 09:53:57 2011
@@ -44,7 +44,7 @@ import org.apache.http.MethodNotSupporte
 import org.apache.http.entity.ContentType;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
-import org.apache.http.impl.nio.DefaultServerIOEventDispatch;
+import org.apache.http.impl.nio.DefaultServerIODispatch;
 import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
 import org.apache.http.nio.NHttpConnection;
 import org.apache.http.nio.entity.NFileEntity;
@@ -114,7 +114,7 @@ public class NHttpServer {
         // Provide an event logger
         handler.setEventListener(new EventLogger());
 
-        IOEventDispatch ioEventDispatch = new DefaultServerIOEventDispatch(handler, params);
+        IOEventDispatch ioEventDispatch = new DefaultServerIODispatch(handler, params);
         ListeningIOReactor ioReactor = new DefaultListeningIOReactor();
         try {
             ioReactor.listen(new InetSocketAddress(8080));

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIODispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIODispatch.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIODispatch.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultClientIODispatch.java
Sun Sep  4 09:53:57 2011
@@ -85,6 +85,13 @@ public class DefaultClientIODispatch ext
         this(handler, new SSLNHttpClientConnectionFactory(sslcontext, sslHandler, params));
     }
 
+    public DefaultClientIODispatch(
+            final NHttpClientHandler handler,
+            final SSLContext sslcontext,
+            final HttpParams params) {
+        this(handler, sslcontext, null, params);
+    }
+
     @Override
     protected NHttpClientIOTarget createConnection(final IOSession session) {
         return this.connFactory.createConnection(session);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIODispatch.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIODispatch.java?rev=1164983&r1=1164982&r2=1164983&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIODispatch.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultServerIODispatch.java
Sun Sep  4 09:53:57 2011
@@ -78,6 +78,13 @@ public class DefaultServerIODispatch ext
         this(handler, new SSLNHttpServerConnectionFactory(sslcontext, sslHandler, params));
     }
 
+    public DefaultServerIODispatch(
+            final NHttpServiceHandler handler,
+            final SSLContext sslcontext,
+            final HttpParams params) {
+        this(handler, sslcontext, null, params);
+    }
+
     @Override
     protected NHttpServerIOTarget createConnection(final IOSession session) {
         return this.connFactory.createConnection(session);



Mime
View raw message