Class RestConfig
- java.lang.Object
-
- com.tangosol.coherence.rest.config.RestConfig
-
public class RestConfig extends Object
The RestConfig class encapsulates information related to Coherence REST configuration.- Author:
- vp 2011.07.08
-
-
Field Summary
Fields Modifier and Type Field Description static String
DESCRIPTOR_NAME
The default name of the Coherence REST XML descriptor.static String
DESCRIPTOR_PROPERTY
The name of the system property that can be used to override the default Coherence REST configuration file "coherence-rest-config.xml".
-
Constructor Summary
Constructors Constructor Description RestConfig(XmlElement xmlConfig)
Construct an instance of RestConfig based on the specified XML element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure(XmlElement xmlConfig)
Configures this RestConfig instance using the specified XML element.static RestConfig
create()
Return a singleton instance of RestConfig based on the REST configuration descriptor.protected Collection<AggregatorConfig>
createAggregatorMap(XmlElement xml)
Create a collection of AggregatorConfig objects from the given XML configuration.protected Map<String,Class>
createMarshallerMap(XmlElement xml)
Create a map of REST marshaller classes keyed by media type from the given XML configuration.protected Collection<ProcessorConfig>
createProcessorMap(XmlElement xml)
Create a collection of ProcessorConfig objects from the given XML configuration.protected QueryConfig
createQueryConfig(XmlElement xml)
Create a map ofQueryConfig
objects from the given XML configuration.protected Collection<QueryEngineConfig>
createQueryEngines(XmlElement xml)
Create a collection ofQueryEngineConfig
objects from the given XML configuration.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.AggregatorRegistry
getAggregatorRegistry()
Return the configured aggregator registry.protected ClassLoader
getContextClassLoader()
Return the context class loader to use.MarshallerRegistry
getMarshallerRegistry()
Return the configured marshaller registry.ProcessorRegistry
getProcessorRegistry()
Return the configured processor registry.QueryEngineRegistry
getQueryEngineRegistry()
Return the configured query engine registry.Map<String,ResourceConfig>
getResources()
Return a map of configured resources, keyed by cache name or alias.
-
-
-
Field Detail
-
DESCRIPTOR_NAME
public static final String DESCRIPTOR_NAME
The default name of the Coherence REST XML descriptor.- See Also:
- Constant Field Values
-
DESCRIPTOR_PROPERTY
public static final String DESCRIPTOR_PROPERTY
The name of the system property that can be used to override the default Coherence REST configuration file "coherence-rest-config.xml".- See Also:
- Constant Field Values
-
-
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 ofQueryConfig
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 ofQueryEngineConfig
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
-
-