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)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
SeBootstrap.Instance.StopResult
Result of stopping the application instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description SeBootstrap.Configuration
configuration()
Provides access to the configuration actually used by the implementation used to create this instance.CompletionStage<SeBootstrap.Instance.StopResult>
stop()
Initiate immediate shutdown of running application instance.default void
stopOnShutdown(Consumer<SeBootstrap.Instance.StopResult> consumer)
Registers a consumer for aSeBootstrap.Instance.StopResult
which will be executed in a new thread during the JVM shutdown phase.<T> T
unwrap(Class<T> nativeClass)
Provides access to the wrapped native handle of the application instance.
-
-
-
Method Detail
-
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 thePORT
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
CompletionStage<SeBootstrap.Instance.StopResult> 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 notnull
and is not assignable to the typeT
.- Since:
- 3.1
-
stopOnShutdown
default void stopOnShutdown(Consumer<SeBootstrap.Instance.StopResult> consumer)
Registers a consumer for aSeBootstrap.Instance.StopResult
which will be executed in a new thread during the JVM shutdown phase.- Parameters:
consumer
- The consumer.- Since:
- 3.1
-
-