com.sun.enterprise.module.common_impl
Class DirectoryBasedRepository

java.lang.Object
  extended by com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
      extended by com.sun.enterprise.module.common_impl.DirectoryBasedRepository
All Implemented Interfaces:
Repository
Direct Known Subclasses:
OSGiDirectoryBasedRepository

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.

Author:
Jerome Dochez

Field Summary
protected  File repository
           
 
Fields inherited from class com.sun.enterprise.module.common_impl.AbstractRepositoryImpl
listeners
 
Constructor Summary
DirectoryBasedRepository(String name, File repository)
          Creates a new instance of DirectoryBasedRepository
DirectoryBasedRepository(String name, File repository, boolean isTimerThreadDaemon)
           
 
Method Summary
 boolean addListener(RepositoryChangeListener listener)
          Add a listener to changes happening to this repository.
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 from AbstractRepositoryImpl.initialize() to load all ModuleDefinitions and libraries defintions
 void 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

repository

protected final File repository
Constructor Detail

DirectoryBasedRepository

public DirectoryBasedRepository(String name,
                                File repository)
Creates a new instance of DirectoryBasedRepository


DirectoryBasedRepository

public DirectoryBasedRepository(String name,
                                File repository,
                                boolean isTimerThreadDaemon)
Method Detail

addListener

public boolean addListener(RepositoryChangeListener listener)
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 interface Repository
Overrides:
addListener in class AbstractRepositoryImpl
Parameters:
listener - implementation listening to this repository changes
Returns:
true if the listener was added successfully

shutdown

public void shutdown()
              throws IOException
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 interface Repository
Overrides:
shutdown in class AbstractRepositoryImpl
Throws:
IOException - if an error occur accessing the repository

loadModuleDefs

protected void loadModuleDefs(Map<ModuleId,ModuleDefinition> moduleDefs,
                              List<URI> libraries)
                       throws IOException
Description copied from class: AbstractRepositoryImpl
Called from AbstractRepositoryImpl.initialize() to load all ModuleDefinitions and libraries defintions

Specified by:
loadModuleDefs in class AbstractRepositoryImpl
Throws:
IOException

isDisabled

protected boolean isDisabled(File jar)
Checks the xyz.disabled file for xyz.jar and return true if the file exists.



Copyright © 2013 Oracle Corporation. All Rights Reserved.