diff options
author | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2019-12-02 14:59:08 +0100 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@verizonmedia.com> | 2019-12-02 15:35:49 +0100 |
commit | 313236a5df9390dbd54e37a31665ba6277dd2713 (patch) | |
tree | bed3c47132edd855fe880640dc577d9fe2110056 /vespa-http-client/src | |
parent | 39c902f023ba4356a5bc9fd525dacf23b977eb04 (diff) |
Build http-utils with jdk8 and remove reflection hack
Diffstat (limited to 'vespa-http-client/src')
2 files changed, 2 insertions, 27 deletions
diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java index 00f52d6337f..e7a1e6615f4 100644 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java +++ b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/ApacheGatewayConnection.java @@ -1,6 +1,7 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.http.client.core.communication; +import ai.vespa.util.http.VespaHttpClientBuilder; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.yahoo.vespa.http.client.config.ConnectionParams; @@ -396,7 +397,7 @@ class ApacheGatewayConnection implements GatewayConnection { public HttpClient createClient() { HttpClientBuilder clientBuilder; if (connectionParams.useTlsConfigFromEnvironment()) { - clientBuilder = VespaTlsAwareClientBuilder.createHttpClientBuilder(); + clientBuilder = VespaHttpClientBuilder.create(); } else { clientBuilder = HttpClientBuilder.create(); if (useSsl && connectionParams.getSslContext() != null) { diff --git a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/VespaTlsAwareClientBuilder.java b/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/VespaTlsAwareClientBuilder.java deleted file mode 100644 index be67e11963e..00000000000 --- a/vespa-http-client/src/main/java/com/yahoo/vespa/http/client/core/communication/VespaTlsAwareClientBuilder.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.http.client.core.communication; - -import org.apache.http.impl.client.HttpClientBuilder; - -/** - * A static factory for VespaHttpClientBuilder. - * The main purpose of this class is to avoid references to classes not compiled with JDK8. - * - * @author bjorncs - */ -// TODO Remove use of reflection once vespa-http-client only targets JDK11 -// The VespaTlsAwareClientBuilder class refers to classes in security-utils / http-utils that targets JDK11+. -class VespaTlsAwareClientBuilder { - - private VespaTlsAwareClientBuilder() {} - - static HttpClientBuilder createHttpClientBuilder() { - try { - Class<?> builderClass = Class.forName("ai.vespa.util.http.VespaHttpClientBuilder"); - return (HttpClientBuilder) builderClass.getMethod("create").invoke(null); - } catch (ReflectiveOperationException e) { - throw new RuntimeException(e); - } - } -} |