/** * <p> * Clears the template cache. * </p> */ public void clearCaches() { if (this.templateCache != null) { this.templateCache.clear(); } }
static Object getFromCache(final IEngineConfiguration configuration, final String input, final String type) { final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache(); if (cache != null) { return cache.get(new ExpressionCacheKey(type,input)); } } return null; }
static <V> void putIntoCache(final IEngineConfiguration configuration, final String input, final V value, final String type) { final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache(); if (cache != null) { cache.put(new ExpressionCacheKey(type,input), value); } } }
static <V> void removeFromCache(final IEngineConfiguration configuration, final String input, final String type) { final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { final ICache<ExpressionCacheKey,Object> cache = cacheManager.getExpressionCache(); if (cache != null) { cache.clearKey(new ExpressionCacheKey(type,input)); } } }
public Set<K> keySet() { return this.cache.keySet(); }
public V get(final K key, final ICacheEntryValidityChecker<? super K, ? super V> validityChecker) { return this.cache.get((K)prefix(key), validityChecker); }
public void put(final K key, final V value) { this.cache.put((K)prefix(key), value); }
/** * <p> * Clears a specific entry at the fragment cache. * </p> * * @param fragment the fragment to be cleared. */ public void clearFragmentCacheFor(final String fragment) { if (this.fragmentCache != null) { this.fragmentCache.clearKey(fragment); } }
public Set<K> keySet() { return this.cache.keySet(); }
public V get(final K key, final ICacheEntryValidityChecker<? super K, ? super V> validityChecker) { return this.cache.get((K)prefix(key), validityChecker); }
public void put(final K key, final V value) { this.cache.put((K)prefix(key), value); }
public void clearAllCaches() { final ICache<TemplateCacheKey, TemplateModel> templateCacheObj = getTemplateCache(); if (templateCacheObj != null) { templateCacheObj.clear(); } final ICache<ExpressionCacheKey, Object> expressionCacheObj = getExpressionCache(); if (expressionCacheObj != null) { expressionCacheObj.clear(); } final List<String> allSpecificCacheNamesObj = getAllSpecificCacheNames(); if (allSpecificCacheNamesObj != null) { for (final String specificCacheName : allSpecificCacheNamesObj) { final ICache<?,?> specificCache = getSpecificCache(specificCacheName); if (specificCache != null) { specificCache.clear(); } } } }
/** * <p> * Clears any existing entries for template of the specified * name at the template cache. * </p> * * @param templateName the name of the template whose entries have to be cleared. */ public void clearTemplateCacheFor(final String templateName) { if (this.templateCache != null) { this.templateCache.clearKey(templateName); } }
public V get(final K key) { return this.cache.get((K)prefix(key)); }
private static <V> void putIntoCache(final Configuration configuration, final String input, final V value, final String prefix) { final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { final ICache<String,Object> cache = cacheManager.getExpressionCache(); if (cache != null) { cache.put(prefix + input, value); } } }
/** * <p> * Clears the template cache. * </p> */ public void clearTemplateCache() { if (this.templateCache != null) { this.templateCache.clear(); } }