public class HighConcurrencyTemplateCache extends Object implements TemplateCache
| Modifier | Constructor and Description |
|---|---|
|
HighConcurrencyTemplateCache()
Creates a new HighConcurrencyTemplateCache.
|
protected |
HighConcurrencyTemplateCache(ConcurrentMap<TemplateSource,Future<org.apache.commons.lang3.tuple.Pair<TemplateSource,Template>>> cache)
Creates a new HighConcurrencyTemplateCache.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Remove all mappings from the cache.
|
void |
evict(TemplateSource source)
Evict the mapping for this source from this cache if it is present.
|
Template |
get(TemplateSource source,
Parser parser)
Return the value to which this cache maps the specified key.
|
HighConcurrencyTemplateCache |
setReload(boolean reload)
Turn on/off auto reloading of templates.
|
protected HighConcurrencyTemplateCache(ConcurrentMap<TemplateSource,Future<org.apache.commons.lang3.tuple.Pair<TemplateSource,Template>>> cache)
cache - The concurrent map cache. Required.public HighConcurrencyTemplateCache()
public void clear()
TemplateCacheclear in interface TemplateCachepublic void evict(TemplateSource source)
TemplateCacheevict in interface TemplateCachesource - the source whose mapping is to be removed from the cachepublic Template get(TemplateSource source, Parser parser) throws IOException
TemplateCacheget in interface TemplateCachesource - source whose associated template is to be returned.parser - The Handlebars parser.IOException - If input can't be parsed.public HighConcurrencyTemplateCache setReload(boolean reload)
TemplateCacheTemplateSource.lastModified().setReload in interface TemplateCachereload - True, for turning off template reload. Default is: false.Copyright © 2022. All rights reserved.