boot method is called early in the startup to initialize
the module system. In summary, the boot method creates a Configuration by
resolving a set of module names specified via the launcher (or equivalent)
-m and --add-modules options. The modules are located on a module path that
is constructed from the upgrade module path, system modules, and application
module path. The Configuration is instantiated as the boot layer with each
module in the configuration defined to a class loader.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class | ModuleBootstrap.
Counters for startup performance analysis. |
| public static enum | |
| public static enum | |
| pack-priv static class | ModuleBootstrap.
Wraps a (potentially not thread safe) ModuleFinder created during startup for use after startup. |
| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final String | |
| private static final ModuleBootstrap. | |
| private static final ModuleBootstrap. | |
| private static final String | |
| private static final Set | |
| private static final JavaLangAccess | |
| private static final JavaLangModuleAccess | |
| private static volatile ModuleFinder | |
| private static final String | |
| private static final ModulePatcher | |
| private static volatile ModuleFinder | |
| private static final Set |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static void | addEnableFinalFieldMutation(ModuleLayer bootLayer)
Process the modules specified to --enable-final-field-mutation and grant the capability to mutate finals to specified named modules or all unnamed modules. |
| private static void | addEnableNativeAccess(ModuleLayer layer)
Grants native access to modules selected using the --enable-native-access command line option, and also to JDK modules that need the access. |
| private static void | addEnableNativeAccess(ModuleLayer layer, Set<String> moduleNames, boolean shouldWarn)
Grants native access for the given modules in the given layer. |
| private static void | addExtraExportsAndOpens(ModuleLayer bootLayer)
Process the --add-exports and --add-opens options to export/open additional packages specified on the command-line. |
| private static void | |
| private static void | addExtraReads(ModuleLayer bootLayer)
Process the --add-reads options to add any additional read edges that are specified on the command-line. |
| private static Set | |
| private static boolean | allJrtOrModularJar(Configuration cf)
Returns true if all modules in the configuration are in the run-time image or modular JAR files. |
| public static ModuleLayer | |
| private static ModuleLayer | |
| private static boolean | |
| private static void | |
| private static void | checkSplitPackages(Configuration cf, Function<String, ClassLoader> clf)
Checks for split packages between modules defined to the built-in class loaders. |
| private static boolean | containsIncubatorModule(Configuration cf)
Returns true if the configuration contains an incubator module. |
| private static boolean | containsSplitPackages(Configuration cf)
Returns true if the configuration contains modules with overlapping packages. |
| private static Map | |
| private static Map | |
| private static Set | decodeEnableFinalFieldMutation()
Returns the set of module names specified by --enable-final-field-mutation options. |
| private static Set | decodeEnableNativeAccess()
Returns the set of module names specified by --enable-native-access options. |
| private static ModuleBootstrap. | |
| private static ModuleBootstrap. | |
| pack-priv static void | |
| private static ModuleFinder | |
| private static String | |
| private static String | |
| public static ModuleBootstrap. | |
| public static ModuleBootstrap. | |
| private static ModulePatcher | initModulePatcher()
Initialize the module patcher for the initial configuration passed on the value of the --patch-module options. |
| private static boolean | |
| public static ModuleFinder | |
| private static ModuleFinder | limitFinder(ModuleFinder finder, Set<String> roots, Set<String> otherMods)
Returns a ModuleFinder that limits observability to the given root modules, their transitive dependences, plus a set of other modules. |
| private static Set | |
| private static void | loadModules(Configuration cf, Function<String, ClassLoader> clf)
Load/register the modules to the built-in class loaders. |
| pack-priv static String | |
| public static ModulePatcher | |
| pack-priv static String | |
| public static ModuleFinder | unlimitedFinder()
Returns the ModuleFinder for the initial configuration before observability is limited by the --limit-modules command line option. |
| pack-priv static void | |
| pack-priv static void |
| ADD_EXPORTS | back to summary |
|---|---|
| private static final String ADD_EXPORTS | |
| ADD_MODULES | back to summary |
|---|---|
| private static final String ADD_MODULES | |
| ADD_OPENS | back to summary |
|---|---|
| private static final String ADD_OPENS | |
| ADD_READS | back to summary |
|---|---|
| private static final String ADD_READS | |
| ALL_DEFAULT | back to summary |
|---|---|
| private static final String ALL_DEFAULT | |
| ALL_MODULE_PATH | back to summary |
|---|---|
| private static final String ALL_MODULE_PATH | |
| ALL_SYSTEM | back to summary |
|---|---|
| private static final String ALL_SYSTEM | |
| ALL_UNNAMED | back to summary |
|---|---|
| private static final String ALL_UNNAMED | |
| ENABLE_NATIVE_ACCESS | back to summary |
|---|---|
| private static final String ENABLE_NATIVE_ACCESS | |
| ILLEGAL_FINAL_FIELD_MUTATION | back to summary |
|---|---|
| private static final ModuleBootstrap. | |
| ILLEGAL_NATIVE_ACCESS | back to summary |
|---|---|
| private static final ModuleBootstrap. | |
| JAVA_BASE | back to summary |
|---|---|
| private static final String JAVA_BASE | |
| JDK_NATIVE_ACCESS_MODULES | back to summary |
|---|---|
| private static final Set<String> JDK_NATIVE_ACCESS_MODULES | |
| JLA | back to summary |
|---|---|
| private static final JavaLangAccess JLA | |
| JLMA | back to summary |
|---|---|
| private static final JavaLangModuleAccess JLMA | |
| limitedFinder | back to summary |
|---|---|
| private static volatile ModuleFinder limitedFinder | |
| PATCH_MODULE | back to summary |
|---|---|
| private static final String PATCH_MODULE | |
| patcher | back to summary |
|---|---|
| private static final ModulePatcher patcher | |
| unlimitedFinder | back to summary |
|---|---|
| private static volatile ModuleFinder unlimitedFinder | |
| USER_NATIVE_ACCESS_MODULES | back to summary |
|---|---|
| private static final Set<String> USER_NATIVE_ACCESS_MODULES | |
| ModuleBootstrap | back to summary |
|---|---|
| private ModuleBootstrap() | |
| addEnableFinalFieldMutation | back to summary |
|---|---|
| private static void addEnableFinalFieldMutation(ModuleLayer bootLayer) Process the modules specified to --enable-final-field-mutation and grant the capability to mutate finals to specified named modules or all unnamed modules. | |
| addEnableNativeAccess | back to summary |
|---|---|
| private static void addEnableNativeAccess(ModuleLayer layer) Grants native access to modules selected using the --enable-native-access command line option, and also to JDK modules that need the access. In case of being in "source" launcher mode, warnings about unknown modules are deferred to the source launcher logic in the jdk.compiler module, as those modules might be not compiled, yet. | |
| addEnableNativeAccess | back to summary |
|---|---|
| private static void addEnableNativeAccess(ModuleLayer layer, Set<String> moduleNames, boolean shouldWarn) Grants native access for the given modules in the given layer. Warns optionally about modules that were specified, but not present in the layer. | |
| addExtraExportsAndOpens | back to summary |
|---|---|
| private static void addExtraExportsAndOpens(ModuleLayer bootLayer) Process the --add-exports and --add-opens options to export/open additional packages specified on the command-line. | |
| addExtraExportsOrOpens | back to summary |
|---|---|
| private static void addExtraExportsOrOpens(ModuleLayer bootLayer, Map<String, List<String>> map, boolean opens) | |
| addExtraReads | back to summary |
|---|---|
| private static void addExtraReads(ModuleLayer bootLayer) Process the --add-reads options to add any additional read edges that are specified on the command-line. | |
| addModules | back to summary |
|---|---|
| private static Set Returns the set of module names specified by --add-module options. | |
| allJrtOrModularJar | back to summary |
|---|---|
| private static boolean allJrtOrModularJar(Configuration cf) Returns true if all modules in the configuration are in the run-time image or modular JAR files. | |
| boot | back to summary |
|---|---|
| public static ModuleLayer boot() Initialize the module system, returning the boot layer. The boot layer is obtained from the CDS archive if possible, otherwise it is generated from the module graph. | |
| boot2 | back to summary |
|---|---|
| private static ModuleLayer boot2() | |
| canUseArchivedBootLayer | back to summary |
|---|---|
| private static boolean canUseArchivedBootLayer() Returns true if the archived boot layer can be used. The system properties are checked in the order that they are used by boot2. | |
| checkIncubatingStatus | back to summary |
|---|---|
| private static void checkIncubatingStatus(Configuration cf) Checks incubating status of modules in the configuration | |
| checkSplitPackages | back to summary |
|---|---|
| private static void checkSplitPackages(Configuration cf, Function<String, ClassLoader> clf) Checks for split packages between modules defined to the built-in class loaders. | |
| containsIncubatorModule | back to summary |
|---|---|
| private static boolean containsIncubatorModule(Configuration cf) Returns true if the configuration contains an incubator module. | |
| containsSplitPackages | back to summary |
|---|---|
| private static boolean containsSplitPackages(Configuration cf) Returns true if the configuration contains modules with overlapping packages. | |
| decode | back to summary |
|---|---|
| private static Map Decodes the values of --add-reads, -add-exports, --add-opens or --patch-modules options that are encoded in system properties. | |
| decode | back to summary |
|---|---|
| private static Map Decodes the values of --add-reads, -add-exports or --add-opens which use the "," to separate the RHS of the option value. | |
| decodeEnableFinalFieldMutation | back to summary |
|---|---|
| private static Set Returns the set of module names specified by --enable-final-field-mutation options. | |
| decodeEnableNativeAccess | back to summary |
|---|---|
| private static Set Returns the set of module names specified by --enable-native-access options. | |
| decodeIllegalFinalFieldMutation | back to summary |
|---|---|
| private static ModuleBootstrap. Process the --illegal-final-field-mutation option. | |
| decodeIllegalNativeAccess | back to summary |
|---|---|
| private static ModuleBootstrap. Process the --illegal-native-access option (and its default). | |
| fail | back to summary |
|---|---|
| pack-priv static void fail(String m) Throws a RuntimeException with the given message | |
| finderFor | back to summary |
|---|---|
| private static ModuleFinder finderFor(String prop) Creates a finder from the module path that is the value of the given system property and optionally patched by --patch-module | |
| getAndRemoveProperty | back to summary |
|---|---|
| private static String getAndRemoveProperty(String key) Gets and remove the named system property | |
| getProperty | back to summary |
|---|---|
| private static String getProperty(String key) Gets the named system property | |
| illegalFinalFieldMutation | back to summary |
|---|---|
| public static ModuleBootstrap. | |
| illegalNativeAccess | back to summary |
|---|---|
| public static ModuleBootstrap. | |
| initModulePatcher | back to summary |
|---|---|
| private static ModulePatcher initModulePatcher() Initialize the module patcher for the initial configuration passed on the value of the --patch-module options. | |
| isJarFile | back to summary |
|---|---|
| private static boolean isJarFile(URI uri) Returns true if the given URI locates a jar file on the file system. | |
| limitedFinder | back to summary |
|---|---|
| public static ModuleFinder limitedFinder() Returns the ModuleFinder for the initial configuration. API Note Used to support " | |
| limitFinder | back to summary |
|---|---|
| private static ModuleFinder limitFinder(ModuleFinder finder, Set<String> roots, Set<String> otherMods) Returns a ModuleFinder that limits observability to the given root modules, their transitive dependences, plus a set of other modules. | |
| limitModules | back to summary |
|---|---|
| private static Set Returns the set of module names specified by --limit-modules. | |
| loadModules | back to summary |
|---|---|
| private static void loadModules(Configuration cf, Function<String, ClassLoader> clf) Load/register the modules to the built-in class loaders. | |
| option | back to summary |
|---|---|
| pack-priv static String option(String prefix) | |
| patcher | back to summary |
|---|---|
| public static ModulePatcher patcher() Returns the ModulePatcher for the initial configuration. | |
| unableToParse | back to summary |
|---|---|
| pack-priv static String unableToParse(String option, String text, String value) | |
| unlimitedFinder | back to summary |
|---|---|
| public static ModuleFinder unlimitedFinder() Returns the ModuleFinder for the initial configuration before observability is limited by the --limit-modules command line option. API Note Used to support locating modules | |
| warn | back to summary |
|---|---|
| pack-priv static void warn(String m) | |
| warnUnknownModule | back to summary |
|---|---|
| pack-priv static void warnUnknownModule(String option, String mn) | |
| Modifier and Type | Field and Description |
|---|---|
| private static Map | |
| private static long | |
| private static final boolean | |
| private static final boolean | |
| private static long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void |
| counters | back to summary |
|---|---|
| private static Map<String, Long> counters | |
| previousTime | back to summary |
|---|---|
| private static long previousTime | |
| PRINT_COUNTERS | back to summary |
|---|---|
| private static final boolean PRINT_COUNTERS | |
| PUBLISH_COUNTERS | back to summary |
|---|---|
| private static final boolean PUBLISH_COUNTERS | |
| startTime | back to summary |
|---|---|
| private static long startTime | |
| Counters | back to summary |
|---|---|
| pack-priv Counters() | |
| add | back to summary |
|---|---|
| pack-priv static void add(String name) Add a counter - storing the time difference between now and the previous add or the start. | |
| publish | back to summary |
|---|---|
| pack-priv static void publish(String totalTimeName) Publish the counters to the instrumentation buffer or stdout. | |
| start | back to summary |
|---|---|
| pack-priv static void start() Start counting time. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ModuleBootstrap. | |
| public static final ModuleBootstrap. | |
| public static final ModuleBootstrap. | |
| public static final ModuleBootstrap. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ModuleBootstrap. | |
| public static ModuleBootstrap. |
| ALLOW | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| DEBUG | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| DENY | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| WARN | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| IllegalFinalFieldMutation | back to summary |
|---|---|
| private IllegalFinalFieldMutation() | |
| valueOf | back to summary |
|---|---|
| public static ModuleBootstrap. | |
| values | back to summary |
|---|---|
| public static ModuleBootstrap. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final ModuleBootstrap. | |
| public static final ModuleBootstrap. | |
| public static final ModuleBootstrap. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ModuleBootstrap. | |
| public static ModuleBootstrap. |
| ALLOW | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| DENY | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| WARN | back to summary |
|---|---|
| public static final ModuleBootstrap. | |
| IllegalNativeAccess | back to summary |
|---|---|
| private IllegalNativeAccess() | |
| valueOf | back to summary |
|---|---|
| public static ModuleBootstrap. | |
| values | back to summary |
|---|---|
| public static ModuleBootstrap. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private volatile Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Optional | find(String name)
Implements java. Finds a reference to a module of a given name. |
| public Set | findAll()
Implements java. Returns the set of all module references that this finder can locate. |
| mrefs | back to summary |
|---|---|
| private final Set<ModuleReference> mrefs | |
| nameToModule | back to summary |
|---|---|
| private volatile Map<String, ModuleReference> nameToModule | |
| SafeModuleFinder | back to summary |
|---|---|
| pack-priv SafeModuleFinder(ModuleFinder finder) | |
| find | back to summary |
|---|---|
| public Optional Implements java. Doc from java. Finds a reference to a module of a given name. A
| |
| findAll | back to summary |
|---|---|
| public Set Implements java. Doc from java. Returns the set of all module references that this finder can locate. A
| |