Interface ReloadingContainer<T>

  • Type Parameters:
    T - bean type
    All Known Implementing Classes:
    ConfigReloadContainer

    public interface ReloadingContainer<T>
    A container managing a bean which can reloaded.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Long getLastUpdate()
      Retrieve the time at which the object was last updated.
      T getObject()
      Retrieve the object held by the container.
      void reload()
      Immediately reload the object.
      void setReloadCheckInterval​(java.lang.Long reloadCheckInterval)
      Set the frequency at which the object should be checked for updates.
    • Method Detail

      • getObject

        T getObject()
        Retrieve the object held by the container. May also trigger a reload if the check interval has passed.
        Returns:
        the object
      • reload

        void reload()
        Immediately reload the object. The next call to getObject() will return the updated object.
      • setReloadCheckInterval

        void setReloadCheckInterval​(java.lang.Long reloadCheckInterval)
        Set the frequency at which the object should be checked for updates. The check is performed when calls to getObject() are made once the interval has passed.
        Parameters:
        reloadCheckInterval - interval in ms, if null the default value will be used, if <= 0 reload checks will be disabled
      • getLastUpdate

        java.lang.Long getLastUpdate()
        Retrieve the time at which the object was last updated.
        Returns:
        timestamp in ms