diff --git a/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java b/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java index 01117423c..857393e56 100644 --- a/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java +++ b/httpclient/src/examples/org/apache/http/examples/client/ClientCustomSSL.java @@ -55,7 +55,7 @@ public class ClientCustomSSL { } SSLSocketFactory socketFactory = new SSLSocketFactory(trustStore); - Scheme sch = new Scheme("https", socketFactory, 443); + Scheme sch = new Scheme("https", 443, socketFactory); httpclient.getConnectionManager().getSchemeRegistry().register(sch); HttpGet httpget = new HttpGet("https://localhost/"); diff --git a/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java b/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java index d7e682699..e60289668 100644 --- a/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java +++ b/httpclient/src/examples/org/apache/http/examples/client/ClientEvictExpiredConnections.java @@ -49,7 +49,7 @@ public class ClientEvictExpiredConnections { // Create and initialize scheme registry SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register( - new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); + new Scheme("http", 80, PlainSocketFactory.getSocketFactory())); ThreadSafeClientConnManager cm = new ThreadSafeClientConnManager(schemeRegistry); cm.setMaxTotalConnections(100); diff --git a/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java b/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java index 82ee5f720..c96e5ecf8 100644 --- a/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java +++ b/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java @@ -49,7 +49,7 @@ public class ClientMultiThreadedExecution { // Create and initialize scheme registry SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register( - new Scheme("http", PlainSocketFactory.getSocketFactory(), 80)); + new Scheme("http", 80, PlainSocketFactory.getSocketFactory())); // Create an HttpClient with the ThreadSafeClientConnManager. // This connection manager must be used if more than one thread will diff --git a/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectDirect.java b/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectDirect.java index f5604c2c4..70c92ca9e 100644 --- a/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectDirect.java +++ b/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectDirect.java @@ -37,7 +37,7 @@ import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.scheme.SocketFactory; +import org.apache.http.conn.scheme.SchemeSocketFactory; import org.apache.http.conn.ClientConnectionRequest; import org.apache.http.conn.ManagedClientConnection; import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; @@ -71,8 +71,8 @@ public class ManagerConnectDirect { // Register the "http" protocol scheme, it is required // by the default operator to look up socket factories. SchemeRegistry supportedSchemes = new SchemeRegistry(); - SocketFactory sf = PlainSocketFactory.getSocketFactory(); - supportedSchemes.register(new Scheme("http", sf, 80)); + SchemeSocketFactory sf = PlainSocketFactory.getSocketFactory(); + supportedSchemes.register(new Scheme("http", 80, sf)); // Prepare parameters. // Since this example doesn't use the full core framework, diff --git a/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectProxy.java b/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectProxy.java index 1f5048ad5..cc0b44bab 100644 --- a/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectProxy.java +++ b/httpclient/src/examples/org/apache/http/examples/conn/ManagerConnectProxy.java @@ -39,7 +39,6 @@ import org.apache.http.conn.ManagedClientConnection; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.scheme.SocketFactory; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager; import org.apache.http.message.BasicHttpRequest; @@ -74,10 +73,8 @@ public class ManagerConnectProxy { // Register the "http" and "https" protocol schemes, they are // required by the default operator to look up socket factories. SchemeRegistry supportedSchemes = new SchemeRegistry(); - SocketFactory sf = PlainSocketFactory.getSocketFactory(); - supportedSchemes.register(new Scheme("http", sf, 80)); - sf = SSLSocketFactory.getSocketFactory(); - supportedSchemes.register(new Scheme("https", sf, 80)); + supportedSchemes.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory())); + supportedSchemes.register(new Scheme("https", 443, SSLSocketFactory.getSocketFactory())); // Prepare parameters. // Since this example doesn't use the full core framework, diff --git a/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java b/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java index 4b50901bb..57661c712 100644 --- a/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java +++ b/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectDirect.java @@ -37,7 +37,6 @@ import org.apache.http.conn.OperatedClientConnection; import org.apache.http.conn.scheme.PlainSocketFactory; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; -import org.apache.http.conn.scheme.SocketFactory; import org.apache.http.impl.conn.DefaultClientConnectionOperator; import org.apache.http.message.BasicHttpRequest; import org.apache.http.params.HttpParams; @@ -64,8 +63,7 @@ public class OperatorConnectDirect { // Register the "http" protocol scheme, it is required // by the default operator to look up socket factories. SchemeRegistry supportedSchemes = new SchemeRegistry(); - SocketFactory sf = PlainSocketFactory.getSocketFactory(); - supportedSchemes.register(new Scheme("http", sf, 80)); + supportedSchemes.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory())); // Prepare parameters. // Since this example doesn't use the full core framework, diff --git a/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java b/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java index 5fbe9450d..a5f7b94e2 100644 --- a/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java +++ b/httpclient/src/examples/org/apache/http/examples/conn/OperatorConnectProxy.java @@ -68,9 +68,9 @@ public class OperatorConnectProxy { // required by the default operator to look up socket factories. SchemeRegistry supportedSchemes = new SchemeRegistry(); supportedSchemes.register(new Scheme("http", - PlainSocketFactory.getSocketFactory(), 80)); + 80, PlainSocketFactory.getSocketFactory())); supportedSchemes.register(new Scheme("https", - SSLSocketFactory.getSocketFactory(), 443)); + 443, SSLSocketFactory.getSocketFactory())); // Prepare parameters. // Since this example doesn't use the full core framework,