Ehcache 2.10.8 | Product Documentation | Ehcache Developer Guide | Cache Decorators | Creating a Decorator | Declarative Creation
 
Declarative Creation
You can configure decorators directly in ehcache.xml. The decorators will be created and added to the CacheManager.
It accepts the name of a concrete class that extends net.sf.ehcache.constructs.CacheDecoratorFactory
The properties will be parsed according to the delimiter (default is comma ",") and passed to the concrete factory's createDecoratedEhcache(Ehcache cache, Properties properties) method along with the reference to the owning cache.
It is configured as per the following example:
<cacheDecoratorFactory
class="com.company.SomethingCacheDecoratorFactory"
properties="property1=36 ..." />
Note that decorators can be configured against the defaultCache. This is very useful for frameworks like Hibernate that add caches based on the configuration of the defaultCache.

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