Package io.quarkus.deployment.builditem
Class LiveReloadBuildItem
- java.lang.Object
-
- io.quarkus.builder.item.BuildItem
-
- io.quarkus.builder.item.SimpleBuildItem
-
- io.quarkus.deployment.builditem.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 Summary
Constructors Constructor Description LiveReloadBuildItem()
This constructor should only be used if live reload is not possibleLiveReloadBuildItem(boolean liveReload, Set<String> changedResources, Map<Class<?>,Object> reloadContext, ClassChangeInformation changeInformation)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getChangedResources()
If this is a live reload this set contains the config resources that have changedClassChangeInformation
getChangeInformation()
Returns the change information from the last successful restart.<T> T
getContextObject(Class<T> type)
Gets an object from live reload context that is persistent across restartsboolean
isLiveReload()
If this is a reload of an app in the same JVM then this will return true.<T> void
setContextObject(Class<T> type, T val)
Sets an object into the live reload context that is persistent across restarts
-
-
-
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.
-
-