/** * <p> * Returns the cache manager in effect. This manager is in charge of providing * the various caches needed by the system during its process. * </p> * <p> * By default, an instance of {@link org.thymeleaf.cache.StandardCacheManager} * is set. * </p> * * @return the cache manager */ public ICacheManager getCacheManager() { return this.configuration.getCacheManager(); }
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); } } }
private static Object getFromCache(final Configuration configuration, final String input, final String prefix) { final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { final ICache<String,Object> cache = cacheManager.getExpressionCache(); if (cache != null) { return cache.get(prefix + input); } } return null; }
public final List<Node> extractFragment(final Configuration configuration, final List<Node> nodes) { DOMSelector selector = null; ICache<String,Object> expressionCache = null; final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { expressionCache = cacheManager.getExpressionCache(); if (expressionCache != null) { selector = (DOMSelector) expressionCache.get(this.domSelectorCacheKey); } } if (selector == null) { selector = new DOMSelector(this.selectorExpression); if (expressionCache != null) { expressionCache.put(this.domSelectorCacheKey, selector); } } final List<Node> extraction = selector.select(nodes, this.referenceChecker); if (extraction == null || extraction.size() == 0) { return null; } return extraction; }
/** * <p> * This constructor should only be called directly for <p>testing purposes</p>. * </p> * * @param configuration the configuration being currently used. */ public TemplateRepository(final Configuration configuration) { super(); Validate.notNull(configuration, "Configuration object cannot be null"); final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager == null) { this.templateCache = null; this.fragmentCache = null; } else { this.templateCache = cacheManager.getTemplateCache(); this.fragmentCache = cacheManager.getFragmentCache(); } this.parsersByTemplateMode = new HashMap<String,ITemplateParser>(10, 1.0f); for (final ITemplateModeHandler handler : configuration.getTemplateModeHandlers()) { this.parsersByTemplateMode.put(handler.getTemplateModeName(), handler.getTemplateParser()); } }
Properties properties = null; final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { messagesCache = cacheManager.getMessageCache();
public final List<Node> extractFragment(final Configuration configuration, final List<Node> nodes) { DOMSelector selector = null; ICache<String,Object> expressionCache = null; final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { expressionCache = cacheManager.getExpressionCache(); if (expressionCache != null) { selector = (DOMSelector) expressionCache.get(this.domSelectorCacheKey); } } if (selector == null) { selector = new DOMSelector(this.selectorExpression); if (expressionCache != null) { expressionCache.put(this.domSelectorCacheKey, selector); } } final DOMSelector.INodeReferenceChecker referenceChecker = getReferenceChecker(configuration); final List<Node> extraction = selector.select(nodes, referenceChecker); if (extraction == null || extraction.size() == 0) { return null; } return extraction; }
ICache<String,Properties> messagesCache = null; final ICacheManager cacheManager = arguments.getConfiguration().getCacheManager(); if (cacheManager != null) { messagesCache = cacheManager.getMessageCache();
final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { cache = cacheManager.getExpressionCache();
final ICacheManager cacheManager = configuration.getCacheManager(); if (cacheManager != null) { cache = cacheManager.getExpressionCache();