use of com.sun.faces.facelets.impl.DefaultResourceResolver in project mojarra by eclipse-ee4j.
the class ApplicationAssociate method createFaceletFactory.
protected DefaultFaceletFactory createFaceletFactory(FacesContext context, Compiler compiler, WebConfiguration webConfig) {
// refresh period
boolean isProduction = applicationImpl.getProjectStage() == Production;
String refreshPeriod;
if (webConfig.isSet(FaceletsDefaultRefreshPeriod)) {
refreshPeriod = webConfig.getOptionValue(FaceletsDefaultRefreshPeriod);
} else if (isProduction) {
refreshPeriod = "-1";
} else {
refreshPeriod = FaceletsDefaultRefreshPeriod.getDefaultValue();
}
long period = parseLong(refreshPeriod);
// resource resolver
DefaultResourceResolver resolver = new DefaultResourceResolver(applicationImpl.getResourceHandler());
FaceletCacheFactory cacheFactory = (FaceletCacheFactory) FactoryFinder.getFactory(FACELET_CACHE_FACTORY);
FaceletCache<?> cache = cacheFactory.getFaceletCache();
DefaultFaceletFactory toReturn = new DefaultFaceletFactory();
toReturn.init(context, compiler, resolver, period, cache);
return toReturn;
}
Aggregations