The Web configuration for the API references a RestResourceRegistry
component that is configured with all of the provider classes and components for the framework, and all of the resource classes and components for the API. On startup, this component scans all of the registered pieces and builds internal metadata objects for each resource and endpoint. It can be accessed using a Dynamo Server Admin interface that displays all of the endpoint information for the API. Note that if multiple context and/or versions are supported, each must have its own configured registry component.
Note: All resource classes must have a class level RestResource
annotation to provide the ID of the resource. All sub-resource locator methods must have a method level subresourceLocator
annotation to provide the IDs of the sub-resources that the method may return.
The registry uses four main classes to track resources. These classes are the ResourceHolder
, ResourceSettings
, SubresourceLocatorSettings
and EndpointSettings
classes. ResourceHolders
contain all of the information for a single resource. It is a container of a set of ResourceSettings
. The ResourceSettings
object represents a single resource class or component, and is a container for one or more EndpointSettings
. The EndpointSettings
represents a single endpoint method and contains all of its information. The following is an example of a portion of a RestResourceRegistry.properties
file:
providerClassNames=\ atg.service.jaxrs.JAXRSContextPreMatchRequestFilter,\ atg.service.jaxrs.JAXRSContextPostMatchRequestFilter nucleusProviders=\ GenericExceptionMapper,\ JSONMessageBodyReader,\ JSONMessageBodyWriter,\ OracleJSONMessageBodyWriter,\ NotFoundExceptionMapper,\ CachePostMatchRequestFilter,\ CacheResponseFilter,\ CacheWriterInterceptor,\ hal/HALMessageBodyReader,\ hal/HALMessageBodyWriter,\ InvocationHandlerBinder,\ RestExceptionMapper #restResourceClasses= nucleusRestResources=\ /atg/dynamo/service/jaxrs/restresources/MetadataCatalogRestSubresource,\ /atg/dynamo/service/jaxrs/restresources/VersionRestResource/atg/jaxrs/test/ TestRootEndpoints