Class 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 Detail

      • repository

        protected final java.io.File repository
      • intervalInMs

        private final int intervalInMs
      • timer

        private java.util.Timer timer
      • isTimerThreadDaemon

        private boolean isTimerThreadDaemon
      • subDirectories

        private java.util.List<java.io.File> subDirectories
    • 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: 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 java.io.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:
        java.io.IOException - if an error occur accessing the repository
      • 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()