Package org.apache.commons.httpclient

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager


                httpClient = (HttpClient) msgContext.getConfigurationContext()
                        .getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            }
            if (httpClient != null)
                return httpClient;
            MultiThreadedHttpConnectionManager connectionManager =
                new MultiThreadedHttpConnectionManager();
            httpClient = new HttpClient(connectionManager);
            msgContext.getConfigurationContext()
                .setProperty(HTTPConstants.CACHED_HTTP_CLIENT, httpClient);
        } else {
            HttpConnectionManager connManager =
                    (HttpConnectionManager) msgContext.getProperty(
                            HTTPConstants.MULTITHREAD_HTTP_CONNECTION_MANAGER);
            if (connManager == null) {
                connManager =
                        (HttpConnectionManager) msgContext.getProperty(
                                HTTPConstants.MUTTITHREAD_HTTP_CONNECTION_MANAGER);
            }
            if(connManager != null){
                httpClient = new HttpClient(connManager);
            } else {
                //Multi threaded http connection manager has set as the default
                connManager = new MultiThreadedHttpConnectionManager();
                httpClient = new HttpClient(connManager);
            }
        }

        // Get the timeout values set in the runtime
View Full Code Here


     * @see #DEFAULT_TIMEOUT
     * @since 2.8
     */
    private static HttpClient createHttpClient( Settings settings, URL url )
    {
        HttpClient httpClient = new HttpClient( new MultiThreadedHttpConnectionManager() );
        httpClient.getHttpConnectionManager().getParams().setConnectionTimeout( DEFAULT_TIMEOUT );
        httpClient.getHttpConnectionManager().getParams().setSoTimeout( DEFAULT_TIMEOUT );
        httpClient.getParams().setBooleanParameter( HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true );

        // Some web servers don't allow the default user-agent sent by httpClient
View Full Code Here

    {
        if ( !m_bAllowConnection )
            throw new WikiCancelException();

        if ( m_aConnectionManager == null )
            m_aConnectionManager = new MultiThreadedHttpConnectionManager();

        if ( m_aClient == null )
        {
            m_aClient = new HttpClient( m_aConnectionManager );
            m_aClient.getParams().setParameter( "http.protocol.cookie-policy", CookiePolicy.BROWSER_COMPATIBILITY );
View Full Code Here

class StandaloneAppEngineClient extends AppEngineClient {
  private final HttpClient httpClient;

  StandaloneAppEngineClient(RemoteApiOptions options, List<Cookie> authCookies, String appId) {
    super(options, authCookies, appId);
    HttpClient httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
    httpClient.getState().addCookies(getAuthCookies());
    this.httpClient = httpClient;
  }
View Full Code Here

   * Sets the socket read timeout to {@link #DEFAULT_READ_TIMEOUT_MILLISECONDS}.
   * @see org.apache.commons.httpclient.HttpClient
   * @see org.apache.commons.httpclient.MultiThreadedHttpConnectionManager
   */
  public CommonsHttpInvokerRequestExecutor() {
    this.httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
    setReadTimeout(DEFAULT_READ_TIMEOUT_MILLISECONDS);
  }
View Full Code Here

  /**
   * Create a new instance of the <code>CommonsHttpRequestFactory</code> with a default
   * {@link HttpClient} that uses a default {@link MultiThreadedHttpConnectionManager}.
   */
  public CommonsClientHttpRequestFactory() {
    this.httpClient = new HttpClient(new MultiThreadedHttpConnectionManager());
    this.setReadTimeout(DEFAULT_READ_TIMEOUT_MILLISECONDS);
  }
View Full Code Here

  private MultiThreadedHttpConnectionManager manager;

  private HttpClient client;

  public Connector() {
    manager = new MultiThreadedHttpConnectionManager();
    // manager.setMaxConnectionsPerHost(6);
    // manager.setMaxTotalConnections(18);
    // manager.setConnectionStaleCheckingEnabled(true);
    // open the conversation
    client = new HttpClient(manager);
View Full Code Here

    if (url != null && url.length() > 3) {
      BufferedInputStream bis = null;
      GetMethod method = null;
      try {
        HttpClient client = new HttpClient();
        client = new HttpClient(new MultiThreadedHttpConnectionManager());
        client.getHttpConnectionManager().getParams().setConnectionTimeout(30000);

        String extension = "jpg";
        int index = url.lastIndexOf('.');
        if (index > 0) {
View Full Code Here

    }
    return null;
  }

  public Connector() {
    manager = new MultiThreadedHttpConnectionManager();
    // manager.setMaxConnectionsPerHost(6);
    // manager.setMaxTotalConnections(18);
    // manager.setConnectionStaleCheckingEnabled(true);
    // open the conversation
    client = new HttpClient(manager);
View Full Code Here

    if (url != null && url.length() > 3) {
      BufferedInputStream bis = null;
      GetMethod method = null;
      try {
        HttpClient client = new HttpClient();
        client = new HttpClient(new MultiThreadedHttpConnectionManager());
        client.getHttpConnectionManager().getParams().setConnectionTimeout(30000);

        String extension = "jpg";
        int index = url.lastIndexOf('.');
        if (index > 0) {
View Full Code Here

TOP

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

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.