Package io.quarkus.runtime
Class Application
java.lang.Object
io.quarkus.runtime.Application
- All Implemented Interfaces:
Closeable,AutoCloseable
The application base class, which is extended and implemented by a generated class which implements the application
setup logic. The base class does some basic error checking, and maintains the application state.
Note that this class does not manage the application lifecycle in any way, it is solely responsible for starting and
stopping the application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of the generated application classprotected static Application -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedApplication(boolean auxiliaryApplication) Construct a new instance. -
Method Summary
-
Field Details
-
APP_CLASS_NAME
The name of the generated application class- See Also:
-
currentApplication
-
-
Constructor Details
-
Application
protected Application(boolean auxiliaryApplication) Construct a new instance.- Parameters:
auxiliaryApplication-
-
-
Method Details
-
start
Start the application. If another thread is also trying to start the application, this method waits for that thread to finish starting. Returns immediately if the application is started already. If the application fails to start, an exception is thrown.- Parameters:
args- the command-line arguments
-
doStart
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
stop
public final void stop()Stop the application. If another thread is also trying to stop the application, this method waits for that thread to finish. Returns immediately if the application is already stopped. If an exception is thrown during stop, that exception is propagated. -
stop
Stop the application. If another thread is also trying to stop the application, this method waits for that thread to finish. Returns immediately if the application is already stopped. If an exception is thrown during stop, that exception is propagated. -
currentApplication
-
doStop
protected abstract void doStop() -
getName
-
awaitShutdown
public void awaitShutdown() -
isStarted
public boolean isStarted()
-