Examples of SchemeRegistry


Examples of org.apache.abdera.i18n.iri.SchemeRegistry

    String host,
    int port,
    String path,
    String query,
    String fragment) {
      SchemeRegistry reg = SchemeRegistry.getInstance();
      Scheme _scheme = reg.getScheme(scheme);
      StringBuffer buf = new StringBuffer();
      buildAuthority(buf,userinfo, host, port);
      String authority = (buf.length()!=0)?buf.toString():null;
      init(_scheme,scheme,authority,userinfo,
        host,port,path,query,fragment);
View Full Code Here

Examples of org.apache.http.conn.SchemeRegistry

     */
    private final static void setup() {

        // Register the "http" and "https" protocol schemes, they are
        // required by the default operator to look up socket factories.
        supportedSchemes = new SchemeRegistry();
        SocketFactory sf = PlainSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("http", sf, 80));
        sf = SSLSocketFactory.getSocketFactory();
        supportedSchemes.register(new Scheme("https", sf, 80));

View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

                                         String cookiePolicy, SSLContext sslContext,
                                         X509HostnameVerifier hostnameVerifier)
    {
        HttpParams httpParams = new BasicHttpParams();

        SchemeRegistry registry = new SchemeRegistry();

        registry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
        SSLSocketFactory sslSocketFactory;
        if (null == sslContext)
        {
          sslSocketFactory = SSLSocketFactory.getSocketFactory();
        }
        else
        {
          sslSocketFactory = new SSLSocketFactory(sslContext);
        }
        if (null != hostnameVerifier)
        {
          sslSocketFactory.setHostnameVerifier(hostnameVerifier);
        }
        registry.register(new Scheme("https", sslSocketFactory, 443));
       
        ClientConnectionManager connManager;
        if (multiThreadedHttpClient)
            connManager = new ThreadSafeClientConnManager(httpParams, registry);
        else
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

      HttpParams params = new BasicHttpParams();
      ConnManagerParams.setMaxTotalConnections(params, 3);
      ConnManagerParams.setTimeout(params, 1000);

      // Create and initialize scheme registry
      SchemeRegistry schemeRegistry = new SchemeRegistry();
      schemeRegistry.register(
              new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));

      // Create an HttpClient with the ThreadSafeClientConnManager.
      // This connection manager must be used if more than one thread will
      // be using the HttpClient.
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

      HttpProtocolParams.setUserAgent(httpClient.getParams(), defaultAgent);
    }

    public static HttpClient initConnectionManager() {
      // Create and initialize scheme registry
    final SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(new Scheme("http", 80, PlainSocketFactory.getSocketFactory()));
    schemeRegistry.register(new Scheme("https", 443, getSSLSocketFactory()));

    final ThreadSafeClientConnManager clientConnectionManager = new ThreadSafeClientConnManager(schemeRegistry);

    // Create and initialize HTTP parameters
    final HttpParams httpParams = new BasicHttpParams();
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

   * (Code contributed by sgayda2 from issue #17, and by erickok from ticket #10)
   *
   * @param XMLRPC server URI
   */
  public XMLRPCClient(URI uri) {
    SchemeRegistry registry = new SchemeRegistry();
    registry.register(new Scheme("http", new PlainSocketFactory(), 80));
    registry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
   
    postMethod = new HttpPost(uri);
    postMethod.addHeader("Content-Type", "text/xml");
   
    // WARNING
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);       
        final StallingSocketFactory stallingSocketFactory = new StallingSocketFactory(connectLatch, WaitPolicy.BEFORE_CONNECT, PlainSocketFactory.getSocketFactory());
        Scheme scheme = new Scheme("http", stallingSocketFactory, 80);
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(scheme);

        ThreadSafeClientConnManager mgr = createTSCCM(mgrpar, registry);

        final HttpHost target = getServerHttp();
        final HttpRoute route = new HttpRoute(target, null, false);
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);       
        final StallingSocketFactory stallingSocketFactory = new StallingSocketFactory(connectLatch, WaitPolicy.BEFORE_CREATE, PlainSocketFactory.getSocketFactory());
        Scheme scheme = new Scheme("http", stallingSocketFactory, 80);
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(scheme);

        ThreadSafeClientConnManager mgr = createTSCCM(mgrpar, registry);

        final HttpHost target = getServerHttp();
        final HttpRoute route = new HttpRoute(target, null, false);
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

        ConnManagerParams.setMaxTotalConnections(mgrpar, 1);
       
        final CountDownLatch connectLatch = new CountDownLatch(1);       
        final StallingSocketFactory stallingSocketFactory = new StallingSocketFactory(connectLatch, WaitPolicy.AFTER_CONNECT, PlainSocketFactory.getSocketFactory());
        Scheme scheme = new Scheme("http", stallingSocketFactory, 80);
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(scheme);

        ThreadSafeClientConnManager mgr = createTSCCM(mgrpar, registry);

        final HttpHost target = getServerHttp();
        final HttpRoute route = new HttpRoute(target, null, false);
View Full Code Here

Examples of org.apache.http.conn.scheme.SchemeRegistry

     *
     * @return the default scheme registry
     */
    public SchemeRegistry createSchemeRegistry() {

        SchemeRegistry schreg = new SchemeRegistry();
        SocketFactory sf = PlainSocketFactory.getSocketFactory();
        schreg.register(new Scheme("http", sf, 80));

        return schreg;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.