Class Application

java.lang.Object
io.quarkus.runtime.Application
All Implemented Interfaces:
Closeable, AutoCloseable

public abstract class Application extends Object implements Closeable
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 Details

    • APP_CLASS_NAME

      public static final String APP_CLASS_NAME
      The name of the generated application class
      See Also:
    • currentApplication

      protected static volatile Application currentApplication
  • Constructor Details

    • Application

      protected Application(boolean auxiliaryApplication)
      Construct a new instance.
      Parameters:
      auxiliaryApplication -
  • Method Details

    • getValueRegistry

      public io.quarkus.registry.ValueRegistry getValueRegistry()
      Gets this Application ValueRegistry.
      Returns:
      this Application ValueRegistry.
    • start

      public final void start(String[] args)
      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

      protected abstract void doStart(String[] args)
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • 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

      public final void stop(Runnable afterStopTask)
      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

      public static Application currentApplication()
    • doStop

      protected abstract void doStop()
    • getName

      public abstract String getName()
    • awaitShutdown

      public void awaitShutdown()
    • isStarted

      public boolean isStarted()