Package org.ehcache.xml.multi
Class XmlMultiConfiguration
java.lang.Object
org.ehcache.xml.multi.XmlMultiConfiguration
A collection of multiple Ehcache configurations.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAnXmlMultiConfigurationbuilder.static interfaceA variant configuration builder. -
Method Summary
Modifier and TypeMethodDescriptionReturn this configuration as an XMLDocument.Return this configuration as a rendered XML string.org.ehcache.config.Configurationconfiguration(String identity) Retrieve the singular configuration foridentity.org.ehcache.config.Configurationconfiguration(String identity, String variant) Retrieve the singular configuration foridentityandvariant.Create a builder seeded from an XML configuration.from(URL xml, ClassLoader classLoader) Create a builder seeded from an XML configuration using the supplier class loader.from(XmlMultiConfiguration config) Create a builder seeded from an existingXmlMultiConfiguration.Create an initially empty builder.Return the set of identities defined in this multi-configuration.toString()Return the set of variants defined for the given configuration.
-
Method Details
-
configuration
public org.ehcache.config.Configuration configuration(String identity) throws IllegalArgumentException Retrieve the singular configuration foridentity.If the given identity is associated with multiple variant configurations then an
IllegalStateExceptionwill be thrown. In this case theconfiguration(String, String)method must be used to select a specific variant.- Parameters:
identity- identity to retrieve- Returns:
- the configuration for the given identity;
nullif the identity is not in this configuration - Throws:
IllegalArgumentException- if the identity is associated with multiple variant configurations
-
configuration
Retrieve the singular configuration foridentityandvariant.If the given identity is associated only with a singular configuration then that configuration will be returned for all variants.
- Parameters:
identity- identity to retrievevariant- variant to retrieve- Returns:
- the configuration for the given identity;
nullif the identity is not in this configuration - Throws:
IllegalArgumentException- if the given variant does not exist
-
variants
Return the set of variants defined for the given configuration.If the given identity does not exist then an
IllegalArgumentExceptionis thrown. If the given identity is not variant-ed then an empty set is returned.- Returns:
- the set of variants; possibly empty.
- Throws:
IllegalArgumentException- if the identity does not exist
-
identities
Return the set of identities defined in this multi-configuration.- Returns:
- the defined identity set
-
asDocument
Return this configuration as an XMLDocument.- Returns:
- configuration XML DOM.
-
asRenderedDocument
Return this configuration as a rendered XML string.- Returns:
- configuration XML string
-
toString
-
from
Create a builder seeded from an XML configuration.Enclosed configurations will parsed using
XmlConfiguration(Document).- Parameters:
xml- xml seed resource- Returns:
- a builder seeded with the xml configuration
- See Also:
-
from
Create a builder seeded from an XML configuration using the supplier class loader.Enclosed configurations will parsed using
XmlConfiguration(Document, ClassLoader), which will be passed the classloader provided to this method.- Parameters:
xml- xml seed resourceclassLoader- loader for the cache managers- Returns:
- a builder seeded with the xml configuration
- See Also:
-
from
Create a builder seeded from an existingXmlMultiConfiguration.- Parameters:
config- existing configuration seed- Returns:
- a builder seeded with the xml configuration
-
fromNothing
Create an initially empty builder.- Returns:
- an empty builder
-