Package com.ning.http.client

Examples of com.ning.http.client.AsyncHttpClientConfig


      }
    } else {
      this.repair = null;
    }

    AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
        .addRequestFilter(new ThrottleRequestFilter(MAX_CONNECTIONS))
        .setConnectionTimeoutInMs(CONNECTION_TIMEOUT)
        .setIdleConnectionInPoolTimeoutInMs(IDLE_CONNECTION_TIMEOUT)
        .setRequestTimeoutInMs(REQUEST_TIMEOUT).setMaxRequestRetry(0).build();
    this.asyncHttpClient = new AsyncHttpClient(config);
View Full Code Here


    }

    protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException, GeneralSecurityException {

        AsyncHttpClient c;
        AsyncHttpClientConfig config;

        AsyncHttpClientConfig.Builder builder =
                new AsyncHttpClientConfig.Builder();

        builder.setSSLContext(new SSLContextParameters().createSSLContext());
View Full Code Here

    }
   
    public final static AsyncHttpClient createDefaultAsyncHttpClient(int requestTimeoutInSeconds, AsyncHttpProviderConfig asyncHttpProviderConfig) {
        AsyncHttpClientConfig.Builder b = new AsyncHttpClientConfig.Builder();
        b.setFollowRedirect(true).setConnectionTimeout(-1).setReadTimeout(requestTimeoutInSeconds == -1 ? requestTimeoutInSeconds : requestTimeoutInSeconds * 1000).setUserAgent(WASYNC_USER_AGENT);
        AsyncHttpClientConfig config = b.setAsyncHttpClientProviderConfig(asyncHttpProviderConfig).build();
        return new AsyncHttpClient(config);
    }
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 {
      this.repair = null;
    }

    AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder()
        .addRequestFilter(new ThrottleRequestFilter(MAX_CONNECTIONS))
        .setConnectionTimeoutInMs(CONNECTION_TIMEOUT)
        .setIdleConnectionInPoolTimeoutInMs(IDLE_CONNECTION_TIMEOUT)
        .setRequestTimeoutInMs(REQUEST_TIMEOUT).setMaxRequestRetry(0).build();
    this.asyncHttpClient = new AsyncHttpClient(config);
View Full Code Here

        // START SNIPPET: e1
        // create a client config builder
        AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
        // use the builder to set the options we want, in this case we want to follow redirects and try
        // at most 3 retries to send a request to the host
        AsyncHttpClientConfig config = builder.setFollowRedirects(true).setMaxRequestRetry(3).build();

        // lookup AhcComponent
        AhcComponent component = context.getComponent("ahc", AhcComponent.class);
        // and set our custom client config to be used
        component.setClientConfig(config);
View Full Code Here

    }

    protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException, GeneralSecurityException {

        AsyncHttpClient c;
        AsyncHttpClientConfig config;

        AsyncHttpClientConfig.Builder builder =
                new AsyncHttpClientConfig.Builder();

        builder.setSSLContext(new SSLContextParameters().createSSLContext());
View Full Code Here

    }

    protected AsyncHttpClient createAsyncHttpSSLClient() throws IOException, GeneralSecurityException {

        AsyncHttpClient c;
        AsyncHttpClientConfig config;

        AsyncHttpClientConfig.Builder builder =
                new AsyncHttpClientConfig.Builder();

        builder.setSSLContext(new SSLContextParameters().createSSLContext());
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

        // START SNIPPET: e1
        // create a client config builder
        AsyncHttpClientConfig.Builder builder = new AsyncHttpClientConfig.Builder();
        // use the builder to set the options we want, in this case we want to follow redirects and try
        // at most 3 retries to send a request to the host
        AsyncHttpClientConfig config = builder.setFollowRedirects(true).setMaxRequestRetry(3).build();

        // lookup AhcComponent
        AhcComponent component = context.getComponent("ahc", AhcComponent.class);
        // and set our custom client config to be used
        component.setClientConfig(config);
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.