public abstract class RuntimeDelegate
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
RuntimeDelegate.HeaderDelegate<T>
Defines the contract for a delegate that is responsible for converting between the String form of a HTTP header and
the corresponding JAX-RS type
T . |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JAXRS_RUNTIME_DELEGATE_PROPERTY
Name of the property identifying the
RuntimeDelegate implementation to be returned from
getInstance() . |
Modifier | Constructor and Description |
---|---|
protected |
RuntimeDelegate()
Allows custom implementations to extend the
RuntimeDelegate class. |
Modifier and Type | Method and Description |
---|---|
abstract java.util.concurrent.CompletionStage<SeBootstrap.Instance> |
bootstrap(Application application,
SeBootstrap.Configuration configuration)
Perform startup of the application in Java SE environments.
|
abstract java.util.concurrent.CompletionStage<SeBootstrap.Instance> |
bootstrap(java.lang.Class<? extends Application> clazz,
SeBootstrap.Configuration configuration)
Perform startup of the application in Java SE environments.
|
abstract SeBootstrap.Configuration.Builder |
createConfigurationBuilder()
Create a new instance of a
SeBootstrap.Configuration.Builder . |
abstract <T> T |
createEndpoint(Application application,
java.lang.Class<T> endpointType)
Create a configured instance of the supplied endpoint type.
|
abstract EntityPart.Builder |
createEntityPartBuilder(java.lang.String partName)
Create a new instance of a
EntityPart.Builder . |
abstract <T> RuntimeDelegate.HeaderDelegate<T> |
createHeaderDelegate(java.lang.Class<T> type)
Obtain an instance of a
RuntimeDelegate.HeaderDelegate for the supplied class. |
abstract Link.Builder |
createLinkBuilder()
Create a new instance of a
Link.Builder . |
abstract Response.ResponseBuilder |
createResponseBuilder()
Create a new instance of a
Response.ResponseBuilder . |
abstract UriBuilder |
createUriBuilder()
Create a new instance of a
UriBuilder . |
abstract Variant.VariantListBuilder |
createVariantListBuilder()
Create a new instance of a
Variant.VariantListBuilder . |
static RuntimeDelegate |
getInstance()
Obtain a
RuntimeDelegate instance. |
static void |
setInstance(RuntimeDelegate rd)
Set the runtime delegate that will be used by JAX-RS classes.
|
public static final java.lang.String JAXRS_RUNTIME_DELEGATE_PROPERTY
RuntimeDelegate
implementation to be returned from
getInstance()
.protected RuntimeDelegate()
RuntimeDelegate
class.public static RuntimeDelegate getInstance()
RuntimeDelegate
instance. If an instance had not already been created and set via
setInstance(RuntimeDelegate)
, the first invocation will create an instance which will then be cached for
future use.
The algorithm used to locate the RuntimeDelegate subclass to use consists of the following steps:
META-INF/services/jakarta.ws.rs.ext.RuntimeDelegate
exists, then its first
line, if present, is used as the UTF-8 encoded name of the implementation class.java.util.Properties.load(InputStream)
method and it contains an entry whose key is
jakarta.ws.rs.ext.RuntimeDelegate
, then the value of that entry is used as the name of the implementation
class.jakarta.ws.rs.ext.RuntimeDelegate
is defined, then its value is used as
the name of the implementation class.RuntimeDelegate
.public static void setInstance(RuntimeDelegate rd)
getInstance()
then an implementation will be sought as described in getInstance()
.rd
- the runtime delegate instancejava.lang.SecurityException
- if there is a security manager and the permission ReflectPermission("suppressAccessChecks")
has not been granted.public abstract UriBuilder createUriBuilder()
UriBuilder
.UriBuilder
instance.UriBuilder
public abstract Response.ResponseBuilder createResponseBuilder()
Response.ResponseBuilder
.ResponseBuilder
instance.Response.ResponseBuilder
public abstract Variant.VariantListBuilder createVariantListBuilder()
Variant.VariantListBuilder
.VariantListBuilder
instance.Variant.VariantListBuilder
public abstract <T> T createEndpoint(Application application, java.lang.Class<T> endpointType) throws java.lang.IllegalArgumentException, java.lang.UnsupportedOperationException
T
- endpoint type.application
- the application configuration.endpointType
- the type of endpoint instance to be created.java.lang.IllegalArgumentException
- if application is null or the requested endpoint type is not supported.java.lang.UnsupportedOperationException
- if the implementation supports no endpoint types.public abstract <T> RuntimeDelegate.HeaderDelegate<T> createHeaderDelegate(java.lang.Class<T> type) throws java.lang.IllegalArgumentException
RuntimeDelegate.HeaderDelegate
for the supplied class. An implementation is required to support the
following values for type: CacheControl
, Cookie
,
EntityTag
, Link
, NewCookie
,
MediaType
and java.util.Date
.T
- header type.type
- the class of the header.HeaderDelegate
for the supplied type.java.lang.IllegalArgumentException
- if type is null
.RuntimeDelegate.HeaderDelegate
public abstract Link.Builder createLinkBuilder()
Link.Builder
.Link.Builder
instance.Link.Builder
public abstract SeBootstrap.Configuration.Builder createConfigurationBuilder()
SeBootstrap.Configuration.Builder
.
This method is not intended to be invoked by applications. Call SeBootstrap.Configuration#builder()
instead.
SeBootstrap.Configuration.Builder
instance.SeBootstrap.Configuration.Builder
public abstract java.util.concurrent.CompletionStage<SeBootstrap.Instance> bootstrap(Application application, SeBootstrap.Configuration configuration)
This method is not intended to be invoked by applications. Call SeBootstrap.start(Application,
SeBootstrap.Configuration)
instead.
application
- The application to start up.configuration
- The bootstrap configuration.CompletionStage
asynchronously producing handle of the running application instance
.public abstract java.util.concurrent.CompletionStage<SeBootstrap.Instance> bootstrap(java.lang.Class<? extends Application> clazz, SeBootstrap.Configuration configuration)
This method is not intended to be invoked by applications. Call SeBootstrap.start(Class,
SeBootstrap.Configuration)
instead.
clazz
- The application class to instantiate and start.configuration
- The bootstrap configuration.CompletionStage
asynchronously producing handle of the running application instance
.public abstract EntityPart.Builder createEntityPartBuilder(java.lang.String partName) throws java.lang.IllegalArgumentException
EntityPart.Builder
.
This method is not intended to be invoked by applications. Call EntityPart.withName(String)
instead.
partName
- name for this part within the multipart body.EntityPart.Builder
instance with specified part namejava.lang.IllegalArgumentException
- if partName
is null
.