Package org.apache.commons.httpclient.params

Examples of org.apache.commons.httpclient.params.HttpConnectionManagerParams


            }
        });
       
       
        // Set connection parameters.
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(connectionTimeout);
        connectionParams.setSoTimeout(connectionTimeout);       
        connectionParams.setStaleCheckingEnabled(false);
       
        HttpClient httpClient = new HttpClient(clientParams);
        httpClient.getHttpConnectionManager().setParams(connectionParams);
       
        // httpClient.getParams().setAuthenticationPreemptive(true);
View Full Code Here


        Jets3tProperties jets3tProperties = Jets3tProperties.getInstance(Constants.JETS3T_PROPERTIES_FILENAME);
       
        // Set HttpClient properties based on Jets3t Properties.
        HostConfiguration hostConfig = new HostConfiguration();
                       
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(jets3tProperties.
            getIntProperty("httpclient.connection-timeout-ms", 60000));
        connectionParams.setSoTimeout(jets3tProperties.
            getIntProperty("httpclient.socket-timeout-ms", 60000));       
        connectionParams.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION,
            jets3tProperties.getIntProperty("httpclient.max-connections", 4));
        connectionParams.setStaleCheckingEnabled(jets3tProperties.
            getBoolProperty("httpclient.stale-checking-enabled", true));
       
        // Connection properties to take advantage of S3 window scaling.
        if (jets3tProperties.containsKey("httpclient.socket-receive-buffer")) {
            connectionParams.setReceiveBufferSize(jets3tProperties.
                getIntProperty("httpclient.socket-receive-buffer", 0));
        }
        if (jets3tProperties.containsKey("httpclient.socket-send-buffer")) {
            connectionParams.setSendBufferSize(jets3tProperties.
                getIntProperty("httpclient.socket-send-buffer", 0));
        }
       
        connectionParams.setTcpNoDelay(true);
       
        connectionManager = new MultiThreadedHttpConnectionManager();
        connectionManager.setParams(connectionParams);
       
        // Set user agent string.
View Full Code Here

            }
        });
       
       
        // Set connection parameters.
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(HTTP_CONNECTION_TIMEOUT);
        connectionParams.setSoTimeout(SOCKET_CONNECTION_TIMEOUT);       
        connectionParams.setStaleCheckingEnabled(false);
       
        HttpClient httpClient = new HttpClient(clientParams);
        httpClient.getHttpConnectionManager().setParams(connectionParams);
        return httpClient;
    }
View Full Code Here

            }
        });
       
       
        // Set connection parameters.
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(HTTP_CONNECTION_TIMEOUT);
        connectionParams.setSoTimeout(SOCKET_CONNECTION_TIMEOUT);       
        connectionParams.setStaleCheckingEnabled(false);
       
        HttpClient httpClient = new HttpClient(clientParams);
        httpClient.getHttpConnectionManager().setParams(connectionParams);
        return httpClient;
    }
View Full Code Here

    public static HttpClientAndConnectionManager initHttpConnection(final AWSRequestAuthorizer awsRequestAuthorizer,
        HostConfiguration hostConfig, Jets3tProperties jets3tProperties, String userAgentDescription,
        CredentialsProvider credentialsProvider)
    {
        // Configure HttpClient properties based on Jets3t Properties.
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(jets3tProperties.
            getIntProperty("httpclient.connection-timeout-ms", 60000));
        connectionParams.setSoTimeout(jets3tProperties.
            getIntProperty("httpclient.socket-timeout-ms", 60000));       
        connectionParams.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION,
            jets3tProperties.getIntProperty("httpclient.max-connections", 4));
        connectionParams.setStaleCheckingEnabled(jets3tProperties.
            getBoolProperty("httpclient.stale-checking-enabled", true));
       
        // Connection properties to take advantage of S3 window scaling.
        if (jets3tProperties.containsKey("httpclient.socket-receive-buffer")) {
            connectionParams.setReceiveBufferSize(jets3tProperties.
                getIntProperty("httpclient.socket-receive-buffer", 0));
        }
        if (jets3tProperties.containsKey("httpclient.socket-send-buffer")) {
            connectionParams.setSendBufferSize(jets3tProperties.
                getIntProperty("httpclient.socket-send-buffer", 0));
        }
       
        connectionParams.setTcpNoDelay(true);
       
        MultiThreadedHttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
        connectionManager.setParams(connectionParams);
       
        // Set user agent string.
