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
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
ConstructorDescriptionThis constructor should only be used if live reload is not possible.LiveReloadBuildItem
(boolean liveReload, Set<String> changedResources, Map<Class<?>, Object> reloadContext, ClassChangeInformation changeInformation) -
Method Summary
Modifier and TypeMethodDescriptionIf this is a live reload this set contains the config resources that have changed.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 restarts.boolean
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.
-
Constructor Details
-
LiveReloadBuildItem
public LiveReloadBuildItem()This constructor should only be used if live reload is not possible. -
LiveReloadBuildItem
-
-
Method Details
-
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 the app initially failed to start the next attempt will still return false.- Returns:
true
if this is a live reload
-
getChangedResources
If this is a live reload this set contains the config resources that have changed. -
getContextObject
Gets an object from live reload context that is persistent across restarts.- Returns:
-
setContextObject
Sets an object into the live reload context that is persistent across restarts. -
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.
-