Class LiveReloadBuildItem


  • public final class LiveReloadBuildItem
    extends SimpleBuildItem
    A build item that can be used to query the live reload state. It can also be used to store context information that is persistent between hot reloads.
    • Constructor Detail

      • LiveReloadBuildItem

        public LiveReloadBuildItem()
        This constructor should only be used if live reload is not possible
    • Method Detail

      • isLiveReload

        public boolean isLiveReload()
        If this is a reload of an app in the same JVM then this will return true. If it is the first time this app has started, or the app is not running in developer mode it will return false. Note that unsuccessful attempts to start are not counted, if if the app initially failed to start the next attempt this will still return false.
        Returns:
        true if this is a live reload
      • getChangedResources

        public Set<String> getChangedResources()
        If this is a live reload this set contains the config resources that have changed
      • getContextObject

        public <T> T getContextObject​(Class<T> type)
        Gets an object from live reload context that is persistent across restarts
        Returns:
      • setContextObject

        public <T> void setContextObject​(Class<T> type,
                                         T val)
        Sets an object into the live reload context that is persistent across restarts
      • getChangeInformation

        public ClassChangeInformation getChangeInformation()
        Returns the change information from the last successful restart. Will be null if Quarkus has not previously successfully started, or if the previous attempt to start was a failure.