Top Description Methods
com.sun.enterprise.module

public Interface Repository

Known Direct Implementers
com.sun.enterprise.module.common_impl.AbstractRepositoryImpl, com.sun.enterprise.module.impl.CookedLibRepository
Imports
java.io.IOException, java.net.URI, java.util.List

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.
Author
Jerome Dochez

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the listener was added successfully
addListener
(RepositoryChangeListener
implementation listening to this repository changes
listener
)

Add a listener to changes happening to this repository.

public ModuleDefinition

Returns:

a DefaultModuleDefinition or null if not found in this repository.
find
(String
the requested module name
name
,
String
the module version. Can be null if the caller doesn't care about the version.
version
)

Finds and returns a DefaultModuleDefinition instance for a module given the name and version constraints.

public List<ModuleDefinition>

Returns:

a list of available modules
findAll
()

Returns a list of all modules available in this repository

public List<ModuleDefinition>
findAll(String
the requested module name
name
)

Finds and returns a list of all the available versions of a module given its name.

public List<URI>

Returns:

jar files location stored in this repository.
getJarLocations
()

Returns the plain jar files installed in this repository.

public URI

Returns:

the URI for the repository location
getLocation
()

Returns the repository location

public String

Returns:

repository name
getName
()

Returns the repository name

public void
initialize()

Initialize the repository for use.

public boolean

Returns:

true if the listener was successfully unregistered
removeListener
(RepositoryChangeListener
the previously registered listener
listener
)

Removes a previously registered listener

public void
shutdown()

Shutdown the repository.

Method Detail

addListenerback to summary
public boolean addListener(RepositoryChangeListener listener)

Add a listener to changes happening to this repository. Repository can change during the lifetime of an execution (files added/removed/changed)

Parameters
listener:RepositoryChangeListener

implementation listening to this repository changes

Returns:boolean

true if the listener was added successfully

findback to summary
public ModuleDefinition find(String name, String version)

Finds and returns a DefaultModuleDefinition instance for a module given the name and version constraints.

Parameters
name:String

the requested module name

version:String

the module version. Can be null if the caller doesn't care about the version.

Returns:ModuleDefinition

a DefaultModuleDefinition or null if not found in this repository.

findAllback to summary
public List<ModuleDefinition> findAll()

Returns a list of all modules available in this repository

Returns:List<ModuleDefinition>

a list of available modules

findAllback to summary
public List<ModuleDefinition> findAll(String name)

Finds and returns a list of all the available versions of a module given its name.

Parameters
name:String

the requested module name

getJarLocationsback to summary
public List<URI> 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:List<URI>

jar files location stored in this repository.

getLocationback to summary
public URI getLocation()

Returns the repository location

Returns:URI

the URI for the repository location

getNameback to summary
public String getName()

Returns the repository name

Returns:String

repository name

initializeback to summary
public void initialize() throws IOException

Initialize the repository for use. This need to be called at least once before any find methods is invoked.

Exceptions
IOException:
if an error occur accessing the repository
removeListenerback to summary
public boolean removeListener(RepositoryChangeListener listener)

Removes a previously registered listener

Parameters
listener:RepositoryChangeListener

the previously registered listener

Returns:boolean

true if the listener was successfully unregistered

shutdownback to summary
public void shutdown() throws IOException

Shutdown the repository. After this call return, the find methods cannot be used until initialize() is called again.

Exceptions
IOException:
if an error occur accessing the repository