public class DirectoryBasedRepository extends AbstractRepositoryImpl
Modifier and Type | Field and Description |
---|---|
private int |
intervalInMs |
private boolean |
isTimerThreadDaemon |
protected java.io.File |
repository |
private java.util.List<java.io.File> |
subDirectories |
private java.util.Timer |
timer |
listeners
Constructor and Description |
---|
DirectoryBasedRepository(java.lang.String name,
java.io.File repository)
Creates a new instance of DirectoryBasedRepository
|
DirectoryBasedRepository(java.lang.String name,
java.io.File repository,
boolean isTimerThreadDaemon) |
Modifier and Type | Method and Description |
---|---|
boolean |
addListener(RepositoryChangeListener listener)
Add a listener to changes happening to this repository.
|
private void |
directoryChanged() |
private void |
initializeSubDirectories() |
protected boolean |
isDisabled(java.io.File jar)
Checks the xyz.disabled file for xyz.jar and return true
if the file exists.
|
protected void |
loadModuleDefs(java.util.Map<ModuleId,ModuleDefinition> moduleDefs,
java.util.List<java.net.URI> libraries)
Called from
AbstractRepositoryImpl.initialize() to load all ModuleDefinition s and libraries defintions |
void |
shutdown()
Shutdown the repository.
|
add, addLibrary, find, findAll, findAll, getJarLocations, getLocation, getName, initialize, loadJar, newModuleDefinition, remove, removeLibrary, removeListener, toString
protected final java.io.File repository
private final int intervalInMs
private java.util.Timer timer
private boolean isTimerThreadDaemon
private java.util.List<java.io.File> subDirectories
public DirectoryBasedRepository(java.lang.String name, java.io.File repository)
public DirectoryBasedRepository(java.lang.String name, java.io.File repository, boolean isTimerThreadDaemon)
private void initializeSubDirectories()
public boolean addListener(RepositoryChangeListener listener)
AbstractRepositoryImpl
addListener
in interface Repository
addListener
in class AbstractRepositoryImpl
listener
- implementation listening to this repository changespublic void shutdown() throws java.io.IOException
Repository
shutdown
in interface Repository
shutdown
in class AbstractRepositoryImpl
java.io.IOException
- if an error occur accessing the repositoryprotected void loadModuleDefs(java.util.Map<ModuleId,ModuleDefinition> moduleDefs, java.util.List<java.net.URI> libraries) throws java.io.IOException
AbstractRepositoryImpl
AbstractRepositoryImpl.initialize()
to load all ModuleDefinition
s and libraries defintionsloadModuleDefs
in class AbstractRepositoryImpl
java.io.IOException
protected boolean isDisabled(java.io.File jar)
private void directoryChanged()