Class PollingJsonStoreReloadableConfigContainer<T>

  • All Implemented Interfaces:
    ReloadableConfigContainer<T>

    public class PollingJsonStoreReloadableConfigContainer<T>
    extends Object
    implements ReloadableConfigContainer<T>
    An abstraction to contain a JAXB annotated XML document that has been marshalled to JSON and stored in a JsonStore.

    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 Detail

      • PollingJsonStoreReloadableConfigContainer

        public PollingJsonStoreReloadableConfigContainer​(JsonStore jsonStore,
                                                         String key,
                                                         String context,
                                                         Class<T> entityClass,
                                                         long pollingIntervalMs,
                                                         io.github.resilience4j.retry.Retry retry)
      • PollingJsonStoreReloadableConfigContainer

        public PollingJsonStoreReloadableConfigContainer​(JsonStore jsonStore,
                                                         String key,
                                                         String context,
                                                         Class<T> entityClass)
    • 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 interface ReloadableConfigContainer<T>
      • getConfig

        public T getConfig()
        Specified by:
        getConfig in interface ReloadableConfigContainer<T>
        Returns:
        the in-memory copy of the configuration which may be reloaded as part of this request depending on the implementation