- java.lang.Object
-
- javax.ws.rs.ext.RuntimeDelegate
-
public abstract class RuntimeDelegate extends Object
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.- Since:
- 1.0
- Author:
- Paul Sandoz, Marc Hadley
-
-
Nested Class Summary
Nested Classes 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 typeT
.
-
Field Summary
Fields Modifier and Type Field and Description static String
JAXRS_RUNTIME_DELEGATE_PROPERTY
Name of the property identifying theRuntimeDelegate
implementation to be returned fromgetInstance()
.
-
Constructor Summary
Constructors Modifier Constructor and Description protected
RuntimeDelegate()
Allows custom implementations to extend theRuntimeDelegate
class.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract <T> T
createEndpoint(Application application, Class<T> endpointType)
Create a configured instance of the supplied endpoint type.abstract <T> RuntimeDelegate.HeaderDelegate<T>
createHeaderDelegate(Class<T> type)
Obtain an instance of aRuntimeDelegate.HeaderDelegate
for the supplied class.abstract Link.Builder
createLinkBuilder()
Create a new instance of aLink.Builder
.abstract Response.ResponseBuilder
createResponseBuilder()
Create a new instance of aResponse.ResponseBuilder
.abstract UriBuilder
createUriBuilder()
Create a new instance of aUriBuilder
.abstract Variant.VariantListBuilder
createVariantListBuilder()
Create a new instance of aVariant.VariantListBuilder
.static RuntimeDelegate
getInstance()
Obtain aRuntimeDelegate
instance.static void
setInstance(RuntimeDelegate rd)
Set the runtime delegate that will be used by JAX-RS classes.
-
-
-
Field Detail
-
JAXRS_RUNTIME_DELEGATE_PROPERTY
public static final String JAXRS_RUNTIME_DELEGATE_PROPERTY
Name of the property identifying theRuntimeDelegate
implementation to be returned fromgetInstance()
.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
RuntimeDelegate
protected RuntimeDelegate()
Allows custom implementations to extend theRuntimeDelegate
class.
-
-
Method Detail
-
getInstance
public static RuntimeDelegate getInstance()
Obtain aRuntimeDelegate
instance. If an instance had not already been created and set viasetInstance(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:
-
If a resource with the name of
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. -
If the $java.home/lib/jaxrs.properties file exists and it is readable by
the
java.util.Properties.load(InputStream)
method and it contains an entry whose key isjavax.ws.rs.ext.RuntimeDelegate
, then the value of that entry is used as the name of the implementation class. -
If a system property with the name
javax.ws.rs.ext.RuntimeDelegate
is defined, then its value is used as the name of the implementation class. - Finally, a default implementation class name is used.
- Returns:
- an instance of
RuntimeDelegate
.
-
If a resource with the name of
-
setInstance
public static void setInstance(RuntimeDelegate rd)
Set the runtime delegate that will be used by JAX-RS classes. If this method is not called prior togetInstance()
then an implementation will be sought as described ingetInstance()
.- Parameters:
rd
- the runtime delegate instance- Throws:
SecurityException
- if there is a security manager and the permission ReflectPermission("suppressAccessChecks") has not been granted.
-
createUriBuilder
public abstract UriBuilder createUriBuilder()
Create a new instance of aUriBuilder
.- Returns:
- new
UriBuilder
instance. - See Also:
UriBuilder
-
createResponseBuilder
public abstract Response.ResponseBuilder createResponseBuilder()
Create a new instance of aResponse.ResponseBuilder
.- Returns:
- new
ResponseBuilder
instance. - See Also:
Response.ResponseBuilder
-
createVariantListBuilder
public abstract Variant.VariantListBuilder createVariantListBuilder()
Create a new instance of aVariant.VariantListBuilder
.- Returns:
- new
VariantListBuilder
instance. - See Also:
Variant.VariantListBuilder
-
createEndpoint
public abstract <T> T createEndpoint(Application application, Class<T> endpointType) throws IllegalArgumentException, UnsupportedOperationException
Create a configured instance of the supplied endpoint type. How the returned endpoint instance is published is dependent on the type of endpoint.- Type Parameters:
T
- endpoint type.- Parameters:
application
- the application configuration.endpointType
- the type of endpoint instance to be created.- Returns:
- a configured instance of the requested type.
- Throws:
IllegalArgumentException
- if application is null or the requested endpoint type is not supported.UnsupportedOperationException
- if the implementation supports no endpoint types.
-
createHeaderDelegate
public abstract <T> RuntimeDelegate.HeaderDelegate<T> createHeaderDelegate(Class<T> type) throws IllegalArgumentException
Obtain an instance of aRuntimeDelegate.HeaderDelegate
for the supplied class. An implementation is required to support the following values for type:CacheControl
,Cookie
,EntityTag
,Link
,NewCookie
,MediaType
andjava.util.Date
.- Type Parameters:
T
- header type.- Parameters:
type
- the class of the header.- Returns:
- an instance of
HeaderDelegate
for the supplied type. - Throws:
IllegalArgumentException
- if type isnull
.- See Also:
RuntimeDelegate.HeaderDelegate
-
createLinkBuilder
public abstract Link.Builder createLinkBuilder()
Create a new instance of aLink.Builder
.- Returns:
- new
Link.Builder
instance. - See Also:
Link.Builder
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/ws/rs/ext/RuntimeDelegate.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.