Package org.apache.http.conn.params

Examples of org.apache.http.conn.params.ConnPerRouteBean


        schemeRegistry.register( new Scheme( "https", new EasySSLSocketFactory(), 443 ) );

        params = new BasicHttpParams();
        // TODO put this values to a configuration way ???
        params.setParameter( ConnManagerPNames.MAX_TOTAL_CONNECTIONS, 30 );
        params.setParameter( ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE, new ConnPerRouteBean( 30 ) );
        HttpProtocolParams.setVersion( params, HttpVersion.HTTP_1_1 );

        cm = new ThreadSafeClientConnManager( params, schemeRegistry );
    }
View Full Code Here


        if (schreg == null) {
            throw new IllegalArgumentException("Scheme registry may not be null");
        }
        this.log = LogFactory.getLog(getClass());
        this.schemeRegistry = schreg;
        this.connPerRoute = new ConnPerRouteBean();
        this.connOperator = createConnectionOperator(schreg);
        this.pool = createConnectionPool(connTTL, connTTLTimeUnit) ;
        this.connectionPool = this.pool;
    }
View Full Code Here

        if (schreg == null) {
            throw new IllegalArgumentException("Scheme registry may not be null");
        }
        this.log = LogFactory.getLog(getClass());
        this.schemeRegistry = schreg;
        this.connPerRoute = new ConnPerRouteBean();
        this.connOperator = createConnectionOperator(schreg);
        this.pool = (ConnPoolByRoute) createConnectionPool(params) ;
        this.connectionPool = this.pool;
    }
View Full Code Here

        schemeRegistry.register( new Scheme( "https", new EasySSLSocketFactory(), 443 ) );

        HttpParams params = new BasicHttpParams();
        // TODO put this values to a configuration way ???
        params.setParameter( ConnManagerPNames.MAX_TOTAL_CONNECTIONS, 30 );
        params.setParameter( ConnManagerPNames.MAX_CONNECTIONS_PER_ROUTE, new ConnPerRouteBean( 30 ) );
        HttpProtocolParams.setVersion( params, HttpVersion.HTTP_1_1 );

        ClientConnectionManager cm = new ThreadSafeClientConnManager( params, schemeRegistry );

        httpClient = new DefaultHttpClient( cm, params );
View Full Code Here

        ConnManagerParamBean param = new ConnManagerParamBean(params);
        if (getMaxTotalConnections() > 0) {
            param.setMaxTotalConnections(getMaxTotalConnections());
        }
        if (getConnectionsPerRoute() > 0) {
            param.setConnectionsPerRoute(new ConnPerRouteBean(getConnectionsPerRoute()));
        }

        ThreadSafeClientConnManager answer = new ThreadSafeClientConnManager(params, schemeRegistry);
        LOG.info("Created ClientConnectionManager " + answer);
View Full Code Here

        if (poolSize < 1) throw new IllegalArgumentException("poolSize may not be < 1");
        // Create and initialize HTTP parameters
        HttpParams params = super.getClient().getParams();
        ConnManagerParams.setMaxTotalConnections(params, poolSize);
        ConnManagerParams.setMaxConnectionsPerRoute(params,
                new ConnPerRouteBean(poolSize));

        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);

        // Create and initialize scheme registry
        SchemeRegistry schemeRegistry = new SchemeRegistry();
View Full Code Here

    public BrowserMobHttpClient() {
        HttpParams params = new BasicHttpParams();

        // MOB-338: 30 total connections and 6 connections per host matches the behavior in Firefox 3
        ConnManagerParams.setMaxTotalConnections(params, 30);
        ConnPerRouteBean connPerRoute = new ConnPerRouteBean(6);
        ConnManagerParams.setMaxConnectionsPerRoute(params, connPerRoute);

        SchemeRegistry schemeRegistry = new SchemeRegistry();
        hostNameResolver = new BrowserMobHostNameResolver(new Cache(DClass.ANY));
View Full Code Here

      if (utils.getMaxConnections() > 0)
         ConnManagerParams.setMaxTotalConnections(params, utils.getMaxConnections());

      if (utils.getMaxConnectionsPerHost() > 0) {
         ConnPerRoute connectionsPerRoute = new ConnPerRouteBean(utils.getMaxConnectionsPerHost());
         ConnManagerParams.setMaxConnectionsPerRoute(params, connectionsPerRoute);
      }
      HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
      return params;
   }
View Full Code Here

    }

    static void oldPool(int c, long reps) throws Exception {
        ClientConnectionOperator operator = new DefaultClientConnectionOperator(
                SchemeRegistryFactory.createDefault());
        ConnPerRoute connPerRoute = new ConnPerRouteBean(c);
        ConnPoolByRoute pool = new ConnPoolByRoute(operator, connPerRoute, c * 10);

        WorkerThread2[] workers = new WorkerThread2[c];
        for (int i = 0; i < workers.length; i++) {
            workers[i] = new WorkerThread2(pool, reps);
View Full Code Here

     *
     * @since 4.1
     */
    public ThreadSafeClientConnManager(final SchemeRegistry schreg,
            final long connTTL, final TimeUnit connTTLTimeUnit) {
        this(schreg, connTTL, connTTLTimeUnit, new ConnPerRouteBean());
    }
View Full Code Here

TOP

Related Classes of org.apache.http.conn.params.ConnPerRouteBean

Copyright © 2018 www.massapicom. 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.