java.lang.Object
org.elasticsearch.jdk.ModuleQualifiedExportsService
An object that provides a callback for qualified exports and opens.
Because Elasticsearch sometimes constructs module layers dynamically
(eg for plugins), qualified exports are silently dropped if a target
module does not yet exist. Modules that have qualified exports to
other dynamically created modules should implement this service so
that when a qualified export module is loaded, the exporting or
opening module can be informed and export or open dynamically to
the newly loaded module.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidaddExports(String pkg, Module target) Add a qualified export.voidaddExportsAndOpens(Module target) Add exports and opens for a target module.static voidaddExportsService(Map<String, List<ModuleQualifiedExportsService>> qualifiedExports, ModuleQualifiedExportsService exportsService, String moduleName) A utility method to add an export service to the given map of exports services.protected abstract voidAdd a qualified open.static voidexposeQualifiedExportsAndOpens(Module target, Map<String, List<ModuleQualifiedExportsService>> qualifiedExports) Adds qualified exports and opens declared in other upstream modules to the target module.static Map<String, List<ModuleQualifiedExportsService>> Returns a mapping of ModuleQualifiedExportsServices that exist in the boot layer.Returns all qualified targets of the owning module.
-
Field Details
-
module
-
-
Constructor Details
-
ModuleQualifiedExportsService
protected ModuleQualifiedExportsService() -
ModuleQualifiedExportsService
-
-
Method Details
-
addExportsService
public static void addExportsService(Map<String, List<ModuleQualifiedExportsService>> qualifiedExports, ModuleQualifiedExportsService exportsService, String moduleName) A utility method to add an export service to the given map of exports services. The map is inverted, keyed by the target module name to which an exports/opens applies.- Parameters:
qualifiedExports- A map of modules to which qualfied exports need to be appliedexportsService- The exports service to add to the mapmoduleName- The name of the module that is doing the exporting
-
exposeQualifiedExportsAndOpens
public static void exposeQualifiedExportsAndOpens(Module target, Map<String, List<ModuleQualifiedExportsService>> qualifiedExports) Adds qualified exports and opens declared in other upstream modules to the target module. This is required since qualified statements targeting yet-to-be-created modules, i.e. plugins, are silently dropped when the boot layer is created. -
getBootServices
Returns a mapping of ModuleQualifiedExportsServices that exist in the boot layer. -
getTargets
Returns all qualified targets of the owning module. -
addExportsAndOpens
Add exports and opens for a target module.- Parameters:
target- A module whose name exists ingetTargets()
-
addExports
Add a qualified export. This should always be implemented as follows:module.addExports(pkg, target); -
addOpens
Add a qualified open. This should always be implemented as follows:module.addOpens(pkg, target);
-