|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.module.ModuleRepository
public abstract class ModuleRepository
This class represents a storage model for ModuleArchive instances.
| Field Summary | |
|---|---|
protected static java.util.List<ModuleArchive> |
EMPTY
|
| Constructor Summary | |
|---|---|
protected |
ModuleRepository(java.lang.String name,
SearchPolicy searchPolicy)
Constructs an instance that will delegate all searches to the specified SearchPolicy. |
| Method Summary | |
|---|---|
protected static void |
assertDirectoryValid(java.io.File directory,
boolean writable)
Assert that the specified directory is valid, creating it if needed. |
protected void |
assertOpen(boolean willModify)
Assert that this instance is open and that it is modifiable if the operation will modify. |
void |
close()
Close this repository. |
boolean |
equals(java.lang.Object other)
Test if the specified object is equal to this instance, enforcing identity comparison. |
abstract java.net.URI |
export(ModuleArchive archive)
Export the specified archive in installable form, identical or equivalent to the originally installed, module system specific archive. |
ModuleArchive |
find(ModuleQuery query)
Find the first ModuleArchive that matches the specified query. |
java.util.List<ModuleArchive> |
findAll(ModuleQuery query)
Find all ModuleArchives that match the specified query. |
abstract java.util.List<? extends ModuleArchive> |
findAllLocal(ModuleQuery query)
Find all ModuleArchives within this ModuleRepository
that match the specified query. |
abstract ModuleArchive |
findLocal(ModuleQuery query)
Find the first ModuleArchive within this ModuleRepository
that matches the specified query. |
abstract long |
getLastModifiedTime()
Returns the last modification time of ModuleRepository. |
abstract java.net.URI |
getLocation()
Returns the location of this ModuleRepository. |
abstract ModuleSystem |
getModuleSystem()
Returns the ModuleSystem of this ModuleRepository. |
java.lang.String |
getName()
Returns the name of this ModuleRepository. |
static java.util.List<ModuleRepository> |
getRepositories()
Returns a list of all registered repositories. |
static ModuleRepository |
getRepository(java.lang.String name)
Returns the named repository. |
static ModuleRepository |
getRepositoryFor(java.net.URI location)
Returns the registered repository with the specified location. |
static ModuleRepository |
getRootRepository()
Returns the root repository. |
static ModuleRepository |
getSystemRepository()
Returns the system repository. |
int |
hashCode()
Returns the identity hash code
for this instance. |
java.util.List<? extends ModuleArchive> |
importFrom(ModuleRepository source,
ModuleQuery query)
Import all matching archives from the specified repository and install them in this instance. |
java.util.List<? extends ModuleArchive> |
install(java.util.List<java.net.URI> uris)
Install archives into this ModuleRepository. |
abstract ModuleArchive |
install(java.net.URI uri)
Install an archive into this ModuleRepository. |
abstract boolean |
isReadOnly()
Returns whether or not this ModuleRepository is read-only. |
protected void |
register()
Register this instance and any hosted types. |
protected void |
registerHostedTypes()
Load and register any hosted ModuleSystem or EventListener
instances contained in this repository. |
abstract int |
size()
Returns the number of archives installed in this ModuleRepository. |
java.lang.String |
toString()
Returns a string representation of this instance. |
java.lang.String |
toString(boolean verbose)
Returns a string representation of this instance. |
abstract void |
uninstall(ModuleArchive archive)
Uninstall an archive. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.List<ModuleArchive> EMPTY
| Constructor Detail |
|---|
protected ModuleRepository(java.lang.String name,
SearchPolicy searchPolicy)
SearchPolicy.
name - The repository name.searchPolicy - The search policy.| Method Detail |
|---|
public static ModuleRepository getRootRepository()
public static ModuleRepository getSystemRepository()
public static ModuleRepository getRepository(java.lang.String name)
name - The repository name.
null if not found.public static ModuleRepository getRepositoryFor(java.net.URI location)
location - The location.
null if not found.public static java.util.List<ModuleRepository> getRepositories()
public ModuleArchive find(ModuleQuery query)
ModuleArchive that matches the specified query.
query - The query.
ModuleArchive or null if no match.public java.util.List<ModuleArchive> findAll(ModuleQuery query)
ModuleArchives that match the specified query.
query - The query.
ModuleArchives matching the query,
in descending version order; empty if no match.public abstract ModuleArchive findLocal(ModuleQuery query)
ModuleArchive within this ModuleRepository
that matches the specified query.
query - The query.
ModuleArchive matching the query, or null
if no match.public abstract java.util.List<? extends ModuleArchive> findAllLocal(ModuleQuery query)
ModuleArchives within this ModuleRepository
that match the specified query.
query - The query.
ModuleArchives, empty if no match.public abstract boolean isReadOnly()
ModuleRepository is read-only.
true if this ModuleRepository is read-only; otherwise, returns
false.
public abstract ModuleArchive install(java.net.URI uri)
throws java.io.IOException
ModuleRepository.
uri - The URI to the module archive.
ModuleArchive.
java.lang.UnsupportedOperationException - if this ModuleRepository is read-only.
java.lang.IllegalArgumentException - if the module archive format is not
supported by this implementation.
java.lang.IllegalStateException - if the same module archive is
already installed in this
ModuleRepository.
java.io.IOException - If an I/O error occurs while installing
the archive.
public java.util.List<? extends ModuleArchive> install(java.util.List<java.net.URI> uris)
throws java.io.IOException
ModuleRepository.
uris - The module archive.
ModuleArchives.
java.lang.UnsupportedOperationException - if this ModuleRepository is read-only.
java.lang.IllegalArgumentException - if the module archive format is not
supported by this implementation.
java.lang.IllegalStateException - if the same module archive is
already installed in this
ModuleRepository.
java.io.IOException - If an I/O error occurs while installing
the archive.}.
public abstract void uninstall(ModuleArchive archive)
throws java.io.IOException
archive - The ModuleArchive to uninstall.
java.lang.UnsupportedOperationException - if this ModuleRepository is read-only.
java.io.IOException - If an I/O error occurs while uninstalling
the archive.
public abstract java.net.URI export(ModuleArchive archive)
throws java.io.IOException
archive - The ModuleArchive to export.
URI from which the exported archive may be obtained.
java.lang.UnsupportedOperationException - if this ModuleRepository is read-only.
java.io.IOException - If an I/O error occurs while exporting
the module.
public java.util.List<? extends ModuleArchive> importFrom(ModuleRepository source,
ModuleQuery query)
throws java.io.IOException
source - The source repository.query - The query to match.
ModuleArchives.
java.io.IOException - If an I/O exception occurs while exporting an archive
from the source repository or when installing into this
instance.public java.lang.String getName()
ModuleRepository.
public abstract ModuleSystem getModuleSystem()
ModuleSystem of this ModuleRepository.
ModuleSystem.public abstract java.net.URI getLocation()
ModuleRepository.
public abstract int size()
ModuleRepository.
public abstract long getLastModifiedTime()
ModuleRepository.
long value representing the time the repository
was last modified, measured in milliseconds since the epoch
(00:00:00 GMT, January 1, 1970).public void close()
public final boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - The object to compare to.
true if other is the same as this
instance; otherwise, returns false.public final int hashCode()
identity hash code
for this instance.
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(boolean verbose)
verbose - Enable verbose output.
protected static void assertDirectoryValid(java.io.File directory,
boolean writable)
directory - The directory.writable - true if write access is required, false
otherwise.protected void register()
java.lang.IllegalArgumentException - if repository name is already registered.protected void assertOpen(boolean willModify)
willModify - true iff the operation
will modify this instance.protected void registerHostedTypes()
ModuleSystem or EventListener
instances contained in this repository.
|
Qwylt | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||