Class 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 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().

    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PollingJsonStoreReloadableConfigContainer

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

        public PollingJsonStoreReloadableConfigContainer​(JsonStore jsonStore,
                                                         java.lang.String key,
                                                         java.lang.String context,
                                                         java.lang.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