Class HighConcurrencyTemplateCache
java.lang.Object
com.github.jknack.handlebars.cache.HighConcurrencyTemplateCache
- All Implemented Interfaces:
TemplateCache
A high concurrency template cache.
- Since:
- 0.11.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Remove all mappings from the cache.voidevict(TemplateSource source) Evict the mapping for this source from this cache if it is present.get(TemplateSource source, Parser parser) Return the value to which this cache maps the specified key.setReload(boolean reload) Turn on/off auto reloading of templates.
-
Constructor Details
-
HighConcurrencyTemplateCache
public HighConcurrencyTemplateCache()Creates a new HighConcurrencyTemplateCache.
-
-
Method Details
-
clear
public void clear()Description copied from interface:TemplateCacheRemove all mappings from the cache.- Specified by:
clearin interfaceTemplateCache
-
evict
Description copied from interface:TemplateCacheEvict the mapping for this source from this cache if it is present.- Specified by:
evictin interfaceTemplateCache- Parameters:
source- the source whose mapping is to be removed from the cache
-
get
Description copied from interface:TemplateCacheReturn the value to which this cache maps the specified key.- Specified by:
getin interfaceTemplateCache- Parameters:
source- source whose associated template is to be returned.parser- The Handlebars parser.- Returns:
- A template.
- Throws:
IOException- If input can't be parsed.
-
setReload
Description copied from interface:TemplateCacheTurn on/off auto reloading of templates. Auto reload is done usingTemplateSource.lastModified().- Specified by:
setReloadin interfaceTemplateCache- Parameters:
reload- True, for turning off template reload. Default is: false.- Returns:
- This template loader.
-