Package io.quarkus.deployment.builditem
Class CuratedApplicationShutdownBuildItem
- java.lang.Object
-
- io.quarkus.builder.item.BuildItem
-
- io.quarkus.builder.item.SimpleBuildItem
-
- io.quarkus.deployment.builditem.CuratedApplicationShutdownBuildItem
-
public final class CuratedApplicationShutdownBuildItem extends SimpleBuildItem
Build Item that can be used to queue shutdown tasks that are run when theCuratedApplication
is closed.For production applications this will be at the end of the maven/gradle build, for dev mode applications this will be when dev mode shuts down, for tests it will generally be at the end of the test run, however for continuous testing this will be when the outer dev mode process shuts down. For unit style tests this will generally be the end of the test.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
registered
-
Constructor Summary
Constructors Constructor Description CuratedApplicationShutdownBuildItem(QuarkusClassLoader baseCl, boolean firstRun)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCloseTask(Runnable task, boolean firstRunOnly)
Adds a task to run when the application is closed
-
-
-
Constructor Detail
-
CuratedApplicationShutdownBuildItem
public CuratedApplicationShutdownBuildItem(QuarkusClassLoader baseCl, boolean firstRun)
-
-
Method Detail
-
addCloseTask
public void addCloseTask(Runnable task, boolean firstRunOnly)
Adds a task to run when the application is closed- Parameters:
task
- The taskfirstRunOnly
- If this should only be added for the first augment step. This makes it possible to prevent tasks being added for every build
-
-