com.sun.enterprise.module.impl
Class CookedLibRepository

java.lang.Object
  extended by com.sun.enterprise.module.impl.CookedLibRepository
All Implemented Interfaces:
Repository

public abstract class CookedLibRepository
extends Object
implements Repository

Author:
dochez

Field Summary
protected  String[] fileNames
           
protected  File rootLocation
           
 
Constructor Summary
CookedLibRepository(String installRoot)
          Creates a new instance of CookedLibRepository
 
Method Summary
 void add(ModuleDefinition definition)
          Adds a new module
 ModuleDefinition find(String name, String version)
          Finds and returns a DefaultModuleDefinition instance for a module given the name and version constraints.
abstract  List<ModuleDefinition> findAll()
          Returns a list of all modules available in this repository
 List<ModuleDefinition> findAll(String name)
          Finds and returns a list of all the available versions of a module given its name.
 URI getLocation()
          Returns the repository location
 String getName()
          Returns the repository name
abstract  void initialize()
          Initialize the repository for use.
 void shutdown()
          Shutdown the repository.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.enterprise.module.Repository
addListener, getJarLocations, removeListener
 

Field Detail

rootLocation

protected final File rootLocation

fileNames

protected String[] fileNames
Constructor Detail

CookedLibRepository

public CookedLibRepository(String installRoot)
Creates a new instance of CookedLibRepository

Method Detail

getName

public String getName()
Returns the repository name

Specified by:
getName in interface Repository
Returns:
repository name

getLocation

public URI getLocation()
Returns the repository location

Specified by:
getLocation in interface Repository
Returns:
the URL for the repository location

find

public ModuleDefinition find(String name,
                             String version)
Finds and returns a DefaultModuleDefinition instance for a module given the name and version constraints.

Specified by:
find in interface Repository
Parameters:
name - the requested module name
version - the requestion module version
Returns:
a DefaultModuleDefinition or null if not found in this repository.

findAll

public abstract List<ModuleDefinition> findAll()
Returns a list of all modules available in this repository

Specified by:
findAll in interface Repository
Returns:
a list of available modules

findAll

public List<ModuleDefinition> findAll(String name)
Finds and returns a list of all the available versions of a module given its name.

Specified by:
findAll in interface Repository
Parameters:
name - the requested module name

initialize

public abstract void initialize()
                         throws IOException
Initialize the repository for use. This need to be called at least once before any find methods is invoked.

Specified by:
initialize in interface Repository
Throws:
IOException - if an error occur accessing the repository

add

public void add(ModuleDefinition definition)
         throws IOException
Adds a new module

Throws:
IOException

shutdown

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

Specified by:
shutdown in interface Repository
Throws:
IOException - if an error occur accessing the repository

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013 Oracle Corporation. All Rights Reserved.