Source:
private <K, V> org.ehcache.config.CacheConfiguration<K, V> toEhcacheConfig(String cacheName, CompleteConfiguration<K, V> jsr107Config, CacheResources<K, V> cacheResources, Eh107Expiry<K, V> expiry) throws InstantiationException, IllegalAccessException, ClassNotFoundException { CacheConfigurationBuilder<K, V> builder = null; String cacheTemplate = getCacheTemplateName(cacheName); if (cacheTemplate != null) { if (ehConfig instanceof XmlConfiguration) { builder = ((XmlConfiguration) ehConfig).newCacheConfigurationBuilderFromTemplate(cacheTemplate, jsr107Config.getKeyType(), jsr107Config.getValueType()); } } if (builder == null) { builder = CacheConfigurationBuilder.newCacheConfigurationBuilder(); } builder = builder.withExpiry(expiry); OnHeapStoreServiceConfig onHeapStoreServiceConfig = builder.getExistingServiceConfiguration(OnHeapStoreServiceConfig.class); if (onHeapStoreServiceConfig == null) { builder.addServiceConfig(new OnHeapStoreServiceConfig().storeByValue(jsr107Config.isStoreByValue())); } else { onHeapStoreServiceConfig.storeByValue(jsr107Config.isStoreByValue()); } builder.addServiceConfig(new EhcacheServiceConfiguration().jsr107CompliantAtomics(ehcacheService.jsr107CompliantAtomics())); CacheLoader<? super K, ? extends V> cacheLoader = cacheResources.getCacheLoader(); if (cacheLoader != null && jsr107Config.isReadThrough()) { cacheLoaderFactory.registerJsr107Loader(cacheName, cacheLoader); } CacheWriter<? super K, ? super V> cacheWriter = cacheResources.getCacheWriter(); if (cacheWriter != null && jsr107Config.isWriteThrough()) { cacheWriterFactory.registerJsr107Loader(cacheName, cacheWriter); } return builder.buildConfig(jsr107Config.getKeyType(), jsr107Config.getValueType()); }

Target:
private <K, V> org.ehcache.config.CacheConfiguration<K, V> toEhcacheConfig(String cacheName, CompleteConfiguration<K, V> jsr107Config, CacheResources<K, V> cacheResources, Eh107Expiry<K, V> expiry) throws InstantiationException, IllegalAccessException, ClassNotFoundException { CacheConfigurationBuilder<K, V> builder = null; String cacheTemplate = getCacheTemplateName(cacheName); if (cacheTemplate != null) { if (ehConfig instanceof XmlConfiguration) { builder = ((XmlConfiguration) ehConfig).newCacheConfigurationBuilderFromTemplate(cacheTemplate, jsr107Config.getKeyType(), jsr107Config.getValueType()); } } if (builder == null) { builder = CacheConfigurationBuilder.newCacheConfigurationBuilder(); } builder = builder.withExpiry(expiry); OnHeapStoreServiceConfig onHeapStoreServiceConfig = builder.getExistingServiceConfiguration(OnHeapStoreServiceConfig.class); if (onHeapStoreServiceConfig == null) { builder.addServiceConfig(new OnHeapStoreServiceConfig().storeByValue(jsr107Config.isStoreByValue())); } else { onHeapStoreServiceConfig.storeByValue(jsr107Config.isStoreByValue()); } CacheLoader<? super K, ? extends V> cacheLoader = cacheResources.getCacheLoader(); if (cacheLoader != null && jsr107Config.isReadThrough()) { cacheLoaderFactory.registerJsr107Loader(cacheName, cacheLoader); } CacheWriter<? super K, ? super V> cacheWriter = cacheResources.getCacheWriter(); if (cacheWriter != null && jsr107Config.isWriteThrough()) { cacheWriterFactory.registerJsr107Loader(cacheName, cacheWriter); } return builder.buildConfig(jsr107Config.getKeyType(), jsr107Config.getValueType()); }