com.github.jknack.handlebars.cache.ConcurrentMapTemplateCache Java Examples

The following examples show how to use com.github.jknack.handlebars.cache.ConcurrentMapTemplateCache. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HandlebarsTemplateService.java    From arcusplatform with Apache License 2.0 5 votes vote down vote up
private void init(String prefix, int cacheSize){
	LOGGER.info("Handlebars Template Service Initialization with a location of {} and cache size of {}",prefix,cacheSize);
	templateCache = new ConcurrentMapTemplateCache();		
	
	TemplateLoader loader=new IrisResourceLoader(prefix, cacheSize);
	handlebars=new Handlebars(loader)
		.with(templateCache)
		.registerHelper(EnumHelper.NAME, EnumHelper.INSTANCE)
		.registerHelper(IfEqualHelper.NAME, IfEqualHelper.INSTANCE)
		.registerHelpers(HandlebarsHelpersSource.class)
		.registerHelpers(StringHelpers.class)
		.registerHelper(PluralizeHelper.NAME, PluralizeHelper.INSTANCE);
}
 
Example #2
Source File: Templating.java    From StubbornJava with MIT License 4 votes vote down vote up
public Builder withCaching() {
    log.debug("Using caching handlebars");
    handlebars.with(new ConcurrentMapTemplateCache());
    return this;
}
 
Example #3
Source File: Templating.java    From StubbornJava with MIT License 4 votes vote down vote up
public Builder withCaching() {
    log.debug("Using caching handlebars");
    handlebars.with(new ConcurrentMapTemplateCache());
    return this;
}