Package org.fcrepo.kernel.api.utils
Class AutoReloadingConfiguration
- java.lang.Object
-
- org.fcrepo.kernel.api.utils.AutoReloadingConfiguration
-
- Direct Known Subclasses:
ExternalContentPathValidator
,RdfNamespaceRegistry
public abstract class AutoReloadingConfiguration extends Object
Abstract configuration class which monitors a file path in order to reload the configuration when it changes.- Author:
- bbpennel
-
-
Field Summary
Fields Modifier and Type Field Description protected String
configPath
-
Constructor Summary
Constructors Constructor Description AutoReloadingConfiguration()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
init()
Initialize the configuration and set up monitoringprotected abstract void
loadConfiguration()
Load the configuration file.void
setConfigPath(String configPath)
Set the file path for the configurationvoid
setMonitorForChanges(boolean monitorForChanges)
Set whether to monitor the configuration file for changesvoid
shutdown()
Shut down the change monitoring thread
-
-
-
Field Detail
-
configPath
protected String configPath
-
-
Constructor Detail
-
AutoReloadingConfiguration
public AutoReloadingConfiguration()
-
-
Method Detail
-
init
public void init() throws IOException
Initialize the configuration and set up monitoring- Throws:
IOException
- thrown if the configuration cannot be loaded.
-
shutdown
public void shutdown()
Shut down the change monitoring thread
-
loadConfiguration
protected abstract void loadConfiguration() throws IOException
Load the configuration file.- Throws:
IOException
- thrown if the configuration cannot be loaded.
-
setConfigPath
public void setConfigPath(String configPath)
Set the file path for the configuration- Parameters:
configPath
- file path for configuration
-
setMonitorForChanges
public void setMonitorForChanges(boolean monitorForChanges)
Set whether to monitor the configuration file for changes- Parameters:
monitorForChanges
- flag controlling if to enable configuration monitoring
-
-