Package com.ning.http.client

Examples of com.ning.http.client.AsyncHttpClientConfig


    @Override
    protected void doStart() throws Exception {
        super.doStart();
        if (client == null) {
           
            AsyncHttpClientConfig config = null;
           
            if (clientConfig != null) {
                AsyncHttpClientConfig.Builder builder = AhcComponent.cloneConfig(clientConfig);
               
                if (sslContextParameters != null) {
View Full Code Here


    Stats execute(final URI targetURI, byte[] content, int n, int c) throws Exception {
        if (this.client != null) {
            this.client.close();
        }
        AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
            .setAllowPoolingConnection(true)
            .setCompressionEnabled(false)
            .setMaximumConnectionsPerHost(c)
            .setMaximumConnectionsTotal(2000)
            .setRequestTimeoutInMs(15000)
View Full Code Here

        if (asyncClientCustomizer != null) {
            builder = asyncClientCustomizer.customize(client, config, builder);
        }

        AsyncHttpClientConfig asyncClientConfig = builder.build();

        this.grizzlyClient = new AsyncHttpClient(new GrizzlyAsyncHttpProvider(asyncClientConfig), asyncClientConfig);
    }
View Full Code Here

    Stats execute(final URI targetURI, byte[] content, int n, int c) throws Exception {
        if (this.client != null) {
            this.client.close();
        }
        AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
            .setAllowPoolingConnection(true)
            .setCompressionEnabled(false)
            .setMaximumConnectionsPerHost(c)
            .setMaximumConnectionsTotal(2000)
            .setRequestTimeoutInMs(15000)
View Full Code Here

    Stats execute(final URI targetURI, byte[] content, int n, int c) throws Exception {
        if (this.client != null) {
            this.client.close();
        }
        AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
            .setAllowPoolingConnection(true)
            .setCompressionEnabled(false)
            .setMaximumConnectionsPerHost(c)
            .setMaximumConnectionsTotal(2000)
            .setRequestTimeoutInMs(15000)
View Full Code Here

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        if (client == null) {
           
            AsyncHttpClientConfig config = null;
           
            if (clientConfig != null) {
                AsyncHttpClientConfig.Builder builder = AhcComponent.cloneConfig(clientConfig);
               
                if (sslContextParameters != null) {
View Full Code Here

        } else {
            executorService = Executors.newCachedThreadPool();
            builder.setExecutorService(executorService);
        }

        AsyncHttpClientConfig asyncClientConfig = builder.setAllowPoolingConnection(true).build();
        this.client = new AsyncHttpClient(new GrizzlyAsyncHttpProvider(asyncClientConfig), asyncClientConfig);
    }
View Full Code Here

   }

   @Singleton
   @Provides
   AsyncHttpClient provideNingClient() {
      AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().setFollowRedirects(true)
               .build();
      return new AsyncHttpClient(config);
   }
View Full Code Here

     */
    protected BaseAHCBasedNetworkClient(CONFIG config)
    {
        _config = config;
        _mapper = config.getJsonMapper();
        AsyncHttpClientConfig ahcConfig = new AsyncHttpClientConfig.Builder()
            .setCompressionEnabled(false)
            .setFollowRedirects(false)
            .setAllowPoolingConnection(true)
            .setConnectionTimeoutInMs((int)config.getCallConfig().getConnectTimeoutMsecs())
            .setMaximumConnectionsPerHost(5) // default of 2 is too low
View Full Code Here

        } else {
            this.executorService = Executors.newCachedThreadPool();
            builder.setExecutorService(this.executorService);
        }
        final AsyncHttpClientConfig config = builder.build();
        this.client = new AsyncHttpClient(new GrizzlyAsyncHttpProvider(config), config);
        this.clientConfig = cc;
    }
View Full Code Here

TOP

Related Classes of com.ning.http.client.AsyncHttpClientConfig

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.