Class PollingJsonStoreReloadableConfigContainer<T>
- java.lang.Object
-
- org.opennms.netmgt.config.dao.common.impl.PollingJsonStoreReloadableConfigContainer<T>
-
- All Implemented Interfaces:
ReloadableConfigContainer<T>
public class PollingJsonStoreReloadableConfigContainer<T> extends java.lang.Object implements ReloadableConfigContainer<T>
An abstraction to contain a JAXB annotated XML document that has been marshalled to JSON and stored in aJsonStore
.This container caches a copy of the entity and keeps it up to date relative to the copy in the JSON store based on a fixed polling interval. Polling is only done lazily on calls to
getConfig()
.
-
-
Constructor Summary
Constructors Constructor Description PollingJsonStoreReloadableConfigContainer(JsonStore jsonStore, java.lang.String key, java.lang.String context, java.lang.Class<T> entityClass)
PollingJsonStoreReloadableConfigContainer(JsonStore jsonStore, java.lang.String key, java.lang.String context, java.lang.Class<T> entityClass, long pollingIntervalMs, io.github.resilience4j.retry.Retry retry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getConfig()
void
reload()
Instruct the container to reload the in-memory configuration from the backing configuration.
-
-
-
Method Detail
-
reload
public void reload()
Description copied from interface:ReloadableConfigContainer
Instruct 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:
reload
in interfaceReloadableConfigContainer<T>
-
getConfig
public T getConfig()
- Specified by:
getConfig
in interfaceReloadableConfigContainer<T>
- Returns:
- the in-memory copy of the configuration which may be reloaded as part of this request depending on the implementation
-
-