Class RestConfig


  • public class RestConfig
    extends Object
    The RestConfig class encapsulates information related to Coherence REST configuration.
    Author:
    vp 2011.07.08
    • Constructor Detail

      • RestConfig

        public RestConfig​(XmlElement xmlConfig)
        Construct an instance of RestConfig based on the specified XML element.
        Parameters:
        xmlConfig - the XML element that contains the configuration info
    • Method Detail

      • create

        public static RestConfig create()
        Return a singleton instance of RestConfig based on the REST configuration descriptor.

        NOTE: The default REST configuration descriptor "coherence-rest-config.xml" can be overridden with the "coherence.rest.config" system property.

        Returns:
        REST configuration
      • configure

        protected void configure​(XmlElement xmlConfig)
        Configures this RestConfig instance using the specified XML element.

        This method assumes that the given configuration has been validated against the coherence-rest-config.xsd schema.

        Parameters:
        xmlConfig - the XML element that contains the configuration info
      • createResourceMap

        protected Map<String,​ResourceConfig> createResourceMap​(XmlElement xml)
        Create a map of ResourceConfig keyed by cache name or alias (if defined) from the given XML configuration.
        Parameters:
        xml - the XML configuration
        Returns:
        a map of ResourceConfig keyed by cache name or alias
      • createMarshallerMap

        protected Map<String,​Class> createMarshallerMap​(XmlElement xml)
        Create a map of REST marshaller classes keyed by media type from the given XML configuration.
        Parameters:
        xml - the XML configuration
        Returns:
        a map of REST marshaller classes keyed by media type
      • createQueryConfig

        protected QueryConfig createQueryConfig​(XmlElement xml)
        Create a map of QueryConfig objects from the given XML configuration.
        Parameters:
        xml - the XML configuration
        Returns:
        a map of QueryConfigs, keyed by query name
      • createAggregatorMap

        protected Collection<AggregatorConfig> createAggregatorMap​(XmlElement xml)
        Create a collection of AggregatorConfig objects from the given XML configuration.
        Parameters:
        xml - the XML configuration
        Returns:
        a collection of AggregatorConfig objects
      • createProcessorMap

        protected Collection<ProcessorConfig> createProcessorMap​(XmlElement xml)
        Create a collection of ProcessorConfig objects from the given XML configuration.
        Parameters:
        xml - the XML configuration
        Returns:
        a collection of ProcessorConfig objects
      • createQueryEngines

        protected Collection<QueryEngineConfig> createQueryEngines​(XmlElement xml)
        Create a collection of QueryEngineConfig objects from the given XML configuration.
        Parameters:
        xml - the XML configuration
        Returns:
        a collection of QueryEngineConfig objects
      • getContextClassLoader

        protected ClassLoader getContextClassLoader()
        Return the context class loader to use.
        Returns:
        the context class loader to use
      • getResources

        public Map<String,​ResourceConfig> getResources()
        Return a map of configured resources, keyed by cache name or alias.
        Returns:
        map of configured resources
      • getAggregatorRegistry

        public AggregatorRegistry getAggregatorRegistry()
        Return the configured aggregator registry.
        Returns:
        aggregator registry
      • getProcessorRegistry

        public ProcessorRegistry getProcessorRegistry()
        Return the configured processor registry.
        Returns:
        processor registry
      • getMarshallerRegistry

        public MarshallerRegistry getMarshallerRegistry()
        Return the configured marshaller registry.
        Returns:
        marshaller registry
      • getQueryEngineRegistry

        public QueryEngineRegistry getQueryEngineRegistry()
        Return the configured query engine registry.
        Returns:
        query engine registry