Class DefaultResourceConfig

  • All Implemented Interfaces:
    com.tangosol.coherence.http.HttpApplication, javax.ws.rs.core.Configurable<org.glassfish.jersey.server.ResourceConfig>, javax.ws.rs.core.Configuration, org.glassfish.jersey.ExtendedConfig, org.glassfish.jersey.server.ServerConfig
    Direct Known Subclasses:
    ContainerResourceConfig, PassThroughResourceConfig

    @ApplicationPath("/api")
    public class DefaultResourceConfig
    extends org.glassfish.jersey.server.ResourceConfig
    implements com.tangosol.coherence.http.HttpApplication
    An extension of org.glassfish.jersey.server.ResourceConfig that registers the Coherence REST root resource and provider classes, in addition to user defined package names.
    Author:
    ic 2011.07.05
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultResourceConfig()
      Default constructor.
      DefaultResourceConfig​(Class<?> classes)
      Construct an instance of ResourceConfig that initialized with a given set of resource/provider classes and Coherence predefined root resource and providers.
      DefaultResourceConfig​(String... asPackages)
      Construct an instance of ResourceConfig that initialize Coherence predefined properties and searches for root resource classes and providers in the specified packages.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected static Map<String,​javax.ws.rs.core.MediaType> getExtensionsMap()
      Construct a map with URL suffix to media type mappings.
      protected boolean isRunningInContainer()
      Return whether REST API is run inside the container (true) or standalone (false).
      protected void registerContainerRequestFilters()
      Register the predefined Coherence REST container request filters.
      protected void registerContainerResponseFilters()
      Register the predefined Coherence REST container response filters.
      protected void registerProviders()
      Register the default Coherence REST providers.
      protected void registerResourceFilterFactories()
      Register the predefined Coherence REST resource filter factories.
      protected void registerRootResource()
      Register the default Coherence REST root resource class.
      String toString()
      • Methods inherited from class org.glassfish.jersey.server.ResourceConfig

        addProperties, files, files, forApplication, forApplicationClass, forApplicationClass, getApplication, getApplicationName, getClasses, getClassLoader, getConfiguration, getContracts, getInstances, getProperties, getProperty, getPropertyNames, getResources, getRuntimeType, getSingletons, isEnabled, isEnabled, isProperty, isRegistered, isRegistered, packages, packages, packages, property, register, register, register, register, register, register, register, register, registerClasses, registerClasses, registerFinder, registerInstances, registerInstances, registerResources, registerResources, setApplicationName, setClassLoader, setProperties
      • Methods inherited from interface com.tangosol.coherence.http.HttpApplication

        configure, getPath
    • Constructor Detail

      • DefaultResourceConfig

        public DefaultResourceConfig()
        Default constructor.
      • DefaultResourceConfig

        public DefaultResourceConfig​(Class<?> classes)
        Construct an instance of ResourceConfig that initialized with a given set of resource/provider classes and Coherence predefined root resource and providers.
        Parameters:
        classes - a set of resource/provider classes to initialize the resource configuration with. If null or an empty set is provided, the Coherence predefined root resource and providers will be used.
      • DefaultResourceConfig

        public DefaultResourceConfig​(String... asPackages)
        Construct an instance of ResourceConfig that initialize Coherence predefined properties and searches for root resource classes and providers in the specified packages.
        Parameters:
        asPackages - an array of package names to be scanned for root resource classes and providers. If null or an empty array is provided, the Coherence predefined root resource and providers will be used.
    • Method Detail

      • registerRootResource

        protected void registerRootResource()
        Register the default Coherence REST root resource class.
      • registerProviders

        protected void registerProviders()
        Register the default Coherence REST providers.
      • registerContainerRequestFilters

        protected void registerContainerRequestFilters()
        Register the predefined Coherence REST container request filters.
      • registerContainerResponseFilters

        protected void registerContainerResponseFilters()
        Register the predefined Coherence REST container response filters.
      • registerResourceFilterFactories

        protected void registerResourceFilterFactories()
        Register the predefined Coherence REST resource filter factories.
      • isRunningInContainer

        protected boolean isRunningInContainer()
        Return whether REST API is run inside the container (true) or standalone (false).
        Returns:
        whether REST API is run inside the container (true) or standalone (false)
      • getExtensionsMap

        protected static Map<String,​javax.ws.rs.core.MediaType> getExtensionsMap()
        Construct a map with URL suffix to media type mappings.

        Supported values are ".txt", ".bin", ".xml", ".json".

        Returns:
        URL suffix to media type mappings