HHH-11471 - Add a createCache method

This commit is contained in:
Henri Tremblay 2017-02-08 17:11:38 +05:30 committed by Vlad Mihalcea
parent 57f156769b
commit 66cf8cb632
1 changed files with 5 additions and 1 deletions

View File

@ -187,7 +187,7 @@ public class JCacheRegionFactory implements RegionFactory {
final Cache<Object, Object> cache = cacheManager.getCache( regionName );
if ( cache == null ) {
try {
return cacheManager.createCache( regionName, newDefaultConfig( properties, metadata ) );
return createCache( regionName, properties, metadata );
}
catch ( CacheException e ) {
final Cache<Object, Object> existing = cacheManager.getCache( regionName );
@ -200,6 +200,10 @@ public class JCacheRegionFactory implements RegionFactory {
return cache;
}
protected Cache<Object, Object> createCache(String regionName, Properties properties, CacheDataDescription metadata) {
return cacheManager.createCache( regionName, newDefaultConfig( properties, metadata ) );
}
protected Configuration<Object, Object> newDefaultConfig(Properties properties, CacheDataDescription metadata) {
return new MutableConfiguration<Object, Object>();
}