Package jakarta.ws.rs

Interface SeBootstrap.Instance

Enclosing interface:
SeBootstrap

public static interface SeBootstrap.Instance
Handle of the running application instance.
Since:
3.1
Author:
Markus KARG (markus@headcrashing.eu)
  • Method Details

    • configuration

      SeBootstrap.Configuration configuration()
      Provides access to the configuration actually used by the implementation used to create this instance.

      This may, or may not, be the same instance passed to SeBootstrap.start(Application, Configuration), not even an equal instance, as implementations MAY create a new intance and MUST update at least the PORT property with the actually used value. Portable applications should not make any assumptions but always explicitly read the actual values from the configuration returned from this method.

      Returns:
      The configuration actually used to create this instance.
      Since:
      3.1
    • stop

      Initiate immediate shutdown of running application instance.
      Returns:
      CompletionStage asynchronously shutting down this application instance.
      Since:
      3.1
    • unwrap

      <T> T unwrap(Class<T> nativeClass)
      Provides access to the wrapped native handle of the application instance.

      Implementations may, or may not, have native handles. Portable applications should not invoke this method, as the outcome is undefined.

      Type Parameters:
      T - Requested type of the native handle to return.
      Parameters:
      nativeClass - Requested type of the native handle to return.
      Returns:
      Native handle of the running application instance or null if the implementation has no native handle.
      Throws:
      ClassCastException - if the handle is not null and is not assignable to the type T.
      Since:
      3.1
    • stopOnShutdown

      default void stopOnShutdown(Consumer<SeBootstrap.Instance.StopResult> consumer)
      Registers a consumer for a SeBootstrap.Instance.StopResult which will be executed in a new thread during the JVM shutdown phase.
      Parameters:
      consumer - The consumer.
      Since:
      3.1