|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.module.Modules
public class Modules
XXX
Method Summary | |
---|---|
static ImportOverridePolicy |
getImportOverridePolicy()
Returns the system's import override policy for module definitions. |
static VisibilityPolicy |
getVisibilityPolicy()
Returns the system's default visibility policy for module definitions in the repository of the module system. |
static ModuleDefinition |
newJamsModuleDefinition(byte[] metadata,
ModuleDefinitionContent content,
Repository repository)
Returns a new ModuleDefinition for modules based on the Java Module System format. |
static ModuleDefinition |
newJamsModuleDefinition(String name,
Version version,
Callable<byte[]> metadataHandle,
ModuleDefinitionContent content,
Repository repository)
Returns a new ModuleDefinition for modules based on the Java Module System format. |
static Repository |
newLocalRepository(Repository parent,
String name,
URL source)
Returns an initialized repository for module definitions stored on the file system. |
static Repository |
newLocalRepository(Repository parent,
String name,
URL source,
Map<String,String> config)
Returns a repository for module definitions stored on the file system. |
static Repository |
newLocalRepository(String name,
URL source)
Returns an initialized repository for module definitions stored on the file system. |
static Repository |
newLocalRepository(String name,
URL source,
Map<String,String> config)
Returns a repository for module definitions stored on the file system. |
static Repository |
newURLRepository(Repository parent,
String name,
URL source)
Returns a repository that loads module definitions from a codebase URL. |
static Repository |
newURLRepository(String name,
URL source)
Returns a repository that loads module definitions from a codebase URL. |
static void |
setImportOverridePolicy(ImportOverridePolicy policy)
Set the system's import override policy for module definitions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Repository newLocalRepository(Repository parent, String name, URL source)
public static Repository newLocalRepository(String name, URL source)
public static Repository newLocalRepository(Repository parent, String name, URL source, Map<String,String> config) throws IOException
IOException
public static Repository newLocalRepository(String name, URL source, Map<String,String> config) throws IOException
IOException
public static Repository newURLRepository(Repository parent, String name, URL source)
Information about the module definitions available from the codebase URL must be published in a repository metadata file. The contents of the file must follow the schema of the URL Repository metadata for the Java Module System.
{codebase}/repository-metadata.xml
When the repository is initialized, the repository metadata file (i.e. repository-metadata.xml) would be downloaded from the codebase URL.
In the repository metadata file, each module definition is described with a name, a version, a platform binding, and a path (relative to the codebase URL where the module file, the module archive, and/or the packed module archive are located). If no path and no platform binding is specified, the default path is "{name}/{version}". If the path is not specified and the module definition has platform binding, the default path is "{name}/{version}/{platform}-{arch}".
After the URL repository instance successfully downloads the repository metadata file, the module file of each module definition (i.e. MODULE.METADATA file) in the repository is downloaded based on the information in the repository metadata file:
{codebase}/{path}/MODULE.METADATA
If a module definition is platform-specific, its module file is downloaded if and only if the platform binding described in the repository metadata file matches the platform and the architecture of the system.
Module definitions are available for searches after the URL repository instance is initialized. If a module instance is instantiated from a module definition that has no platform binding, the module archive is downloaded by probing in the following order:
{codebase}/{path}/{name}-{version}.jam.pack.gz
{codebase}/{path}/{name}-{version}.jam
On the other hand, if a module instance is instantiated from a platform-specific module definition, the module archive is downloaded by probing in the following order:
{codebase}/{path}/{name}-{version}-{platform}-{arch}.jam.pack.gz
{codebase}/{path}/{name}-{version}-{platform}-{arch}.jam
To ensure the integrity of the separately-hosted module file is in sync with that in the module archive of the same module definition, they are compared bit-wise against each other after the module archive is downloaded.
public static Repository newURLRepository(String name, URL source)
public static ImportOverridePolicy getImportOverridePolicy()
The default class of the override policy can be changed using the
java.module.ImportOverridePolicy
system property.
public static void setImportOverridePolicy(ImportOverridePolicy policy)
If a security manager is present, this method calls the
security manager's checkPermission
method with
a ModuleSystemPermission("setImportOverridePolicy")
permission to ensure it's ok to set the system's default import
override policy..
policy
- the import override policy for module definitions.
NullPointerException
- if the policy is null.
SecurityException
- if a security manager exists and its
checkPermission method denies access to set the
system's default import override policy.public static VisibilityPolicy getVisibilityPolicy()
The default class of the visibility policy can be overridden using the
java.module.VisibilityPolicy
system property.
public static ModuleDefinition newJamsModuleDefinition(byte[] metadata, ModuleDefinitionContent content, Repository repository) throws ModuleFormatException
This method will typically called by repository implementations and not by applications.
metadata
- the contents of the MODULE-INF/METADATA.MODULE
filecontent
- the ModuleDefinitionContent to be used to access the
contents of the module archiverepository
- the repository in which the module archive is stored
NullPointerException
- if one of metadata, content, or repository
are null
ModuleFormatException
- if the contents of metadata
are not well formed.public static ModuleDefinition newJamsModuleDefinition(String name, Version version, Callable<byte[]> metadataHandle, ModuleDefinitionContent content, Repository repository)
This method will typically called by repository implementations and not by applications. It is useful in case the metadata has not yet been retrieved but the module name and version are available.
name
- the name of the module definitionversion
- the version of the module definitionmetadataHandle
- a Callable from which the contents of the
MODULE-INF/METADATA.MODULE
file can be retrievedcontent
- the ModuleDefinitionContent to be used to access the
contents of the module archiverepository
- the repository in which the module archive is stored
NullPointerException
- if one of
name, version, metadataHandle, content, or repository
are null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |