Class DirectoryBasedRepository
java.lang.Object
com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
com.sun.enterprise.module.common_impl.DirectoryBasedRepository
- All Implemented Interfaces:
Repository
This class is a directory based repository implementation. This mean that all jar
file residing a particular directory will be elligible to be added to this
repository instance. Jar File will need to be compliant with the module definition
spec which mean have a manifest file with the correct elements OR a separate
manifest file with the same file name with a .mf extension.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private boolean
protected final File
private Timer
Fields inherited from class com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
listeners
-
Constructor Summary
ConstructorsConstructorDescriptionDirectoryBasedRepository
(String name, File repository) Creates a new instance of DirectoryBasedRepositoryDirectoryBasedRepository
(String name, File repository, boolean isTimerThreadDaemon) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addListener
(RepositoryChangeListener listener) Add a listener to changes happening to this repository.private void
private void
protected boolean
isDisabled
(File jar) Checks the xyz.disabled file for xyz.jar and return true if the file exists.protected void
loadModuleDefs
(Map<ModuleId, ModuleDefinition> moduleDefs, List<URI> libraries) Called fromAbstractRepositoryImpl.initialize()
to load allModuleDefinition
s and libraries defintionsvoid
shutdown()
Shutdown the repository.Methods inherited from class com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
add, addLibrary, find, findAll, findAll, getJarLocations, getLocation, getName, initialize, loadJar, newModuleDefinition, remove, removeLibrary, removeListener, toString
-
Field Details
-
repository
-
intervalInMs
private final int intervalInMs -
timer
-
isTimerThreadDaemon
private boolean isTimerThreadDaemon -
subDirectories
-
-
Constructor Details
-
DirectoryBasedRepository
Creates a new instance of DirectoryBasedRepository -
DirectoryBasedRepository
-
-
Method Details
-
initializeSubDirectories
private void initializeSubDirectories() -
addListener
Description copied from class:AbstractRepositoryImpl
Add a listener to changes happening to this repository. Repository can change during the lifetime of an execution (files added/removed/changed)- Specified by:
addListener
in interfaceRepository
- Overrides:
addListener
in classAbstractRepositoryImpl
- Parameters:
listener
- implementation listening to this repository changes- Returns:
- true if the listener was added successfully
-
shutdown
Description copied from interface:Repository
Shutdown the repository. After this call return, the find methods cannot be used until initialize() is called again.- Specified by:
shutdown
in interfaceRepository
- Overrides:
shutdown
in classAbstractRepositoryImpl
- Throws:
IOException
- if an error occur accessing the repository
-
loadModuleDefs
protected void loadModuleDefs(Map<ModuleId, ModuleDefinition> moduleDefs, List<URI> libraries) throws IOExceptionDescription copied from class:AbstractRepositoryImpl
Called fromAbstractRepositoryImpl.initialize()
to load allModuleDefinition
s and libraries defintions- Specified by:
loadModuleDefs
in classAbstractRepositoryImpl
- Throws:
IOException
-
isDisabled
Checks the xyz.disabled file for xyz.jar and return true if the file exists. -
directoryChanged
private void directoryChanged()
-