Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.SimpleHttpConnectionManager


        StringBuffer sb = new StringBuffer(8192);
        while (m.find()) {
            m.appendReplacement(sb, now + "-" + c++);
        }
        m.appendTail(sb);
        SimpleHttpConnectionManager mgr = new SimpleHttpConnectionManager()
        mgr.getParams().setConnectionTimeout(60000);
        mgr.getParams().setSoTimeout(60000);
        HttpClient httpClient = new HttpClient(mgr);
        PostMethod httpPostMethod = new PostMethod(u.toExternalForm());
        if (proxyServer != null && proxyServer.length() > 0) {
            httpClient.getState().setCredentials(new AuthScope(proxyServer, proxyPort),
                    new UsernamePasswordCredentials(username, password));
View Full Code Here


  }

 
 
  private void _doEndTag(Struct cfhttp) throws PageException, IOException  {
    HttpConnectionManager manager=new SimpleHttpConnectionManager();//MultiThreadedHttpConnectionManager();
    HttpClient client = new HttpClient(manager);
    HttpMethod httpMethod=createMethod(pageContext.getConfig(),this,client,url,port);
    try {
   
/////////////////////////////////////////// EXECUTE /////////////////////////////////////////////////
View Full Code Here

        // N.B. HostConfiguration.equals() includes proxy settings in the compare.
        HttpClient httpClient = map.get(hc);

        if ( httpClient == null )
        {
            httpClient = new HttpClient(new SimpleHttpConnectionManager());
            if (log.isDebugEnabled()) {
                log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient));
            }
            httpClient.setHostConfiguration(hc);
            map.put(hc, httpClient);
View Full Code Here

        Map map = (Map) httpClients.get();
    HttpClient httpClient = (HttpClient) map.get(hc);
   
    if ( httpClient == null )
    {
      httpClient = new HttpClient(new SimpleHttpConnectionManager());
      httpClient.setHostConfiguration(hc);
      map.put(hc, httpClient);
            // These items don't change, so only need to be done once
            if (useProxy) {
                if (PROXY_USER.length() > 0){
View Full Code Here

            resetSSLContext = false;
        }

        if ( httpClient == null )
        {
            httpClient = new HttpClient(new SimpleHttpConnectionManager());
            httpClient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,
                    new DefaultHttpMethodRetryHandler(RETRY_COUNT, false));
            if (log.isDebugEnabled()) {
                log.debug("Created new HttpClient: @"+System.identityHashCode(httpClient));
            }
View Full Code Here

    int conTimeout = DEFAULT_CON_TIMEOUT;
    if (properties != null && properties.containsKey(IConnectionPropertyConstants.CON_TIMEOUT))
      conTimeout = (Integer) properties.get(IConnectionPropertyConstants.CON_TIMEOUT);

    /* Create a new HttpClient */
    HttpClient client = new HttpClient(new SimpleHttpConnectionManager(true));

    /* Socket Timeout - Max. time to wait for an answer */
    client.getHttpConnectionManager().getParams().setSoTimeout(conTimeout);

    /* Connection Timeout - Max. time to wait for a connection */
 
View Full Code Here

   /** . */
   private URL driverURL;

   public Conversation(URL baseURL, String testName)
   {
      HttpClient client = new HttpClient(new SimpleHttpConnectionManager());
      client.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, null);
      client.getState().setCredentials(AuthScope.ANY, new UsernamePasswordCredentials("test", "test"));

      //
      this.client = client;
View Full Code Here

                HttpConnectionManagerParams params = new HttpConnectionManagerParams();
                params.setSoTimeout(CONNECTION_TIMEOUT);
                params.setConnectionTimeout(CONNECTION_TIMEOUT);
                // TODO: make the http client a well behaved http client, no more than x connections
                // per server (x admin configurable maybe), persistent connections and so on
                HttpConnectionManager manager = new SimpleHttpConnectionManager();
                manager.setParams(params);
                client.setHttpConnectionManager(manager);

                // prepare either a GET or a POST request
                if (ref.getMethod() == null || ref.getMethod() == MethodType.GET_LITERAL) {
                    GetMethod get = new GetMethod(ref.getHref());
View Full Code Here

    {
        HttpConnectionManagerParams managerParams = new HttpConnectionManagerParams();
        managerParams.setSoTimeout(timeout);
        managerParams.setConnectionTimeout(timeout);

        HttpConnectionManager manager = new SimpleHttpConnectionManager();
        manager.setParams(managerParams);

        HttpClientParams params = new HttpClientParams();
        params.setConnectionManagerTimeout(timeout);
        params.setSoTimeout(timeout);
View Full Code Here

                HttpConnectionManagerParams params = new HttpConnectionManagerParams();
                params.setSoTimeout(executor.getConnectionTimeout());
                params.setConnectionTimeout(executor.getConnectionTimeout());
                // TODO: make the http client a well behaved http client, no more than x connections
                // per server (x admin configurable maybe), persistent connections and so on
                HttpConnectionManager manager = new SimpleHttpConnectionManager();
                manager.setParams(params);
                client.setHttpConnectionManager(manager);

                // prepare either a GET or a POST request
                if (ref.getMethod() == null || ref.getMethod() == MethodType.GET_LITERAL) {
                    GetMethod get = new GetMethod(ref.getHref());
View Full Code Here

TOP

Related Classes of org.apache.commons.httpclient.SimpleHttpConnectionManager

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.