diff --git a/server/src/main/java/io/druid/guice/http/AbstractHttpClientProvider.java b/server/src/main/java/io/druid/guice/http/AbstractHttpClientProvider.java index d61840935ac..7f83898e90c 100644 --- a/server/src/main/java/io/druid/guice/http/AbstractHttpClientProvider.java +++ b/server/src/main/java/io/druid/guice/http/AbstractHttpClientProvider.java @@ -36,9 +36,7 @@ public abstract class AbstractHttpClientProvider implements Prov private final Key> configKey; private final Key sslContextKey; - private Provider> configProvider; - private Provider lifecycleProvider; - private Binding sslContextBinding; + private Injector injector; public AbstractHttpClientProvider() { @@ -73,9 +71,7 @@ public abstract class AbstractHttpClientProvider implements Prov @Inject public void configure(Injector injector) { - configProvider = injector.getProvider(configKey); - sslContextBinding = injector.getExistingBinding(sslContextKey); - lifecycleProvider = injector.getProvider(Lifecycle.class); + this.injector = injector; } public Key> getConfigKey() @@ -90,16 +86,16 @@ public abstract class AbstractHttpClientProvider implements Prov public Provider> getConfigProvider() { - return configProvider; + return injector.getProvider(configKey); } public Provider getLifecycleProvider() { - return lifecycleProvider; + return injector.getProvider(Lifecycle.class); } public Binding getSslContextBinding() { - return sslContextBinding; + return injector.getExistingBinding(sslContextKey); } }