Top Description Inners Methods
jakarta.ws.rs

public Interface SeBootstrap

Imports
java.net.URI, java.util.Optional, java.util.concurrent.CompletionStage, java.util.function.BiFunction, .Consumer, javax.net.ssl.SSLContext, jakarta.ws.rs.core.Application, .UriBuilder, jakarta.ws.rs.ext.RuntimeDelegate

Bootstrap class used to startup a JAX-RS application in Java SE environments.

The SeBootstrap class is available in a Jakarta EE container environment as well; however, support for the Java SE bootstrapping APIs is not required in container environments.

In a Java SE environment an application is getting started by the following command using default configuration values (i. e. mounting application at http://localhost:80/ or a different port (there is no particular default port mandated by this specification). As the JAX-RS implementation is free to choose any port by default, the caller will not know the actual port unless explicitly checking the actual configuration of the instance started:

Application app = new MyApplication();
SeBootstrap.Configuration config = SeBootstrap.Configuration.builder().build();
SeBootstrap.start(app, config).thenAccept(instance -> instance.configuration().port());

Running instances can be instructed to stop serving the application:

SeBootstrap.start(app, config).thenAccept(instance -> { ... instance.stop(); } );

A shutdown callback can be registered which will get invoked once the implementation stops serving the application:

instance.stop().thenAccept(stopResult -> ...));
stopResult is not further defined but solely acts as a wrapper around a native result provided by the particular JAX-RS implementation. Portable applications should not assume any particular data type or value.

Protocol, host address, port and root path can be overridden explicitly. As the JAX-RS implementation is bound to that values, no querying of the actual configuration is needed in that case:

SeBootstrap.Configuration.builder().protocol("HTTPS").host("0.0.0.0").port(8443).rootPath("api").build();

TLS can be configured by explicitly passing a customized SSLContext:

SSLContext tls = SSLContext.getInstance("TLSv1.2");
// ...further initialize context here (see JSSE API)...
SeBootstrap.Configuration.builder().protocol("HTTPS").sslContext(tls).build();

In case of HTTPS, client authentication can be enforced to ensure that only trustworthy clients can connect:

SeBootstrap.Configuration.builder().protocol("HTTPS").sslClientAuthentication(SSLClientAuthentication.MANDATORY).build();

Implementations are free to support more use cases by native properties, which effectively render the application non-portable:

SeBootstrap.Configuration.builder().property("productname.foo", "bar").build()

Bulk-loading allows to attach configuration storages easily without the need to write down all properties to be transferred. Hence, even properties unknown to the application author will get channeled into the implementation. This can be done both, explicitly (hence portable) and implicitly (hence not necessarily portable as no particular configuration mechanics are required to be supported by compliant implementations):

// Explicit use of particular configuration mechanics is portable
SeBootstrap.Configuration.builder().from((name, type) -> externalConfigurationSystem.getValue(name, type)).build();

// Implicitly relying on the support of particular configuration mechanics by
// the actual JAX-RS implementation is not necessarily portable
SeBootstrap.Configuration.builder().from(externalConfigurationSystem).build();
Author
Markus KARG ([email protected])
Since
3.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
SeBootstrap.Configuration

Provides information needed by the JAX-RS implementation for bootstrapping an application.

public static interface
SeBootstrap.Instance

Handle of the running application instance.

Method Summary

Modifier and TypeMethod and Description
public static CompletionStage<SeBootstrap.Instance>

Returns:

CompletionStage (possibly asynchronously) producing handle of the running application instance.
start
(final Application
The application to start up.
application
,
final SeBootstrap.Configuration
Provides information needed for bootstrapping the application.
configuration
)

Starts the provided application using the specified configuration.

public static CompletionStage<SeBootstrap.Instance>

Returns:

CompletionStage (possibly asynchronously) producing handle of the running application instance.
start
(final Application
The application to start up.
application
)

Starts the provided application using a default configuration.

public static CompletionStage<SeBootstrap.Instance>

Returns:

CompletionStage (possibly asynchronously) producing handle of the running application instance.
start
(final Class<? extends Application>
The application class.
clazz
,
final SeBootstrap.Configuration
Provides information needed for bootstrapping the application.
configuration
)

Starts the provided application using the specified configuration.

public static CompletionStage<SeBootstrap.Instance>

Returns:

