Package com.sun.enterprise.module
Interface Repository
- All Known Implementing Classes:
AbstractRepositoryImpl
,CookedLibRepository
,DirectoryBasedRepository
public interface Repository
A Repository instance is an abstraction of a set of accessible
modules. Repository can be local or remote and are used to
procure modules implementation based on constraints like name or
version.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addListener
(RepositoryChangeListener listener) Add a listener to changes happening to this repository.Finds and returns aDefaultModuleDefinition
instance for a module given the name and version constraints.findAll()
Returns a list of all modules available in this repositoryFinds and returns a list of all the available versions of a module given its name.Returns the plain jar files installed in this repository.Returns the repository locationgetName()
Returns the repository namevoid
Initialize the repository for use.boolean
removeListener
(RepositoryChangeListener listener) Removes a previously registered listenervoid
shutdown()
Shutdown the repository.
-
Method Details
-
getName
String getName()Returns the repository name- Returns:
- repository name
-
getLocation
URI getLocation()Returns the repository location- Returns:
- the URI for the repository location
-
find
Finds and returns aDefaultModuleDefinition
instance for a module given the name and version constraints.- Parameters:
name
- the requested module nameversion
- the module version. Can be null if the caller doesn't care about the version.- Returns:
- a
DefaultModuleDefinition
or null if not found in this repository.
-
findAll
List<ModuleDefinition> findAll()Returns a list of all modules available in this repository- Returns:
- a list of available modules
-
findAll
Finds and returns a list of all the available versions of a module given its name.- Parameters:
name
- the requested module name
-
initialize
Initialize the repository for use. This need to be called at least once before any find methods is invoked.- Throws:
IOException
- if an error occur accessing the repository
-
shutdown
Shutdown the repository. After this call return, the find methods cannot be used until initialize() is called again.- Throws:
IOException
- if an error occur accessing the repository
-
getJarLocations
Returns the plain jar files installed in this repository. Plain jar files are not modules, they do not have the module's metadata and can only be used when referenced from a module dependency list or when added to a class loader directly- Returns:
- jar files location stored in this repository.
-
addListener
Add a listener to changes happening to this repository. Repository can change during the lifetime of an execution (files added/removed/changed)- Parameters:
listener
- implementation listening to this repository changes- Returns:
- true if the listener was added successfully
-
removeListener
Removes a previously registered listener- Parameters:
listener
- the previously registered listener- Returns:
- true if the listener was successfully unregistered
-