Package org.apache.http.conn.params

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


        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() ;
        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 ) );

        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

    ConnManagerParams.setTimeout(params, connectionTimeoutMs);

    // These are probably overkill for most sites.
    ConnManagerParams.setMaxTotalConnections(params, 1152);
    ConnManagerParams.setMaxConnectionsPerRoute(params, new ConnPerRouteBean(256));

    HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
    HttpProtocolParams.setUserAgent(params, "Apache Shindig");
    HttpProtocolParams.setContentCharset(params, "UTF-8");
View Full Code Here

     */
    protected void configure(HttpParams params) {
        ConnManagerParams.setMaxTotalConnections(params,
                getMaxTotalConnections());
        ConnManagerParams.setMaxConnectionsPerRoute(params,
                new ConnPerRouteBean(getMaxConnectionsPerHost()));

        // Configure other parameters
        HttpClientParams.setAuthenticating(params, false);
        HttpClientParams.setRedirecting(params, isFollowRedirects());
        HttpClientParams.setCookiePolicy(params, "ignore");
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

    public ThreadSafeClientConnManager(final HttpParams params,
                                       final SchemeRegistry schreg) {
        Args.notNull(schreg, "Scheme registry");
        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

           
            Map<HttpHost, HttpRoute> proxyRouteMap = new HashMap<HttpHost, HttpRoute>();
           
            if (!routesConf.isEmpty())
            {
                ConnPerRouteBean connPerRouteBean = new ConnPerRouteBean();
                setBeanPropertiesByConfiguration(connPerRouteBean, routesConf.subset("param"));
               
                Map<HttpRoute, Integer> maxForRoutes = new HashMap<HttpRoute, Integer>();
               
                String [] routeNames = routesConf.getStringArray("");
               
                for (String routeName : routeNames)
                {
                    Configuration routeConf = routesConf.subset(routeName);
                   
                    try
                    {
                        HttpRoute httpRoute = buildHttpRoute(routeConf);
                       
                        int maxConnections = routeConf.getInt("maxConnections", -1);
                       
                        if (maxConnections >= 0)
                        {
                            maxForRoutes.put(httpRoute, maxConnections);
                        }
                       
                        if (httpRoute.getProxyHost() != null)
                        {
                            proxyRouteMap.put(httpRoute.getTargetHost(), httpRoute);
                        }
                    }
                    catch (Exception e)
                    {
                        throw new ServletException(e);
                    }
                }
               
                connPerRouteBean.setMaxForRoutes(maxForRoutes);
                connManagerParamBean.setConnectionsPerRoute(connPerRouteBean);
            }
           
            tempProxyService.setConnectionManagerParams(connManagerParams);
           
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

 
  public Publisher() {
   
    HttpParams params = new BasicHttpParams();
    ConnManagerParams.setMaxTotalConnections(params, 200);
    ConnPerRouteBean connPerRoute = new ConnPerRouteBean(20);
    connPerRoute.setDefaultMaxPerRoute(50);
    ConnManagerParams.setMaxConnectionsPerRoute(params, connPerRoute);

    SchemeRegistry schemeRegistry = new SchemeRegistry();
    schemeRegistry.register(new Scheme("http", PlainSocketFactory
        .getSocketFactory(), 80));
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.