ehcache

net.sf.ehcache.jcache
Class JCacheFactory

java.lang.Object
  extended by net.sf.ehcache.jcache.JCacheFactory
All Implemented Interfaces:
net.sf.jsr107cache.CacheFactory

public class JCacheFactory
extends java.lang.Object
implements net.sf.jsr107cache.CacheFactory

A CacheFactory implementation for JCache. This factory uses ehcache in singleton CacheManager mode i.e. one per classloader.

Version:
$Id: JCacheFactory.java 522 2007-07-30 08:45:38Z gregluck $
Author:
Greg Luck

Constructor Summary
JCacheFactory()
           
 
Method Summary
 net.sf.jsr107cache.Cache createCache(java.util.Map environment)
          Creates a new implementation specific Cache object using the environment parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCacheFactory

public JCacheFactory()
Method Detail

createCache

public net.sf.jsr107cache.Cache createCache(java.util.Map environment)
                                     throws net.sf.jsr107cache.CacheException
Creates a new implementation specific Cache object using the environment parameters. The created cache is not accessible from the JCache CacheManager until it has been registered with the manager. Create caches are registered with a singleton ehcache CacheManager.

Specified by:
createCache in interface net.sf.jsr107cache.CacheFactory
Parameters:
environment - String values for the following properties: String name, int maxElementsInMemory, MemoryStoreEvictionPolicy memoryStoreEvictionPolicy (one of LFU, LRU or FIFO) boolean overflowToDisk, boolean eternal, long timeToLiveSeconds, long timeToIdleSeconds, boolean diskPersistent, long diskExpiryThreadIntervalSeconds, int maxElementsOnDisk, String cacheLoaderFactoryClassName Note that the following cannot be set using this factory method:
  1. diskStorePath - this is set on the CacheManager and ignored here
  2. RegisteredEventListeners - register any of these after cache creation
  3. BootstrapCacheLoader - not supported here
If you need this functionality create a JCache by decorating an Ehcache and put the resulting JCache in the manager.
Returns:
a newly created JCache registered in the singleton CacheManager
Throws:
net.sf.jsr107cache.CacheException

ehcache