CompletionStage (possibly asynchronously) producing handle of the running application instance.
start
(final Class<? extends Application>
The application class.
clazz
)

Starts the provided application using a default configuration.

Method Detail

startback to summary
public static CompletionStage<SeBootstrap.Instance> start(final Application application, final SeBootstrap.Configuration configuration)

Starts the provided application using the specified configuration.

This method is intended to be used in Java SE environments only. The outcome of invocations in Jakarta EE container environments is undefined.

Parameters
application:Application

The application to start up.

configuration:SeBootstrap.Configuration

Provides information needed for bootstrapping the application.

Returns:CompletionStage<SeBootstrap.Instance>

CompletionStage (possibly asynchronously) producing handle of the running application instance.

Since
3.1
See Also
Configuration
startback to summary
public static CompletionStage<SeBootstrap.Instance> start(final Application application)

Starts the provided application using a default configuration.

This method is intended to be used in Java SE environments only. The outcome of invocations in Jakarta EE container environments is undefined.

Parameters
application:Application

The application to start up.

Returns:CompletionStage<SeBootstrap.Instance>

CompletionStage (possibly asynchronously) producing handle of the running application instance.

Since
3.1
See Also
Configuration
startback to summary
public static CompletionStage<SeBootstrap.Instance> start(final Class<? extends Application> clazz, final SeBootstrap.Configuration configuration)

Starts the provided application using the specified configuration. Creates application instance from class using default constructor. Injection is not supported.

This method is intended to be used in Java SE environments only. The outcome of invocations in Jakarta EE container environments is undefined.

Parameters
clazz:Class<? extends Application>

The application class.

configuration:SeBootstrap.Configuration

Provides information needed for bootstrapping the application.

Returns:CompletionStage<SeBootstrap.Instance>

CompletionStage (possibly asynchronously) producing handle of the running application instance.

Since
3.1
See Also
Configuration
startback to summary
public static CompletionStage<SeBootstrap.Instance> start(final Class<? extends Application> clazz)

Starts the provided application using a default configuration. Creates application instance from class using default constructor. Injection is not supported.

This method is intended to be used in Java SE environments only. The outcome of invocations in Jakarta EE container environments is undefined.

Parameters
clazz:Class<? extends Application>

The application class.

Returns:CompletionStage<SeBootstrap.Instance>

CompletionStage (possibly asynchronously) producing handle of the running application instance.

Since
3.1
See Also
Configuration
jakarta.ws.rs back to summary

public Interface SeBootstrap.Configuration


Provides information needed by the JAX-RS implementation for bootstrapping an application.

The configuration essentially consists of a set of parameters. While the set of actually effective keys is product specific, the key constants defined by the SeBootstrap.Configuration interface MUST be effective on all compliant products. Any unknown key MUST be silently ignored.

Author
Markus KARG ([email protected])
Since
3.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
public static enum
SeBootstrap.Configuration.SSLClientAuthentication

Secure socket client authentication policy

