Plugins: Add ScriptService to dependencies available for plugin components
This commit is contained in:
parent
227463c356
commit
fe823c857b
|
@ -333,7 +333,8 @@ public class Node implements Closeable {
|
||||||
modules.add(settingsModule);
|
modules.add(settingsModule);
|
||||||
client = new NodeClient(settings, threadPool);
|
client = new NodeClient(settings, threadPool);
|
||||||
Collection<Object> pluginComponents = pluginsService.filterPlugins(Plugin.class).stream()
|
Collection<Object> 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());
|
.collect(Collectors.toList());
|
||||||
modules.add(b -> {
|
modules.add(b -> {
|
||||||
b.bind(PluginsService.class).toInstance(pluginsService);
|
b.bind(PluginsService.class).toInstance(pluginsService);
|
||||||
|
|
|
@ -34,6 +34,7 @@ import org.elasticsearch.common.settings.SettingsModule;
|
||||||
import org.elasticsearch.index.IndexModule;
|
import org.elasticsearch.index.IndexModule;
|
||||||
import org.elasticsearch.indices.analysis.AnalysisModule;
|
import org.elasticsearch.indices.analysis.AnalysisModule;
|
||||||
import org.elasticsearch.script.ScriptModule;
|
import org.elasticsearch.script.ScriptModule;
|
||||||
|
import org.elasticsearch.script.ScriptService;
|
||||||
import org.elasticsearch.threadpool.ExecutorBuilder;
|
import org.elasticsearch.threadpool.ExecutorBuilder;
|
||||||
import org.elasticsearch.threadpool.ThreadPool;
|
import org.elasticsearch.threadpool.ThreadPool;
|
||||||
import org.elasticsearch.watcher.ResourceWatcherService;
|
import org.elasticsearch.watcher.ResourceWatcherService;
|
||||||
|
@ -78,9 +79,10 @@ public abstract class Plugin {
|
||||||
* @param clusterService A service to allow watching and updating cluster state
|
* @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 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 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<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
|
public Collection<Object> createComponents(Client client, ClusterService clusterService, ThreadPool threadPool,
|
||||||
ResourceWatcherService resourceWatcherService) {
|
ResourceWatcherService resourceWatcherService, ScriptService scriptService) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue