Class DirectoryBasedRepository
- java.lang.Object
-
- com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
-
- com.sun.enterprise.module.common_impl.DirectoryBasedRepository
-
- All Implemented Interfaces:
Repository
public class DirectoryBasedRepository extends AbstractRepositoryImpl
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
Fields Modifier and Type Field Description private intintervalInMsprivate booleanisTimerThreadDaemonprotected java.io.Filerepositoryprivate java.util.List<java.io.File>subDirectoriesprivate java.util.Timertimer-
Fields inherited from class com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
listeners
-
-
Constructor Summary
Constructors Constructor Description DirectoryBasedRepository(java.lang.String name, java.io.File repository)Creates a new instance of DirectoryBasedRepositoryDirectoryBasedRepository(java.lang.String name, java.io.File repository, boolean isTimerThreadDaemon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddListener(RepositoryChangeListener listener)Add a listener to changes happening to this repository.private voiddirectoryChanged()private voidinitializeSubDirectories()protected booleanisDisabled(java.io.File jar)Checks the xyz.disabled file for xyz.jar and return true if the file exists.protected voidloadModuleDefs(java.util.Map<ModuleId,ModuleDefinition> moduleDefs, java.util.List<java.net.URI> libraries)Called fromAbstractRepositoryImpl.initialize()to load allModuleDefinitions and libraries defintionsvoidshutdown()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
-
-
-
-
Constructor Detail
-
DirectoryBasedRepository
public DirectoryBasedRepository(java.lang.String name, java.io.File repository)Creates a new instance of DirectoryBasedRepository
-
DirectoryBasedRepository
public DirectoryBasedRepository(java.lang.String name, java.io.File repository, boolean isTimerThreadDaemon)
-
-
Method Detail
-
initializeSubDirectories
private void initializeSubDirectories()
-
addListener
public boolean addListener(RepositoryChangeListener listener)
Description copied from class:AbstractRepositoryImplAdd a listener to changes happening to this repository. Repository can change during the lifetime of an execution (files added/removed/changed)- Specified by:
addListenerin interfaceRepository- Overrides:
addListenerin classAbstractRepositoryImpl- Parameters:
listener- implementation listening to this repository changes- Returns:
- true if the listener was added successfully
-
shutdown
public void shutdown() throws java.io.IOExceptionDescription copied from interface:RepositoryShutdown the repository. After this call return, the find methods cannot be used until initialize() is called again.- Specified by:
shutdownin interfaceRepository- Overrides:
shutdownin classAbstractRepositoryImpl- Throws:
java.io.IOException- if an error occur accessing the repository
-
loadModuleDefs
protected void loadModuleDefs(java.util.Map<ModuleId,ModuleDefinition> moduleDefs, java.util.List<java.net.URI> libraries) throws java.io.IOException
Description copied from class:AbstractRepositoryImplCalled fromAbstractRepositoryImpl.initialize()to load allModuleDefinitions and libraries defintions- Specified by:
loadModuleDefsin classAbstractRepositoryImpl- Throws:
java.io.IOException
-
isDisabled
protected boolean isDisabled(java.io.File jar)
Checks the xyz.disabled file for xyz.jar and return true if the file exists.
-
directoryChanged
private void directoryChanged()
-
-