|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.module.Repository sun.module.repository.LocalRepository
public final class LocalRepository
A repository for module definitions stored on the file system.
When the repository is initialized, the source location is interpreted by
the LocalRepository
instance as a directory where the module
definitions are stored in the repository interchange directory.
ModuleArchiveInfo
,
Repository
Constructor Summary | |
---|---|
LocalRepository(Repository parent,
String name,
URL source)
Creates a new LocalRepository instance. |
|
LocalRepository(Repository parent,
String name,
URL source,
Map<String,String> config)
Creates a new LocalRepository instance, and initializes it
using information from the given config . |
|
LocalRepository(String name,
URL source)
Creates a new LocalRepository instance using the
Repository returned by the method
getSystemRepository() as the parent repository. |
|
LocalRepository(String name,
URL source,
Map<String,String> config)
Creates a new LocalRepository instance using the
Repository returned by the method
getSystemRepository() as the parent repository. |
Method Summary | |
---|---|
List<ModuleDefinition> |
findModuleDefinitions(Query constraint)
Find all matching module definitions in the repository. |
void |
initialize(Map<String,String> config)
Initializes the repository instance using the supplied configuration. |
ModuleArchiveInfo |
install(URL u)
Install a module archive with the module definition into the repository. |
boolean |
isActive()
Returns whether or not the repository instance is active. |
boolean |
isReadOnly()
Returns whether or not this repository is read-only. |
List<ModuleArchiveInfo> |
list()
Returns an unmodifiable list of the installed module archives' information in the repository. |
void |
reload()
Reload the repository. |
void |
shutdown()
Shutdown the repository. |
boolean |
uninstall(ModuleArchiveInfo m)
Uninstall a module archive from the repository. |
Methods inherited from class java.module.Repository |
---|
equals, find, find, find, findAll, getBootstrapRepository, getModuleSystem, getName, getParent, getSourceLocation, getSystemRepository, hashCode, initialize, shutdownOnExit, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LocalRepository(Repository parent, String name, URL source)
LocalRepository
instance.
Initializes the repository.
If a security manager is present, this method calls the security
manager's checkPermission
method with a
ModuleSystemPermission("createRepository")
permission to
ensure it's ok to create a repository.
parent
- the parent repository for delegation.name
- the repository name.source
- the source location.
SecurityException
- if a security manager exists and its
checkPermission method denies access to create a new
instance of repository.public LocalRepository(String name, URL source)
LocalRepository
instance using the
Repository
returned by the method
getSystemRepository()
as the parent repository.
Initializes the repository.
If a security manager is present, this method calls the security
manager's checkPermission
method with a
ModuleSystemPermission("createRepository")
permission to
ensure it's ok to create a repository.
name
- the repository name.source
- the source location.
SecurityException
- if a security manager exists and its
checkPermission method denies access to create a new
instance of repository.public LocalRepository(Repository parent, String name, URL source, Map<String,String> config) throws IOException
LocalRepository
instance, and initializes it
using information from the given config
.
If a security manager is present, this method calls the security
manager's checkPermission
method with a
ModuleSystemPermission("createRepository")
permission to
ensure it's ok to create a repository.
parent
- the parent repository for delegation.name
- the repository name.source
- the source location.config
- Map of configuration names to their values
SecurityException
- if a security manager exists and its
checkPermission method denies access to create a new
instance of repository.
IOException
- if the repository cannot be initialized.public LocalRepository(String name, URL source, Map<String,String> config) throws IOException
LocalRepository
instance using the
Repository
returned by the method
getSystemRepository()
as the parent repository. Also
initializes the repository using information in the given config
.
If a security manager is present, this method calls the security
manager's checkPermission
method with a
ModuleSystemPermission("createRepository")
permission to
ensure it's ok to create a repository.
name
- the repository name.source
- the source location.config
- Map of configuration names to their values
SecurityException
- if a security manager exists and its
checkPermission method denies access to create a new
instance of repository.
IOException
- if the repository cannot be initialized.Method Detail |
---|
public void initialize(Map<String,String> config) throws IOException
sun.module.repository.LocalRepository.expansionDirectory
: Specifies the directory
into which .jam files are to be expanded. The default is to use the
same directory as specified by getSourceLocation()
.
initialize
in class Repository
config
- - config used to initialize the repository instance.
IOException
- if an I/O error occurs.public ModuleArchiveInfo install(URL u) throws IOException
Repository
If a security manager is present, this method calls the
security manager's checkPermission
method with
a ModuleSystemPermission("installModuleArchive")
permission to ensure it's ok to install a module
archive into a repository.
install
in class Repository
u
- the URL to the module archive.
ModuleArchiveInfo
object that represents
the installed module archive.
IOException
- if given URL names a file that does not exist.
directory.Repository.install(URL u)
public List<ModuleDefinition> findModuleDefinitions(Query constraint)
Repository
If this repository instance has not been initialized when this method is called, it will be initialized automatically by calling the initialize method with no argument.
findModuleDefinitions
in class Repository
constraint
- the constraint.
public boolean isReadOnly()
Repository
isReadOnly
in class Repository
public void reload() throws IOException
Repository
If a security manager is present, this method calls the
security manager's checkPermission
method with
a ModuleSystemPermission("reloadRepository")
permission to ensure it's ok to reload module
definitions in a repository.
reload
in class Repository
IOException
- If an error occurs while reloading the
module definitions.public boolean uninstall(ModuleArchiveInfo m) throws IOException
Repository
If a security manager is present, this method calls the
security manager's checkPermission
method with
a ModuleSystemPermission("uninstallModuleArchive")
permission to ensure it's ok to uninstall a module
archive from a repository.
uninstall
in class Repository
m
- the module archive to be uninstalled.
IOException
- If an error occurs while uninstalling the module archive.public void shutdown() throws IOException
Repository
checkPermission
method with a
ModuleSystemPermission("shutdownRepository")
permission
to ensure it's ok to shutdown a repository.
shutdown
in class Repository
IOException
- if an I/O error occurs.public List<ModuleArchiveInfo> list()
Repository
If a security manager is present, this method calls the
security manager's checkPermission
method with
a ModuleSystemPermission("listModuleArchive")
permission to ensure it's ok to return the information of the
installed module archives in a repository.
list
in class Repository
public boolean isActive()
Repository
A repository instance is active if it has been initialized but has not been shutdown.
isActive
in class Repository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |