Examples of MultiThreadedHttpConnectionManager


Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

        final ConfigurationContext configContext = msgContext.getConfigurationContext();
        synchronized (lock) {
            httpClient = (HttpClient) configContext.getProperty(HTTPConstants.CACHED_HTTP_CLIENT);
            if (httpClient == null) {
                log.trace("Making new ConnectionManager");
                HttpConnectionManager connManager = new MultiThreadedHttpConnectionManager();

                // In case we need to set any params, do it here, but for now use defaults.
//                HttpConnectionManagerParams params = new HttpConnectionManagerParams();
//                params.setMaxConnectionsPerHost(HostConfiguration.ANY_HOST_CONFIGURATION, 200);
//                etc...
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

    public static HttpClient createConnection(String hostname, int port, String username, String password, FileSystemOptions fileSystemOptions) throws FileSystemException
    {
        HttpClient client;
        try
        {
            client = new HttpClient(new MultiThreadedHttpConnectionManager());
            final HostConfiguration config = new HostConfiguration();
            config.setHost(hostname, port);

            if (fileSystemOptions != null)
            {
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

    this.valueFactory = valueFactory;
    this.url = serverURL = url;

    // Use MultiThreadedHttpConnectionManager to allow concurrent access on
    // HttpClient
    manager = new MultiThreadedHttpConnectionManager();

    // Allow 20 concurrent connections to the same host (default is 2)
    HttpConnectionManagerParams params = new HttpConnectionManagerParams();
    params.setDefaultMaxConnectionsPerHost(20);
    // TODO 20% speed up by params.setStaleCheckingEnabled(false);
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

   * @param user can be NULL
   * @param password can be NULL
   * @return HttpClient
   */
  public static HttpClient getHttpClientInstance(String user, String password) {
    HttpConnectionManager connectionManager = new MultiThreadedHttpConnectionManager();
    HttpConnectionParams params = connectionManager.getParams();
    // wait max 10 seconds to establish connection
    params.setConnectionTimeout(10000);
    // a read() call on the InputStream associated with this Socket
    // will block for only this amount
    params.setSoTimeout(10000);
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

  private float opacity = 1.0f;

  public RasterLayerComponentImpl() {
    getConstraint().setAlignmentX(LayoutConstraint.JUSTIFIED);
    getConstraint().setAlignmentY(LayoutConstraint.JUSTIFIED);
    MultiThreadedHttpConnectionManager manager = new MultiThreadedHttpConnectionManager();
    manager.setMaxConnectionsPerHost(10);
    httpClient = new HttpClient(manager);
  }
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

   {
      super.setUp();
     
      this.name = ObjectName.getInstance(SERVER_NAME);

      this.manager = new MultiThreadedHttpConnectionManager();
     
      HttpConnectionManagerParams params = new HttpConnectionManagerParams();
      params.setDefaultMaxConnectionsPerHost(MAX_THREADS);
      params.setMaxTotalConnections(MAX_THREADS);
     
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

    public FlickrSearchService(String apiKey) throws URISyntaxException
    {
        this.apiKey = apiKey;
        clientRequestFactory = new ClientRequestFactory(
                new ApacheHttpClientExecutor(new HttpClient(
                        new MultiThreadedHttpConnectionManager())), new URI(
                        photoServer));

        ClientInterceptorRepositoryImpl interceptors = clientRequestFactory
                .getPrefixInterceptors();
        interceptors.registerInterceptor(new LoggingExecutionInterceptor());
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

      HttpClientParams params = new HttpClientParams();
      params.setSoTimeout(5000);
      params.setConnectionManagerTimeout(5000);


      MultiThreadedHttpConnectionManager cm = new
              MultiThreadedHttpConnectionManager();
      cm.setMaxConnectionsPerHost(10);
      cm.setMaxTotalConnections(100);

      org.apache.commons.httpclient.HttpClient client = new org.apache.commons.httpclient.HttpClient();
      client.setParams(params);
      client.setHttpConnectionManager(cm);
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

            valueFactory = new ValueFactoryQImpl(qValueFactory, resolver);

        } catch (URIException e) {
            throw new RepositoryException(e);
        }
        connectionManager = new MultiThreadedHttpConnectionManager();
    }
View Full Code Here

Examples of org.apache.commons.httpclient.MultiThreadedHttpConnectionManager

      return solrServer.getBaseURL();
    }
  }

  public LBHttpSolrServer(String... solrServerUrls) throws MalformedURLException {
    this(new HttpClient(new MultiThreadedHttpConnectionManager()), solrServerUrls);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.