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 io.quarkus.builder.item.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 -
Method Summary
Modifier and TypeMethodDescriptionIf this is a live reload this set contains the config resources that have changed.io.quarkus.bootstrap.app.ClassChangeInformationReturns the change information from the last successful restart.<T> TgetContextObject(Class<T> type) Gets an object from live reload context that is persistent across restarts.booleanIf this is a reload of an app in the same JVM then this will return true.<T> voidsetContextObject(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:
trueif 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
public io.quarkus.bootstrap.app.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.
-