-
resolve
public static Configuration resolve(ModuleFinder before,
List<Configuration> parents,
ModuleFinder after,
Collection<String> roots)
Resolves a collection of root modules to create a configuration. Each root module is located using the given before module finder. If a module is not found then it is located in the parent configuration as if by invoking the findModule method on each parent in iteration order. If not found then the module is located using the given after module finder. The same search order is used to locate transitive dependences. Root modules or dependences that are located in a parent configuration are resolved no further and are not included in the resulting configuration.
When all modules have been resolved then the resulting dependency graph is checked to ensure that it does not contain cycles. A readability graph is constructed, and in conjunction with the module exports and service use, checked for consistency.
Resolution may fail with FindException for the following observability-related reasons:
-
A root module, or a direct or transitive dependency, is not found.
-
An error occurs when attempting to find a module. Possible errors include I/O errors, errors detected parsing a module descriptor (module-info.class ) or two versions of the same module are found in the same directory. -
A module with the required name is found but the module requires a different operating system , architecture , or version to other modules that have been resolved for the new configuration or modules in the parent configurations.
Post-resolution consistency checks may fail with ResolutionException for the following reasons:
-
A cycle is detected, say where module m1 requires module m2 and m2 requires m1 .
-
A module reads two or more modules with the same name. This includes the case where a module reads another with the same name as itself.
-
Two or more modules in the configuration export the same package to a module that reads both. This includes the case where a module M containing package p reads another module that exports p to M .
-
A module M declares that it "uses p.S " or "provides p.S with ... " but package p is neither in module M nor exported to M by any module that M reads.
-
Implementation Note:
- In the implementation then observability of modules may depend on referential integrity or other checks that ensure different builds of tightly coupled modules or modules for specific operating systems or architectures are not combined in the same configuration.
-
Parameters:
-
before - The before module finder to find modules
-
parents - The list parent configurations in search order
-
after - The after module finder to locate modules when not located by the before module finder or in parent configurations
-
roots - The possibly-empty collection of module names of the modules to resolve
-
Returns:
- The configuration that is the result of resolving the given root modules
-
Throws:
-
FindException - If resolution fails for an observability-related reason
-
ResolutionException - If a post-resolution consistency checks fails
-
IllegalArgumentException - If the list of parents is empty, or the list has two or more parents with modules for different target operating systems, architectures, or versions
-
SecurityException - If locating a module is denied by the security manager
|
-
resolve
public static Configuration resolve(ModuleFinder before,
List<Configuration> parents,
ModuleFinder after,
Collection<String> roots)
Resolves a collection of root modules to create a configuration. Each root module is located using the given before module finder. If a module is not found then it is located in the parent configuration as if by invoking the findModule method on each parent in iteration order. If not found then the module is located using the given after module finder. The same search order is used to locate transitive dependences. Root modules or dependences that are located in a parent configuration are resolved no further and are not included in the resulting configuration.
When all modules have been resolved then the resulting dependency graph is checked to ensure that it does not contain cycles. A readability graph is constructed, and in conjunction with the module exports and service use, checked for consistency.
Resolution may fail with FindException for the following observability-related reasons:
-
A root module, or a direct or transitive dependency, is not found.
-
An error occurs when attempting to find a module. Possible errors include I/O errors, errors detected parsing a module descriptor (module-info.class ) or two versions of the same module are found in the same directory.
-
A module with the required name is found but the module requires a different operating system , architecture , or version to other modules that have been resolved for the new configuration or modules in the parent configurations.
Post-resolution consistency checks may fail with ResolutionException for the following reasons:
-
A cycle is detected, say where module m1 requires module m2 and m2 requires m1 .
-
Two or more modules in the configuration export the same package to a module that reads both. This includes the case where a module M containing package p reads another module that exports p to M .
-
A module M declares that it "uses p.S " or "provides p.S with ... " but package p is neither in module M nor exported to M by any module that M reads.
-
Implementation Note:
- In the implementation then observability of modules may depend on referential integrity checks that ensure different builds of tightly coupled modules are not combined in the same configuration.
-
Parameters:
-
before - The before module finder to find modules
-
parents - The list parent configurations in search order
-
after - The after module finder to locate modules when not located by the before module finder or in parent configurations
-
roots - The possibly-empty collection of module names of the modules to resolve
-
Returns:
- The configuration that is the result of resolving the given root modules
-
Throws:
-
FindException - If resolution fails for an observability-related reason
-
ResolutionException - If a post-resolution consistency checks fails
-
IllegalArgumentException - If the list of parents is empty, or the list has two or more parents with modules for different target operating systems, architectures, or versions
-
SecurityException - If locating a module is denied by the security manager
|
-
resolve
public static Configuration resolve(ModuleFinder before,
List<Configuration> parents,
ModuleFinder after,
Collection<String> roots)
Resolves a collection of root modules to create a configuration. Each root module is located using the given before module finder. If a module is not found then it is located in the parent configuration as if by invoking the findModule method on each parent in iteration order. If not found then the module is located using the given after module finder. The same search order is used to locate transitive dependences. Root modules or dependences that are located in a parent configuration are resolved no further and are not included in the resulting configuration.
When all modules have been resolved then the resulting dependency graph is checked to ensure that it does not contain cycles. A readability graph is constructed, and in conjunction with the module exports and service use, checked for consistency.
Resolution may fail with FindException for the following observability-related reasons:
-
A root module, or a direct or transitive dependency, is not found.
-
An error occurs when attempting to find a module. Possible errors include I/O errors, errors detected parsing a module descriptor (module-info.class ) or two versions of the same module are found in the same directory.
Post-resolution consistency checks may fail with ResolutionException for the following reasons:
-
A cycle is detected, say where module m1 requires module m2 and m2 requires m1 .
-
A module reads two or more modules with the same name. This includes the case where a module reads another with the same name as itself.
-
Two or more modules in the configuration export the same package to a module that reads both. This includes the case where a module M containing package p reads another module that exports p to M .
-
A module M declares that it "uses p.S " or "provides p.S with ... " but package p is neither in module M nor exported to M by any module that M reads.
-
Implementation Note:
- In the implementation then observability of modules may depend on referential integrity or other checks that ensure different builds of tightly coupled modules or modules for specific operating systems or architectures are not combined in the same configuration.
-
Parameters:
-
before - The before module finder to find modules
-
parents - The list parent configurations in search order
-
after - The after module finder to locate modules when not located by the before module finder or in parent configurations
-
roots - The possibly-empty collection of module names of the modules to resolve
-
Returns:
- The configuration that is the result of resolving the given root modules
-
Throws:
-
FindException - If resolution fails for an observability-related reason
-
ResolutionException - If a post-resolution consistency checks fails
-
IllegalArgumentException - If the list of parents is empty, or the list has two or more parents with modules for different target operating systems, architectures, or versions
-
SecurityException - If locating a module is denied by the security manager
|
|