diff --git a/core/src/main/java/org/elasticsearch/node/Node.java b/core/src/main/java/org/elasticsearch/node/Node.java index 68f562c9b49..ea7a97cab63 100644 --- a/core/src/main/java/org/elasticsearch/node/Node.java +++ b/core/src/main/java/org/elasticsearch/node/Node.java @@ -345,7 +345,8 @@ public class Node implements Closeable { final NamedWriteableRegistry namedWriteableRegistry = new NamedWriteableRegistry(namedWriteables); client = new NodeClient(settings, threadPool); Collection pluginComponents = pluginsService.filterPlugins(Plugin.class).stream() - .flatMap(p -> p.createComponents(client, clusterService, threadPool, resourceWatcherService).stream()) + .flatMap(p -> p.createComponents(client, clusterService, threadPool, resourceWatcherService, + scriptModule.getScriptService()).stream()) .collect(Collectors.toList()); modules.add(b -> { b.bind(PluginsService.class).toInstance(pluginsService); diff --git a/core/src/main/java/org/elasticsearch/plugins/Plugin.java b/core/src/main/java/org/elasticsearch/plugins/Plugin.java index 46e4f59c439..b7223541644 100644 --- a/core/src/main/java/org/elasticsearch/plugins/Plugin.java +++ b/core/src/main/java/org/elasticsearch/plugins/Plugin.java @@ -38,6 +38,7 @@ import org.elasticsearch.common.settings.SettingsModule; import org.elasticsearch.index.IndexModule; import org.elasticsearch.indices.analysis.AnalysisModule; import org.elasticsearch.script.ScriptModule; +import org.elasticsearch.script.ScriptService; import org.elasticsearch.threadpool.ExecutorBuilder; import org.elasticsearch.threadpool.ThreadPool; import org.elasticsearch.watcher.ResourceWatcherService; @@ -82,9 +83,10 @@ public abstract class Plugin { * @param clusterService A service to allow watching and updating cluster state * @param threadPool A service to allow retrieving an executor to run an async action * @param resourceWatcherService A service to watch for changes to node local files + * @param scriptService A service to allow running scripts on the local node */ public Collection createComponents(Client client, ClusterService clusterService, ThreadPool threadPool, - ResourceWatcherService resourceWatcherService) { + ResourceWatcherService resourceWatcherService, ScriptService scriptService) { return Collections.emptyList(); }