* Create a cache given a cache configuration
*
* @param cacheConfiguration
*/
final Ehcache createCache(CacheConfiguration cacheConfiguration) {
Ehcache cache = new Cache(cacheConfiguration.name,
cacheConfiguration.maxElementsInMemory,
cacheConfiguration.memoryStoreEvictionPolicy,
cacheConfiguration.overflowToDisk,
getDiskStorePath(),
cacheConfiguration.eternal,
cacheConfiguration.timeToLiveSeconds,
cacheConfiguration.timeToIdleSeconds,
cacheConfiguration.diskPersistent,
cacheConfiguration.diskExpiryThreadIntervalSeconds,
null,
null,
cacheConfiguration.maxElementsOnDisk,
cacheConfiguration.diskSpoolBufferSizeMB);
RegisteredEventListeners listeners = cache.getCacheEventNotificationService();
registerCacheListeners(cacheConfiguration, listeners);
registerCacheExtensions(cacheConfiguration, cache);
BootstrapCacheLoader bootstrapCacheLoader = createBootstrapCacheLoader(
cacheConfiguration.getBootstrapCacheLoaderFactoryConfiguration());
cache.setBootstrapCacheLoader(bootstrapCacheLoader);
registerCacheLoaders(cacheConfiguration, cache);
cache = applyCacheExceptionHandler(cacheConfiguration, cache);
return cache;
}