java.lang.Object
org.elasticsearch.plugins.PluginsLoader
This class is used to load modules and module layers for each plugin during
node initialization prior to enablement of entitlements. This allows entitlements
to have all the plugin information they need prior to starting.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
Tuple of module layer and loader.static interface
Contains information about theClassLoader
required to load a plugin -
Method Summary
Modifier and TypeMethodDescriptionstatic PluginsLoader
createPluginsLoader
(Set<PluginBundle> modules, Set<PluginBundle> plugins, Map<String, Set<String>> pluginsWithNativeAccess) Constructs a new PluginsLoaderstatic PluginsLoader
createPluginsLoader
(Set<PluginBundle> modules, Set<PluginBundle> plugins, Map<String, Set<String>> pluginsWithNativeAccess, boolean withServerExports) Constructs a new PluginsLoaderstatic Set
<PluginBundle> loadModulesBundles
(Path modulesDirectory) Loads a set of PluginBundles from the modules directorystatic Set
<PluginBundle> loadPluginsBundles
(Path pluginsDirectory) Loads a set of PluginBundles from the plugins directory
-
Method Details
-
loadModulesBundles
Loads a set of PluginBundles from the modules directory- Parameters:
modulesDirectory
- The directory modules exist in, or null if modules should not be loaded from the filesystem
-
loadPluginsBundles
Loads a set of PluginBundles from the plugins directory- Parameters:
pluginsDirectory
- The directory plugins exist in, or null if plugins should not be loaded from the filesystem
-
createPluginsLoader
public static PluginsLoader createPluginsLoader(Set<PluginBundle> modules, Set<PluginBundle> plugins, Map<String, Set<String>> pluginsWithNativeAccess) Constructs a new PluginsLoader- Parameters:
modules
- The set of module bundles present on the filesystemplugins
- The set of plugin bundles present on the filesystempluginsWithNativeAccess
- A map plugin name -> set of module names for which we want to enable native access
-
createPluginsLoader
public static PluginsLoader createPluginsLoader(Set<PluginBundle> modules, Set<PluginBundle> plugins, Map<String, Set<String>> pluginsWithNativeAccess, boolean withServerExports) Constructs a new PluginsLoader- Parameters:
modules
- The set of module bundles present on the filesystemplugins
- The set of plugin bundles present on the filesystempluginsWithNativeAccess
- A map plugin name -> set of module names for which we want to enable native accesswithServerExports
-true
to add server module exports
-
moduleDescriptors
-
pluginDescriptors
-
pluginLayers
-
moduleBundles
-
pluginBundles
-