Terracotta Ehcache 10.1 | Ehcache API Developer Guide | Configuring a CacheManager Using XML | The XML Schema Definition
 
The XML Schema Definition
The following schema elements are available when using an XML file for configuring a CacheManager at creation time:
<config> - root element
This is the root element of our XML configuration.
One <config> element in an XML file provides the definition for a CacheManager.
You can create multiple CacheManager instances using the same XML configuration file.
Advanced:
In contrast to the JSR-107 javax.cache.spi.CachingProvider, Ehcache does not maintain a registry of CacheManager instances.
<service>
<service> elements are extension points for specifying services managed by the CacheManager.
Each such Service defined in this way is managed with the same lifecycle as the CacheManager.
The Service.start is called during CacheManager.init processing.
The Service.stop method is called during CacheManager.close processing.
These Service instances can then be used by Cache instances managed by the CacheManager.
Note: JSR-107 uses this extension point of the XML configuration (and Ehcache's modular architecture). For more information see section The JSR-107 Provider.
<default-serializers>
A <default-serializers> element represents Serializers configured at CacheManager level. It is a collection of <serializer> elements that require a type and a fully qualified class name of the Serializer.
<default-copiers>
A <default-copiers> element represents Copiers configured at CacheManager level. It is a collection of <copier> elements that requires a type and a fully qualified class name of the Copier.
<persistence>
A <persistence> element that represents Persistence and that needs to be used when creating a PersistentCacheManager.
It requires the directory location where data will be stored on disk.
<cache>
A <cache> element represent a Cache instance that will be created and managed by the CacheManager.
Each <cache> requires the alias attribute, used at runtime to retrieve the corresponding Cache<K, V> instance using the org.ehcache.CacheManager.getCache(String, Class<K>, Class<V>) method.
The optional uses-template attribute references a <cache-template> element’s name attribute.
See the section XML Programmatic Parsing for more details.
Following nested elements are optionally available:
*<key-type>
the fully qualified class name (FQCN) of the keys (<K>) held in the Cache<K, V>; defaults to java.lang.Object
*<value-type>
FQCN of the values (<V>) held in the Cache; defaults to java.lang.Object
*<expiry>
control the expiry type and its parameters
*<eviction-advisor>
FQCN of a org.ehcache.config.EvictionAdvisor<K, V> implementation, defaults to null, i.e. none
*<integration>
configure a CacheLoaderWriter for a cache-through pattern
*<resources>
configure the tiers and their capacity. When using on-heap only, you can replace this element by the <heap> one.
<cache-template>
<cache-template> elements represent a uniquely named template for <cache> elements to inherit from.
This unique name is specified by using the mandatory name attribute.
A <cache> element that references a <cache-template> by its name using the uses-template attribute, will inherit all properties of the <cache-template>. A <cache> can override these properties as it needs.
A <cache-template> element may contain all the same child elements as a <cache> element.

Copyright © 2010-2019 | Software AG, Darmstadt, Germany and/or Software AG USA, Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors.
Innovation Release