public class Quarkus extends Object
waitForExit()
should be called, which
will block until shutdown is initiated, either from an external signal or by a call to one of the exit methods.
If no main class is specified then one is generated automatically that will simply wait to exit after Quarkus is booted.Constructor and Description |
---|
Quarkus() |
Modifier and Type | Method and Description |
---|---|
static void |
asyncExit()
Exits the application in an async manner.
|
static void |
asyncExit(int code)
Exits the application in an async manner.
|
static void |
blockingExit()
Starts the shutdown process, then waits for the application to shut down.
|
static void |
run(Class<? extends QuarkusApplication> quarkusApplication,
BiConsumer<Integer,Throwable> exitHandler,
String... args)
Runs a quarkus application, that will run until the provided
QuarkusApplication has completed. |
static void |
run(Class<? extends QuarkusApplication> quarkusApplication,
String... args)
Runs a quarkus application, that will run until the provided
QuarkusApplication has completed. |
static void |
run(String... args)
Starts a quarkus application, that will run until it either receives a signal (e.g.
|
static void |
waitForExit()
Method that will block until the Quarkus shutdown process is initiated.
|
public static void run(Class<? extends QuarkusApplication> quarkusApplication, String... args)
QuarkusApplication
has completed.
Note that if this is run from the IDE the application will run in a different class loader to the
calling class. It is recommended that the calling class do no logic, and instead this logic should
go into the QuarkusApplication.quarkusApplication
- The application to run, or nullargs
- The command line parameterspublic static void run(Class<? extends QuarkusApplication> quarkusApplication, BiConsumer<Integer,Throwable> exitHandler, String... args)
QuarkusApplication
has completed.
Note that if this is run from the IDE the application will run in a different class loader to the
calling class. It is recommended that the calling class do no logic, and instead this logic should
go into the QuarkusApplication.quarkusApplication
- The application to run, or nullexitHandler
- The handler that is called with the exit code and any exception (if any) thrown when the application
has finishedargs
- The command line parameterspublic static void run(String... args)
args
- The command line parameterspublic static void asyncExit(int code)
waitForExit()
method.
Note that if the main thread is executing a Quarkus application this will only take
effect if waitForExit()
has been called, otherwise the application will continue
to execute (i.e. this does not initiate the shutdown process, it just signals the main
thread that the application is done so that shutdown can run when the main thread returns).
The error code supplied here will override the value returned from the main application.code
- The exit code. This may be overridden if an exception occurs on shutdownpublic static void asyncExit()
waitForExit()
method.
Note that if the main thread is executing a Quarkus application this will only take
effect if waitForExit()
has been called, otherwise the application will continue
to execute (i.e. this does not initiate the shutdown process, it just signals the main
thread that the application is done so that shutdown can run when the main thread returns).public static void waitForExit()
QuarkusApplication
implementations that wish to run some logic on startup, and
then run should call this method.public static void blockingExit()
Copyright © 2021 JBoss by Red Hat. All rights reserved.