@Override
    public AbstractCache createCache(String name, long capacity, long expireAfterWrite,
            long expireAfterAccess, ICacheLoader cacheLoader) {
        String cacheName = buildCacheName(name);
        try {
            AbstractCache cache = cacheInstances.get(cacheName, new Callable<AbstractCache>() {
                @Override
                public AbstractCache call() throws Exception {
                    // check if custom cache settings exist
                    long cacheCapacity = capacity;
                    long cacheExpireAfterWrite = expireAfterWrite;
                    long cacheExpireAfterAccess = expireAfterAccess;

                    // yup, use "name" here (not "cacheName) is correct and
                    // intended!
                    Properties cacheProps = getCacheProperties(name);
                    if (cacheProps != null) {
                        try {
                            cacheCapacity = Long
                                    .parseLong(cacheProps.getProperty(CACHE_PROP_CAPACITY));
                        } catch (Exception e) {
                            cacheCapacity = capacity;
                        }
                        try {
                            cacheExpireAfterWrite = Long.parseLong(
                                    cacheProps.getProperty(CACHE_PROP_EXPIRE_AFTER_WRITE));
                        } catch (Exception e) {
                            cacheExpireAfterWrite = expireAfterWrite;
                        }
                        try {
                            cacheExpireAfterAccess = Long.parseLong(
                                    cacheProps.getProperty(CACHE_PROP_EXPIRE_AFTER_ACCESS));
                        } catch (Exception e) {
                            cacheExpireAfterAccess = expireAfterAccess;
                        }
                    }
                    return createAndInitCacheInstance(cacheName, cacheCapacity,
                            cacheExpireAfterWrite, cacheExpireAfterAccess, cacheLoader, cacheProps);
                }
            });
            return cache;
        } catch (ExecutionException e) {
            throw new RuntimeException(e);
        }
    }
@Override
    public AbstractCache createCache(String name, long capacity, long expireAfterWrite,
            long expireAfterAccess, ICacheLoader cacheLoader) {
        String cacheName = buildCacheName(name);
        try {
            AbstractCache cache = cacheInstances.get(cacheName, new Callable<AbstractCache>() {
                @Override
                public AbstractCache call() throws Exception {
                    
                    long cacheCapacity = capacity;
                    long cacheExpireAfterWrite = expireAfterWrite;
                    long cacheExpireAfterAccess = expireAfterAccess;

                    
                    
                    Properties cacheProps = getCacheProperties(name);
                    if (cacheProps != null) {
                        try {
                            cacheCapacity = Long
                                    .parseLong(cacheProps.getProperty(CACHE_PROP_CAPACITY));
                        } catch (Exception e) {
                            cacheCapacity = capacity;
                        }
                        try {
                            cacheExpireAfterWrite = Long.parseLong(
                                    cacheProps.getProperty(CACHE_PROP_EXPIRE_AFTER_WRITE));
                        } catch (Exception e) {
                            cacheExpireAfterWrite = expireAfterWrite;
                        }
                        try {
                            cacheExpireAfterAccess = Long.parseLong(
                                    cacheProps.getProperty(CACHE_PROP_EXPIRE_AFTER_ACCESS));
                        } catch (Exception e) {
                            cacheExpireAfterAccess = expireAfterAccess;
                        }
                    }
                    return createAndInitCacheInstance(cacheName, cacheCapacity,
                            cacheExpireAfterWrite, cacheExpireAfterAccess, cacheLoader, cacheProps);
                }
            });
            return cache;
        } catch (ExecutionException e) {
            throw new RuntimeException(e);
        }
    }
@ Override public AbstractCache createCache ( String name , long capacity , long expireAfterWrite , long expireAfterAccess , ICacheLoader cacheLoader ) { String cacheName = buildCacheName ( name ) ; try { AbstractCache cache = cacheInstances . get ( cacheName , new Callable < AbstractCache > ( ) { @ Override public AbstractCache call ( ) throws Exception { // check if custom cache settings exist long cacheCapacity = capacity ; long cacheExpireAfterWrite = expireAfterWrite ; long cacheExpireAfterAccess = expireAfterAccess ; // yup, use "name" here (not "cacheName) is correct and // intended! Properties cacheProps = getCacheProperties ( name ) ; if ( cacheProps != null ) { try { cacheCapacity = Long . parseLong ( cacheProps . getProperty ( CACHE_PROP_CAPACITY ) ) ; } catch ( Exception e ) { cacheCapacity = capacity ; } try { cacheExpireAfterWrite = Long . parseLong ( cacheProps . getProperty ( CACHE_PROP_EXPIRE_AFTER_WRITE ) ) ; } catch ( Exception e ) { cacheExpireAfterWrite = expireAfterWrite ; } try { cacheExpireAfterAccess = Long . parseLong ( cacheProps . getProperty ( CACHE_PROP_EXPIRE_AFTER_ACCESS ) ) ; } catch ( Exception e ) { cacheExpireAfterAccess = expireAfterAccess ; } } return createAndInitCacheInstance ( cacheName , cacheCapacity , cacheExpireAfterWrite , cacheExpireAfterAccess , cacheLoader , cacheProps ) ; } } ) ; return cache ; } catch ( ExecutionException e ) { throw new RuntimeException ( e ) ; } }
{@inheritDoc}
{