Class RuntimeDelegate

  • public abstract class RuntimeDelegate
    extends java.lang.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.
    • Constructor Detail

      • RuntimeDelegate

        protected RuntimeDelegate​()
        Allows custom implementations to extend the RuntimeDelegate class.
    • Method Detail

      • getInstance

        public static RuntimeDelegate getInstance​()
        Obtain a 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:

        • If a resource with the name of META-INF/services/ exists, then its first line, if present, is used as the UTF-8 encoded name of the implementation class.
        • If the $java.home/lib/ file exists and it is readable by the java.util.Properties.load(InputStream) method and it contains an entry whose key is, then the value of that entry is used as the name of the implementation class.
        • If a system property with the name is defined, then its value is used as the name of the implementation class.
        • Finally, a default implementation class name is used.
        an instance of RuntimeDelegate.
      • 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 to 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.
      • createUriBuilder

        public abstract UriBuilder createUriBuilder​()
        Create a new instance of a UriBuilder.
        new UriBuilder instance.
        See Also:
      • createEndpoint

        public abstract <T> T createEndpoint​(Application application,
                                             java.lang.Class<T> endpointType)
                                      throws java.lang.IllegalArgumentException,
        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.
        application - the application configuration.
        endpointType - the type of endpoint instance to be created.
        a configured instance of the requested type.
        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.