Class FileSystemSaveableConfigContainer<T>
- java.lang.Object
-
- org.opennms.netmgt.config.dao.common.impl.FileSystemSaveableConfigContainer<T>
-
- All Implemented Interfaces:
ReloadableConfigContainer<T>,SaveableConfigContainer<T>
public class FileSystemSaveableConfigContainer<T> extends Object implements SaveableConfigContainer<T>
Contains a JAXB annotated entity that is backed by a file on disk. The file is held in aAbstractWritableJaxbConfigDaoand is subject to the reloading strategy of that class.
-
-
Constructor Summary
Constructors Constructor Description FileSystemSaveableConfigContainer(Class<T> clazz, String configName, Collection<java.util.function.Consumer<T>> onConfigChangeCallbacks, File configFile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetConfig()LockgetReadLock()LockgetWriteLock()voidreload()Instruct the container to reload the in-memory configuration from the backing configuration.voidsaveConfig()Overwrite the backing configuration with the in-memory copy of the configuration.
-
-
-
Method Detail
-
saveConfig
public void saveConfig()
Description copied from interface:SaveableConfigContainerOverwrite the backing configuration with the in-memory copy of the configuration.- Specified by:
saveConfigin interfaceSaveableConfigContainer<T>
-
reload
public void reload()
Description copied from interface:ReloadableConfigContainerInstruct the container to reload the in-memory configuration from the backing configuration. This may block if the backing configuration is not immediately available.- Specified by:
reloadin interfaceReloadableConfigContainer<T>
-
getConfig
public T getConfig()
- Specified by:
getConfigin interfaceReloadableConfigContainer<T>- Returns:
- the in-memory copy of the configuration which may be reloaded as part of this request depending on the implementation
-
getReadLock
public Lock getReadLock()
- Specified by:
getReadLockin interfaceSaveableConfigContainer<T>
-
getWriteLock
public Lock getWriteLock()
- Specified by:
getWriteLockin interfaceSaveableConfigContainer<T>
-
-