Module io.avaje.jex
Package io.avaje.jex

Interface AppLifecycle


public interface AppLifecycle
Application lifecycle support.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Return true if status starting or started (the server is coming up).
    default boolean
    Return true the server has started.
    void
    onShutdown(Runnable onShutdown)
    Register a Runnable to run on shutdown of the server.
    void
    onShutdown(Runnable onShutdown, int order)
    Register a Runnable to run on shutdown of the server with ordering.
    void
    Register the runnable with the Runtime as a shutdown hook.
    Return the current status.
    void
    Set the current status.
  • Method Details

    • onShutdown

      void onShutdown(Runnable onShutdown)
      Register a Runnable to run on shutdown of the server.

      This will execute after the server has deemed there are no active requests.

    • onShutdown

      void onShutdown(Runnable onShutdown, int order)
      Register a Runnable to run on shutdown of the server with ordering.

      The runnables are executed with order from low to high (0 means run first).

      This will execute after the server has deemed there are no active requests.

      Parameters:
      onShutdown - The function to run on shutdown
      order - The relative order to execute with 0 meaning run first
    • registerShutdownHook

      void registerShutdownHook(Runnable onShutdown)
      Register the runnable with the Runtime as a shutdown hook.
    • status

      Return the current status.
    • status

      void status(AppLifecycle.Status newStatus)
      Set the current status.
    • isAlive

      default boolean isAlive()
      Return true if status starting or started (the server is coming up).
    • isReady

      default boolean isReady()
      Return true the server has started.