diff --git a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java index 49d59fd570b..2affef6dac8 100644 --- a/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java +++ b/core/src/main/java/org/elasticsearch/client/transport/TransportClient.java @@ -172,17 +172,17 @@ public class TransportClient extends AbstractClient { final TransportProxyClient proxy = new TransportProxyClient(settings, transportService, nodesService, actionModule.getActions().values().stream().map(x -> x.getAction()).collect(Collectors.toList())); - List pluginLifecycles = pluginComponents.stream() + List pluginLifecycleComponents = pluginComponents.stream() .filter(p -> p instanceof LifecycleComponent) .map(p -> (LifecycleComponent)p).collect(Collectors.toList()); - pluginLifecycles.addAll(pluginsService.getGuiceServiceClasses().stream() + pluginLifecycleComponents.addAll(pluginsService.getGuiceServiceClasses().stream() .map(injector::getInstance).collect(Collectors.toList())); - resourcesToClose.addAll(pluginLifecycles); + resourcesToClose.addAll(pluginLifecycleComponents); transportService.start(); transportService.acceptIncomingRequests(); - TransportClient transportClient = new TransportClient(injector, pluginLifecycles, nodesService, proxy); + TransportClient transportClient = new TransportClient(injector, pluginLifecycleComponents, nodesService, proxy); resourcesToClose.clear(); return transportClient; } finally { diff --git a/core/src/main/java/org/elasticsearch/node/Node.java b/core/src/main/java/org/elasticsearch/node/Node.java index 1cc8723cc6b..dbd89a0ea01 100644 --- a/core/src/main/java/org/elasticsearch/node/Node.java +++ b/core/src/main/java/org/elasticsearch/node/Node.java @@ -324,13 +324,13 @@ public class Node implements Closeable { ); injector = modules.createInjector(); - List pluginLifecycles = pluginComponents.stream() + List pluginLifecycleComponents = pluginComponents.stream() .filter(p -> p instanceof LifecycleComponent) .map(p -> (LifecycleComponent)p).collect(Collectors.toList()); - pluginLifecycles.addAll(pluginsService.getGuiceServiceClasses().stream() + pluginLifecycleComponents.addAll(pluginsService.getGuiceServiceClasses().stream() .map(injector::getInstance).collect(Collectors.toList())); - resourcesToClose.addAll(pluginLifecycles); - pluginLifecycleComponents = Collections.unmodifiableList(pluginLifecycles); + resourcesToClose.addAll(pluginLifecycleComponents); + this.pluginLifecycleComponents = Collections.unmodifiableList(pluginLifecycleComponents); client.intialize(injector.getInstance(new Key>() {}));