hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r451416 - in /jakarta/httpcomponents/httpcore/trunk/module-main/src: examples/org/apache/http/examples/ main/java/org/apache/http/impl/io/ test/java/org/apache/http/
Date Fri, 29 Sep 2006 20:12:05 GMT
Author: olegk
Date: Fri Sep 29 13:12:04 2006
New Revision: 451416

URL: http://svn.apache.org/viewvc?view=rev&rev=451416
Log:
[HTTPCORE-14] Consider decoupling HttpHost and Scheme and moving Scheme, SocketFactory and
SecureSocketFactory to HttpConn

Changelog:
----------
* Moved Scheme, SocketFactory, SecureSocketFactory and related classes to HttpConn 

Removed:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/impl/io/SSLSocketFactory.java
Modified:
    jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestAll.java
    jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestHttpExceptions.java

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java?view=diff&rev=451416&r1=451415&r2=451416
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpGet.java
Fri Sep 29 13:12:04 2006
@@ -35,12 +35,9 @@
 import org.apache.http.HttpHost;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
-import org.apache.http.Scheme;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.impl.DefaultHttpParams;
-import org.apache.http.impl.io.PlainSocketFactory;
-import org.apache.http.io.SocketFactory;
 import org.apache.http.message.HttpGet;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
@@ -68,9 +65,6 @@
 
     public static void main(String[] args) throws Exception {
         
-        SocketFactory socketfactory = PlainSocketFactory.getSocketFactory();
-        Scheme.registerScheme("http", new Scheme("http", socketfactory, 80));
-
         HttpParams params = new DefaultHttpParams(null);
         HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
         HttpProtocolParams.setContentCharset(params, "UTF-8");
@@ -104,8 +98,7 @@
             
             for (int i = 0; i < targets.length; i++) {
                 if (!conn.isOpen()) {
-                    Socket socket = socketfactory.createSocket(
-                            host.getHostName(), host.getPort(), null, 0, params);
+                    Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, host, params);
                 }
                 HttpGet request = new HttpGet(targets[i]);

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java?view=diff&rev=451416&r1=451415&r2=451416
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/examples/org/apache/http/examples/ElementalHttpPost.java
Fri Sep 29 13:12:04 2006
@@ -37,15 +37,12 @@
 import org.apache.http.HttpHost;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
-import org.apache.http.Scheme;
 import org.apache.http.entity.ByteArrayEntity;
 import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.impl.DefaultHttpParams;
-import org.apache.http.impl.io.PlainSocketFactory;
-import org.apache.http.io.SocketFactory;
 import org.apache.http.message.HttpPost;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
@@ -73,9 +70,6 @@
 
     public static void main(String[] args) throws Exception {
         
-        SocketFactory socketfactory = PlainSocketFactory.getSocketFactory();
-        Scheme.registerScheme("http", new Scheme("http", socketfactory, 80));
-
         HttpParams params = new DefaultHttpParams(null);
         HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
         HttpProtocolParams.setContentCharset(params, "UTF-8");
@@ -115,8 +109,7 @@
             
             for (int i = 0; i < requestBodies.length; i++) {
                 if (!conn.isOpen()) {
-                    Socket socket = socketfactory.createSocket(
-                            host.getHostName(), host.getPort(), null, 0, params);
+                    Socket socket = new Socket(host.getHostName(), host.getPort());
                     conn.bind(socket, host, params);
                 }
                 HttpPost request = new HttpPost("/servlets-examples/servlet/RequestInfoExample");

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestAll.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestAll.java?view=diff&rev=451416&r1=451415&r2=451416
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestAll.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestAll.java
Fri Sep 29 13:12:04 2006
@@ -52,7 +52,6 @@
         suite.addTest(TestHttpExceptions.suite());
         suite.addTest(TestHttpStatus.suite());
         suite.addTest(TestHttpVersion.suite());
-        suite.addTest(TestScheme.suite());
         suite.addTest(TestHttpHost.suite());
 
         suite.addTest(TestAllMessage.suite());

Modified: jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestHttpExceptions.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestHttpExceptions.java?view=diff&rev=451416&r1=451415&r2=451416
==============================================================================
--- jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestHttpExceptions.java
(original)
+++ jakarta/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/TestHttpExceptions.java
Fri Sep 29 13:12:04 2006
@@ -65,8 +65,6 @@
         new ProtocolException("Oppsie");
         new ProtocolException("Oppsie", cause);
         new NoHttpResponseException("Oppsie");
-        new ConnectTimeoutException();
-        new ConnectTimeoutException("Oppsie");
         new ConnectionClosedException("Oppsie");
         new MethodNotSupportedException("Oppsie");
         new MethodNotSupportedException("Oppsie", cause);



Mime
View raw message