This policy is used in secure socket handshake to control whether the server requests client authentication, and whether successful client authentication is mandatory (i.

Field Summary

Modifier and TypeField and Description
public static final int
DEFAULT_PORT

Special value for PORT property indicating that the implementation MUST use its default port.

public static final int
FREE_PORT

Special value for PORT property indicating that the implementation MUST scan for a free port.

public static final String
HOST

Configuration key for the hostname or IP address an application is bound to.

public static final String
PORT

Configuration key for the TCP port an application is bound to.

public static final String
PROTOCOL

Configuration key for the protocol an application is bound to.

public static final String
ROOT_PATH

Configuration key for the root path an application is bound to.

public static final String
SSL_CLIENT_AUTHENTICATION

Configuration key for the secure socket client authentication policy.

public static final String
SSL_CONTEXT

Configuration key for the secure socket configuration to be used.

Method Summary

Modifier and TypeMethod and Description
public default URI

Returns:

a built URI for the application.
baseUri
()

Convenience method that returns a built the URI for the application.

public default UriBuilder

Returns:

a UriBuilder for the application.
baseUriBuilder
()

Returns a UriBuilder that includes the application root path.

public static SeBootstrap.Configuration.Builder

Returns:

Builder for bootstrap configuration.
builder
()

Creates a new bootstrap configuration builder instance.

public default boolean

Returns:

false if no property exists matching the given name, true otherwise.
hasProperty
(String
a String specifying the name of the property.
name
)

Returns whether the property with the given name is configured, either explicitly or by default.

public default String

Returns:

host name or IP address to be used (e. g. "localhost" or "0.0.0.0").
host
()

Convenience method to get the host to be used.

public default int

Returns:

port number actually used (e. g. 8080).
port
()

Convenience method to get the actually used port.

public Object

Returns:

an Object containing the value of the property, or null if no property exists matching the given name.
property
(String
a String specifying the name of the property.
name
)

Returns the value of the property with the given name, or null if there is no property of that name.

public default String

Returns:

protocol to be used (e. g. "HTTP").
protocol
()

Convenience method to get the protocol to be used.

public default String

Returns:

root path to be used, e.g. "/".
rootPath
()

Convenience method to get the rootPath to be used.

public default SeBootstrap.Configuration.SSLClientAuthentication

Returns:

client authentication mode, e. g. NONE.
sslClientAuthentication
()

Convenience method to get the secure socket client authentication policy.

public default SSLContext

Returns:

root path to be used, e. g. "/".
sslContext
()

Convenience method to get the sslContext to be used.

Field Detail

DEFAULT_PORTback to summary
public static final int DEFAULT_PORT

Special value for PORT property indicating that the implementation MUST use its default port.

Since
3.1
FREE_PORTback to summary
public static final int FREE_PORT

Special value for PORT property indicating that the implementation MUST scan for a free port.

Since
3.1
HOSTback to summary
public static final String HOST

Configuration key for the hostname or IP address an application is bound to.

A compliant implementation at least MUST accept string values bearing hostnames, IP4 address text representations, and IP6 address text representations. If a hostname string, the special IP4 address string "0.0.0.0" or "::" for IP6 is provided, the application MUST be bound to all IP addresses assigned to that hostname. If the hostname string is "localhost" the application MUST be bound to the local host's loopback adapter only.

The default value is "localhost".

Since
3.1
PORTback to summary
public static final String PORT

Configuration key for the TCP port an application is bound to.

A compliant implementation MUST accept java.lang.Integer values.

There is no default port mandated by this specification, but the default value of this property is DEFAULT_PORT (i. e. -1). A compliant implementation MUST use its own default port when the value -1 is provided, and MAY apply (but is not obligated to) auto-selection and range-scanning algorithms.

Since
3.1
PROTOCOLback to summary
public static final String PROTOCOL

Configuration key for the protocol an application is bound to.

A compliant implementation at least MUST accept the strings "HTTP" and "HTTPS" if these protocols are supported.

The default value is "HTTP".

Since
3.1
ROOT_PATHback to summary
public static final String ROOT_PATH

Configuration key for the root path an application is bound to.

The default value is "/".

Since
3.1
SSL_CLIENT_AUTHENTICATIONback to summary
public static final String SSL_CLIENT_AUTHENTICATION

Configuration key for the secure socket client authentication policy.

A compliant implementation MUST accept SSLClientAuthentication enums.

The default value is SSLClientAuthentication#NONE.

Since
3.1
SSL_CONTEXTback to summary
public static final String SSL_CONTEXT

Configuration key for the secure socket configuration to be used.

The default value is SSLContext#getDefault().

Since
3.1

Method Detail

baseUriback to summary
public default URI baseUri()

Convenience method that returns a built the URI for the application.

Returns:URI

a built URI for the application.

Since
3.1
See Also
Configuration#baseUriBuilder()
baseUriBuilderback to summary
public default UriBuilder baseUriBuilder()

Returns a UriBuilder that includes the application root path.

Returns:UriBuilder

a UriBuilder for the application.

Since
3.1
builderback to summary
public static SeBootstrap.Configuration.Builder builder()

Creates a new bootstrap configuration builder instance.

Returns:SeBootstrap.Configuration.Builder

Builder for bootstrap configuration.

Since
3.1
hasPropertyback to summary
public default boolean hasProperty(String name)

Returns whether the property with the given name is configured, either explicitly or by default.

Parameters
name:String

a String specifying the name of the property.

Returns:boolean

false if no property exists matching the given name, true otherwise.

Since
3.1
hostback to summary
public default String host()

Convenience method to get the host to be used.

Same as if calling (String) property(HOST).

Returns:String

host name or IP address to be used (e. g. "localhost" or "0.0.0.0").

Exceptions
ClassCastException:
if host is not a String.
Since
3.1
See Also
SeBootstrap.Configuration#HOST
portback to summary
public default int port()

Convenience method to get the actually used port.

Same as if calling (int) property(PORT).

If the port was not explicitly given, this will return the port chosen implicitly by the JAX-RS implementation.

Returns:int

port number actually used (e. g. 8080).

Exceptions
ClassCastException:
if port is not an Integer.
Since
3.1
See Also
SeBootstrap.Configuration#PORT
propertyback to summary
public Object property(String name)

Returns the value of the property with the given name, or null if there is no property of that name.

Parameters
name:String

a String specifying the name of the property.

Returns:Object

an Object containing the value of the property, or null if no property exists matching the given name.

Since
3.1
protocolback to summary
public default String protocol()

Convenience method to get the protocol to be used.

Same as if calling (String) property(PROTOCOL).

Returns:String

protocol to be used (e. g. "HTTP").

Exceptions
ClassCastException:
if protocol is not a String.
Since
3.1
See Also
SeBootstrap.Configuration#PROTOCOL
rootPathback to summary
public default String rootPath()

Convenience method to get the rootPath to be used.

Same as if calling (String) property(ROOT_PATH).

Returns:String

root path to be used, e.g. "/".

Exceptions
ClassCastException:
if root path is not a String.
Since
3.1
See Also
SeBootstrap.Configuration#ROOT_PATH
sslClientAuthenticationback to summary
public default SeBootstrap.Configuration.SSLClientAuthentication sslClientAuthentication()

Convenience method to get the secure socket client authentication policy.

Same as if calling (SSLClientAuthentication) property(SSL_CLIENT_AUTHENTICATION).

Returns:SeBootstrap.Configuration.SSLClientAuthentication

client authentication mode, e. g. NONE.

Exceptions
ClassCastException:
if sslClientAuthentication is not a SSLClientAuthentication.
Since
3.1
See Also
SeBootstrap.Configuration#SSL_CLIENT_AUTHENTICATION
sslContextback to summary
public default SSLContext sslContext()

Convenience method to get the sslContext to be used.

Same as if calling (SSLContext) property(SSL_CONTEXT).

Returns:SSLContext

root path to be used, e. g. "/".

Exceptions
ClassCastException:
if sslContext is not a SSLContext.
Since
3.1
See Also
SeBootstrap.Configuration#SSL_CONTEXT
jakarta.ws.rs back to summary

public Interface SeBootstrap.Configuration.Builder


Builder for bootstrap Configuration.
Author
Markus KARG ([email protected])
Since
3.1

Method Summary

Modifier and TypeMethod and Description
public SeBootstrap.Configuration

Returns:

Configuration built from provided property values.
build
()

Builds a bootstrap configuration instance from the provided property values.

public <
Type of the requested property value.
T
>
SeBootstrap.Configuration.Builder

Returns:

the updated builder.
from
(BiFunction<String, Class<T>, Optional<T>>
Retrieval function of externally managed properties. MUST NOT return null.
propertiesProvider
)

Convenience method for bulk-loading configuration from a property supplier.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
from
(Object
source of externally managed properties
externalConfig
)

Optional convenience method to bulk-load external configuration.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
host
(String
host parameter (IP address or hostname) of this configuration, or null to use the default value.
host
)

Convenience method to set the host to be used.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
port
(Integer
port parameter of this configuration, or null to use the default value.
port
)

Convenience method to set the port to be used.

public SeBootstrap.Configuration.Builder

Returns:

the updated builder.
property
(String
name of the parameter to set.
name
,
Object
value to set, or null to use the default value.
value
)

Sets the property name to the provided value.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
protocol
(String
protocol parameter of this configuration, or null to use the default value.
protocol
)

Convenience method to set the protocol to be used.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
rootPath
(String
rootPath parameter of this configuration, or null to use the default value.
rootPath
)

Convenience method to set the rootPath to be used.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
sslClientAuthentication
(SeBootstrap.Configuration.SSLClientAuthentication
SSL client authentication mode of this configuration
sslClientAuthentication
)

Convenience method to set SSL client authentication policy.

public default SeBootstrap.Configuration.Builder

Returns:

the updated builder.
sslContext
(SSLContext
sslContext parameter of this configuration, or null to use the default value.
sslContext
)

Convenience method to set the sslContext to be used.

Method Detail

buildback to summary
public SeBootstrap.Configuration build()

Builds a bootstrap configuration instance from the provided property values.

Returns:SeBootstrap.Configuration

Configuration built from provided property values.

Since
3.1
fromback to summary
public <T> SeBootstrap.Configuration.Builder from(BiFunction<String, Class<T>, Optional<T>> propertiesProvider)

Convenience method for bulk-loading configuration from a property supplier.

Implementations ask the passed provider function for the actual values of all their supported properties, before returning from this configuration method. For each single request the implementation provides the name of the property and the expected data type of the value. If no such property exists (i. e. either the name is unknown or misspelled, or the type does not exactly match), the Optional is empty.

Parameters
<T>
Type of the requested property value.
propertiesProvider:BiFunction<String, Class<T>, Optional<T>>

Retrieval function of externally managed properties. MUST NOT return null.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
fromback to summary
public default SeBootstrap.Configuration.Builder from(Object externalConfig)

Optional convenience method to bulk-load external configuration.

Implementations are free to support any external configuration mechanics, or none at all. It is completely up to the implementation what set of properties is effectively loaded from the provided external configuration, possibly none at all.

If the passed external configuration mechanics is unsupported, this method MUST simply do nothing.

Portable applications should not call this method, as the outcome is completely implementation-specific.

Parameters
externalConfig:Object

source of externally managed properties

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
hostback to summary
public default SeBootstrap.Configuration.Builder host(String host)

Convenience method to set the host to be used.

Same as if calling property(HOST, value).

Parameters
host:String

host parameter (IP address or hostname) of this configuration, or null to use the default value.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
See Also
SeBootstrap.Configuration#HOST
portback to summary
public default SeBootstrap.Configuration.Builder port(Integer port)

Convenience method to set the port to be used.

Same as if calling property(PORT, value).

Parameters
port:Integer

port parameter of this configuration, or null to use the default value.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
See Also
SeBootstrap.Configuration#PORT
propertyback to summary
public SeBootstrap.Configuration.Builder property(String name, Object value)

Sets the property name to the provided value.

This method does not check the validity, type or syntax of the provided value.

Parameters
name:String

name of the parameter to set.

value:Object

value to set, or null to use the default value.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
protocolback to summary
public default SeBootstrap.Configuration.Builder protocol(String protocol)

Convenience method to set the protocol to be used.

Same as if calling property(PROTOCOL, value).

Parameters
protocol:String

protocol parameter of this configuration, or null to use the default value.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
See Also
SeBootstrap.Configuration#PROTOCOL
rootPathback to summary
public default SeBootstrap.Configuration.Builder rootPath(String rootPath)

Convenience method to set the rootPath to be used.

Same as if calling property(ROOT_PATH, value).

Parameters
rootPath:String

rootPath parameter of this configuration, or null to use the default value.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
See Also
SeBootstrap.Configuration#ROOT_PATH
sslClientAuthenticationback to summary
public default SeBootstrap.Configuration.Builder sslClientAuthentication(SeBootstrap.Configuration.SSLClientAuthentication sslClientAuthentication)

Convenience method to set SSL client authentication policy.

Same as if calling property(SSL_CLIENT_AUTHENTICATION, value).

Parameters
sslClientAuthentication:SeBootstrap.Configuration.SSLClientAuthentication

SSL client authentication mode of this configuration

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
See Also
SeBootstrap.Configuration#SSL_CLIENT_AUTHENTICATION
sslContextback to summary
public default SeBootstrap.Configuration.Builder sslContext(SSLContext sslContext)

Convenience method to set the sslContext to be used.

Same as if calling property(SSL_CONTEXT, value).

Parameters
sslContext:SSLContext

sslContext parameter of this configuration, or null to use the default value.

Returns:SeBootstrap.Configuration.Builder

the updated builder.

Since
3.1
See Also
SeBootstrap.Configuration#SSL_CONTEXT
jakarta.ws.rs back to summary

public final Enum SeBootstrap.Configuration.SSLClientAuthentication

extends Enum<SeBootstrap.Configuration.SSLClientAuthentication>
Class Inheritance

Secure socket client authentication policy

This policy is used in secure socket handshake to control whether the server requests client authentication, and whether successful client authentication is mandatory (i. e. connection attempt will fail for invalid clients).

Author
Markus KARG ([email protected])
Since
3.1

Field Summary

Modifier and TypeField and Description
public static final SeBootstrap.Configuration.SSLClientAuthentication
MANDATORY

Client authentication is performed, and invalid clients are rejected.

public static final SeBootstrap.Configuration.SSLClientAuthentication
NONE

Server will not request client authentication.

public static final SeBootstrap.Configuration.SSLClientAuthentication
OPTIONAL

Client authentication is performed, but invalid clients are accepted.

Constructor Summary

AccessConstructor and Description
private

Field Detail

MANDATORYback to summary
public static final SeBootstrap.Configuration.SSLClientAuthentication MANDATORY

Client authentication is performed, and invalid clients are rejected.

Since
3.1
NONEback to summary
public static final SeBootstrap.Configuration.SSLClientAuthentication NONE

Server will not request client authentication.

Since
3.1
OPTIONALback to summary
public static final SeBootstrap.Configuration.SSLClientAuthentication OPTIONAL

Client authentication is performed, but invalid clients are accepted.

Since
3.1

Constructor Detail

SSLClientAuthenticationback to summary
private SSLClientAuthentication()

Method Detail

valueOfback to summary
public static SeBootstrap.Configuration.SSLClientAuthentication valueOf(String name)
valuesback to summary
public static SeBootstrap.Configuration.SSLClientAuthentication[] values()
jakarta.ws.rs back to summary

public Interface SeBootstrap.Instance


Handle of the running application instance.
Author
Markus KARG ([email protected])
Since
3.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
SeBootstrap.Instance.StopResult

Result of stopping the application instance.

Method Summary

Modifier and TypeMethod and Description
public SeBootstrap.Configuration

Returns:

The configuration actually used to create this instance.
configuration
()

Provides access to the configuration actually used by the implementation used to create this instance.

public CompletionStage<SeBootstrap.Instance.StopResult>

Returns:

CompletionStage asynchronously shutting down this application instance.
stop
()

Initiate immediate shutdown of running application instance.

public default void
stopOnShutdown(Consumer<SeBootstrap.Instance.StopResult>
The consumer.
consumer
)

Registers a consumer for a StopResult which will be executed in a new thread during the JVM shutdown phase.

public <
Requested type of the native handle to return.
T
>
T

Returns:

Native handle of the running application instance or null if the implementation has no native handle.
unwrap
(Class<T>
Requested type of the native handle to return.
nativeClass
)

Provides access to the wrapped native handle of the application instance.

Method Detail

configurationback to summary
public 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:SeBootstrap.Configuration

The configuration actually used to create this instance.

Since
3.1
stopback to summary
public CompletionStage<SeBootstrap.Instance.StopResult> stop()

Initiate immediate shutdown of running application instance.

Returns:CompletionStage<SeBootstrap.Instance.StopResult>

CompletionStage asynchronously shutting down this application instance.

Since
3.1
stopOnShutdownback to summary
public default void stopOnShutdown(Consumer<SeBootstrap.Instance.StopResult> consumer)

Registers a consumer for a StopResult which will be executed in a new thread during the JVM shutdown phase.

Parameters
consumer:Consumer<SeBootstrap.Instance.StopResult>

The consumer.

Since
3.1
unwrapback to summary
public <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.

Parameters
<T>
Requested type of the native handle to return.
nativeClass:Class<T>

Requested type of the native handle to return.

Returns:T

Native handle of the running application instance or null if the implementation has no native handle.

Exceptions
ClassCastException:
if the handle is not null and is not assignable to the type T.
Since
3.1
jakarta.ws.rs back to summary

public Interface SeBootstrap.Instance.StopResult


Result of stopping the application instance.
Author
Markus KARG ([email protected])
Since
3.1

Method Summary

Modifier and TypeMethod and Description
public <
Requested type of the native result to return.
T
>
T

Returns:

Native result of shutting down the running application instance or null if the implementation has no native result.
unwrap
(Class<T>
Requested type of the native result to return.
nativeClass
)

Provides access to the wrapped native shutdown result.

Method Detail

unwrapback to summary
public <T> T unwrap(Class<T> nativeClass)

Provides access to the wrapped native shutdown result.

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

Parameters
<T>
Requested type of the native result to return.
nativeClass:Class<T>

Requested type of the native result to return.

Returns:T

Native result of shutting down the running application instance or null if the implementation has no native result.

Exceptions
ClassCastException:
if the result is not null or is not assignable to the type T.
Since
3.1