Examples of ApacheHttpClient4Config


Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

    private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration,
                                                               MetricRegistry metrics) {
        HttpClient httpClient = new HttpClientBuilder(metrics).using(configuration).build("dictionary");
        ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
        ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
        Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
        config.getSingletons().add(new JacksonMessageBodyProvider(Jackson.newObjectMapper(), validator));
        return new ApacheHttpClient4(handler, config);
    }
View Full Code Here

Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

    }

    private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration) {
        HttpClient httpClient = new HttpClientBuilder().using(configuration).build();
        ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
        ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
        config.getSingletons().add(new JacksonMessageBodyProvider(new ObjectMapper(), new Validator()));
        return new ApacheHttpClient4(handler, config);
    }
View Full Code Here

Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

        APPLICATION_XML_UTF8_TYPE
    );
  }

  protected ApacheHttpClient4 doCreateHttpClientFor(final ConnectionInfo connectionInfo, final XStream xstream) {
    final ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
    config.getSingletons().add(new XStreamXmlProvider(xstream, APPLICATION_XML_UTF8_TYPE));
    // set _real_ URL for baseUrl, and not a redirection (typically http instead of https)
    config.getProperties().put(PROPERTY_FOLLOW_REDIRECTS, Boolean.FALSE);

    applyAuthenticationIfAny(connectionInfo, config);
    applyProxyIfAny(connectionInfo, config);

    // obey JSSE defined system properties
    config.getProperties().put(ApacheHttpClient4Config.PROPERTY_CONNECTION_MANAGER,
        new PoolingClientConnectionManager(SchemeRegistryFactory.createSystemDefault()));

    final ApacheHttpClient4 client = ApacheHttpClient4.create(config);

    // set UA
View Full Code Here

Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

    }

    private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration) {
        HttpClient httpClient = new HttpClientBuilder().using(configuration).build();
        ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
        ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
        config.getSingletons().add(new JacksonMessageBodyProvider(new ObjectMapper(), new Validator()));
        return new ApacheHttpClient4(handler, config);
    }
View Full Code Here

Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

    }

    private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration) {
        HttpClient httpClient = new HttpClientBuilder().using(configuration).build();
        ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
        ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
        config.getSingletons().add(new JacksonMessageBodyProvider(new ObjectMapperFactory().build(), new Validator()));
        return new ApacheHttpClient4(handler, config);
    }
View Full Code Here

Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

    private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration,
                                                               MetricRegistry metrics) {
        HttpClient httpClient = new HttpClientBuilder(metrics).using(configuration).build("calculator");
        ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
        ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
        Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
        config.getSingletons().add(new JacksonMessageBodyProvider(Jackson.newObjectMapper(), validator));
        return new ApacheHttpClient4(handler, config);
    }
View Full Code Here

Examples of com.sun.jersey.client.apache4.config.ApacheHttpClient4Config

    }

    private static ApacheHttpClient4 createDefaultJerseyClient(HttpClientConfiguration configuration) {
        HttpClient httpClient = new HttpClientBuilder().using(configuration).build();
        ApacheHttpClient4Handler handler = new ApacheHttpClient4Handler(httpClient, null, true);
        ApacheHttpClient4Config config = new DefaultApacheHttpClient4Config();
        config.getSingletons().add(new JacksonMessageBodyProvider(new ObjectMapperFactory().build(), new Validator()));
        return new ApacheHttpClient4(handler, config);
    }
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.