View Full Code Here

        HostConfiguration hostConfig) throws S3ServiceException
    {
        super(awsCredentials, invokingApplicationDescription, jets3tProperties);
       
        // Configure HttpClient properties based on Jets3t Properties.
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(jets3tProperties.
            getIntProperty("httpclient.connection-timeout-ms", 60000));
        connectionParams.setSoTimeout(jets3tProperties.
            getIntProperty("httpclient.socket-timeout-ms", 60000));       
        connectionParams.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION,
            jets3tProperties.getIntProperty("httpclient.max-connections", 4));
        connectionParams.setStaleCheckingEnabled(jets3tProperties.
            getBoolProperty("httpclient.stale-checking-enabled", true));
       
        // Connection properties to take advantage of S3 window scaling.
        if (jets3tProperties.containsKey("httpclient.socket-receive-buffer")) {
            connectionParams.setReceiveBufferSize(jets3tProperties.
                getIntProperty("httpclient.socket-receive-buffer", 0));
        }
        if (jets3tProperties.containsKey("httpclient.socket-send-buffer")) {
            connectionParams.setSendBufferSize(jets3tProperties.
                getIntProperty("httpclient.socket-send-buffer", 0));
        }
       
        connectionParams.setTcpNoDelay(true);
       
        connectionManager = new MultiThreadedHttpConnectionManager();
        connectionManager.setParams(connectionParams);
       
        // Set user agent string.
View Full Code Here

            }
        });
       
       
        // Set connection parameters.
        HttpConnectionManagerParams connectionParams = new HttpConnectionManagerParams();
        connectionParams.setConnectionTimeout(connectionTimeout);
        connectionParams.setSoTimeout(connectionTimeout);       
        connectionParams.setStaleCheckingEnabled(false);
       
        HttpClient httpClient = new HttpClient(clientParams);
        httpClient.getHttpConnectionManager().setParams(connectionParams);
       
        // httpClient.getParams().setAuthenticationPreemptive(true);
View Full Code Here

    {
      method = createHttpMethod();
     
      // Create an instance of HttpClient.
      HttpConnectionManager manager = new SimpleHttpConnectionManager();
      HttpConnectionManagerParams params = new HttpConnectionManagerParams();
      params.setSoTimeout(HTTP_TIMEOUT_IN_MS);
      params.setConnectionTimeout(HTTP_CONNECTION_TIMEOUT_IN_MS);
      manager.setParams(params);
      HttpClient client = new HttpClient(manager);
     
      // Execute the method.      
      int statusCode = client.executeMethod(method);
View Full Code Here

  public void run() throws Exception
  {

    activeThreads = 0;

    HttpConnectionManagerParams connManagerParams = new HttpConnectionManagerParams();
    connManagerParams.setDefaultMaxConnectionsPerHost(numberOfThreads * 2);
    MultiThreadedHttpConnectionManager manager = new MultiThreadedHttpConnectionManager();
    manager.setParams(connManagerParams);

    Server server = null;
    GetMethod getMethod = new GetMethod("http://localhost:" + port + "/");
View Full Code Here

  public void run() throws Exception
  {

    activeThreads = 0;

    HttpConnectionManagerParams connManagerParams = new HttpConnectionManagerParams();
    connManagerParams.setDefaultMaxConnectionsPerHost(numberOfThreads * 2);
    MultiThreadedHttpConnectionManager manager = new MultiThreadedHttpConnectionManager();
    manager.setParams(connManagerParams);

    Server server = null;
    GetMethod getMethod = new GetMethod("http://localhost:" + port + "/");
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.params.HttpConnectionManagerParams

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.