|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.ws.rs.ext.RuntimeDelegate
public abstract class RuntimeDelegate
Implementations of JAX-RS provide a concrete subclass of RuntimeDelegate and various JAX-RS API methods defer to methods of RuntimeDelegate for their functionality. Regular users of JAX-RS are not expected to use this class directly and overriding an implementation of this class with a user supplied subclass may cause unexpected behavior.
| Nested Class Summary | |
|---|---|
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. |
| Field Summary | |
|---|---|
static java.lang.String |
JAXRS_RUNTIME_DELEGATE_PROPERTY
Name of the property identifying the RuntimeDelegate implementation
to be returned from getInstance(). |
| Constructor Summary | |
|---|---|
protected |
RuntimeDelegate()
Allows custom implementations to extend the RuntimeDelegate class. |
| Method Summary | ||
|---|---|---|
abstract
|
createEndpoint(Application application,
java.lang.Class<T> endpointType)
Create a configured instance of the supplied endpoint type. |
|
abstract
|
createHeaderDelegate(java.lang.Class<T> type)
Obtain an instance of a RuntimeDelegate.HeaderDelegate for the supplied class. |
|
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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String JAXRS_RUNTIME_DELEGATE_PROPERTY
RuntimeDelegate implementation
to be returned from getInstance().
| Constructor Detail |
|---|
protected RuntimeDelegate()
RuntimeDelegate class.
| Method Detail |
|---|
public static RuntimeDelegate getInstance()
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/javax.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 javax.ws.rs.ext.RuntimeDelegate, then the value of
that entry is used as the name of the implementation class.
javax.ws.rs.ext.RuntimeDelegate
is defined, then its value is used as the name of the implementation class.
public static void setInstance(RuntimeDelegate rd)
throws java.lang.SecurityException
getInstance() then an implementation will
be sought as described in getInstance().
rd - the runtime delegate instance
java.lang.SecurityException - if there is a security manager and the permission
ReflectPermission("suppressAccessChecks") has not been granted.public abstract UriBuilder createUriBuilder()
UriBuilder.
UriBuilderpublic abstract Response.ResponseBuilder createResponseBuilder()
Response.ResponseBuilder.
Response.ResponseBuilderpublic abstract Variant.VariantListBuilder createVariantListBuilder()
Variant.VariantListBuilder.
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 configurationendpointType - 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:
Cookie, CacheControl,
EntityTag, NewCookie,
MediaType and java.util.Date.
T - header type.type - the class of the header
java.lang.IllegalArgumentException - if type is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||