Class DefaultResourceConfig
java.lang.Object
jakarta.ws.rs.core.Application
org.glassfish.jersey.server.ResourceConfig
com.tangosol.coherence.rest.server.DefaultResourceConfig
- All Implemented Interfaces:
com.tangosol.coherence.http.HttpApplication
,jakarta.ws.rs.core.Configurable<org.glassfish.jersey.server.ResourceConfig>
,jakarta.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
ConstructorDescriptionDefault 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
Modifier and TypeMethodDescriptionConstruct a map with URL suffix to media type mappings.protected boolean
Return whether REST API is run inside the container (true) or standalone (false).protected void
Register the predefined Coherence REST container request filters.protected void
Register the predefined Coherence REST container response filters.protected void
Register the default Coherence REST providers.protected void
Register the predefined Coherence REST resource filter factories.protected void
Register the default Coherence REST root resource class.toString()
Methods inherited from class org.glassfish.jersey.server.ResourceConfig
addProperties, files, files, forApplication, forApplicationClass, forApplicationClass, getApplication, getApplicationName, getApplicationPath, 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.tangosol.coherence.http.HttpApplication
configure, getPath
-
Constructor Details
-
DefaultResourceConfig
public DefaultResourceConfig()Default constructor. -
DefaultResourceConfig
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
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 Details
-
toString
-
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
Construct a map with URL suffix to media type mappings.Supported values are ".txt", ".bin", ".xml", ".json".
- Returns:
- URL suffix to media type mappings
-