Class PluginsService

java.lang.Object
org.elasticsearch.plugins.PluginsService
All Implemented Interfaces:
ReportingService<PluginsAndModules>

public class PluginsService extends Object implements ReportingService<PluginsAndModules>
  • Field Details

  • Constructor Details

    • PluginsService

      public PluginsService(Settings settings, Path configPath, Path modulesDirectory, Path pluginsDirectory, Collection<Class<? extends Plugin>> classpathPlugins)
      Constructs a new PluginService
      Parameters:
      settings - The settings of the system
      modulesDirectory - The directory modules exist in, or null if modules should not be loaded from the filesystem
      pluginsDirectory - The directory plugins exist in, or null if plugins should not be loaded from the filesystem
      classpathPlugins - Plugins that exist in the classpath which should be loaded
  • Method Details

    • getPluginSettings

      public List<Setting<?>> getPluginSettings()
    • getPluginSettingsFilter

      public List<String> getPluginSettingsFilter()
    • updatedSettings

      public Settings updatedSettings()
    • createGuiceModules

      public Collection<Module> createGuiceModules()
    • getExecutorBuilders

      public List<ExecutorBuilder<?>> getExecutorBuilders(Settings settings)
    • getGuiceServiceClasses

      public Collection<Class<? extends LifecycleComponent>> getGuiceServiceClasses()
      Returns all classes injected into guice by plugins which extend LifecycleComponent.
    • onIndexModule

      public void onIndexModule(IndexModule indexModule)
    • info

      public PluginsAndModules info()
      Get information about plugins and modules
      Specified by:
      info in interface ReportingService<PluginsAndModules>
    • findPluginDirs

      public static List<Path> findPluginDirs(Path rootPath) throws IOException
      Extracts all installed plugin directories from the provided rootPath.
      Parameters:
      rootPath - the path where the plugins are installed
      Returns:
      a list of all plugin paths installed in the rootPath
      Throws:
      IOException - if an I/O exception occurred reading the directories
    • verifyCompatibility

      public static void verifyCompatibility(PluginDescriptor info)
      Verify the given plugin is compatible with the current Elasticsearch installation.
    • checkForFailedPluginRemovals

      public static void checkForFailedPluginRemovals(Path pluginsDirectory) throws IOException
      Throws:
      IOException
    • getModuleBundles

      public static Set<PluginsService.Bundle> getModuleBundles(Path modulesDirectory) throws IOException
      Get bundles for plugins installed in the given modules directory.
      Throws:
      IOException
    • getPluginBundles

      public static Set<PluginsService.Bundle> getPluginBundles(Path pluginsDirectory) throws IOException
      Get bundles for plugins installed in the given plugins directory.
      Throws:
      IOException
    • sortBundles

      public static List<PluginsService.Bundle> sortBundles(Set<PluginsService.Bundle> bundles)
      Return the given bundles, sorted in dependency loading order. This sort is stable, so that if two plugins do not have any interdependency, their relative order from iteration of the provided set will not change.
      Throws:
      IllegalStateException - if a dependency cycle is found
    • checkBundleJarHell

      public static void checkBundleJarHell(Set<URL> classpath, PluginsService.Bundle bundle, Map<String,Set<URL>> transitiveUrls)
    • filterPlugins

      public <T> List<T> filterPlugins(Class<T> type)