public void update() { long refreshPeriod = (MyfacesConfig.getCurrentInstance(_externalContext).getConfigRefreshPeriod())*1000; if (refreshPeriod > 0){ long ttl = lastUpdate + refreshPeriod; if ((System.currentTimeMillis() > ttl) && (getLastModifiedTime() > ttl)) { try { purgeConfiguration(); } catch (NoSuchMethodException e) { log.error("Configuration objects do not support clean-up. Update aborted"); return; } catch (IllegalAccessException e) { log.fatal("Error during configuration clean-up" + e.getMessage()); } catch (InvocationTargetException e) { log.fatal("Error during configuration clean-up" + e.getMessage()); } configure(); } } }
/** * Configures this JSF application. It's required that every * FacesInitializer (i.e. every subclass) calls this method during * initialization. * * @param servletContext the current ServletContext * @param externalContext the current ExternalContext * @param expressionFactory the ExpressionFactory to use * @return the current runtime configuration */ protected RuntimeConfig buildConfiguration(ServletContext servletContext, ExternalContext externalContext, ExpressionFactory expressionFactory) { RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext); runtimeConfig.setExpressionFactory(expressionFactory); // And configure everything new FacesConfigurator(externalContext).configure(); validateFacesConfig(servletContext, externalContext); return runtimeConfig; }
/** * Configures this JSF application. It's required that every * FacesInitializer (i.e. every subclass) calls this method during * initialization. * * @param servletContext the current ServletContext * @param externalContext the current ExternalContext * @param expressionFactory the ExpressionFactory to use * @return the current runtime configuration */ protected RuntimeConfig buildConfiguration(ServletContext servletContext, ExternalContext externalContext, ExpressionFactory expressionFactory) { RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext); runtimeConfig.setExpressionFactory(expressionFactory); // And configure everything new FacesConfigurator(externalContext).configure(); validateFacesConfig(servletContext, externalContext); return runtimeConfig; }
/** * Configures this JSF application. It's required that every * FacesInitializer (i.e. every subclass) calls this method during * initialization. * * @param servletContext the current ServletContext * @param externalContext the current ExternalContext * @param expressionFactory the ExpressionFactory to use * @return the current runtime configuration */ protected RuntimeConfig buildConfiguration(ServletContext servletContext, ExternalContext externalContext, ExpressionFactory expressionFactory) { RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext); runtimeConfig.setExpressionFactory(expressionFactory); // And configure everything new FacesConfigurator(externalContext).configure(); validateFacesConfig(servletContext, externalContext); return runtimeConfig; }
/** * Configures this JSF application. It's required that every * FacesInitializer (i.e. every subclass) calls this method during * initialization. * * @param servletContext * the current ServletContext * @param externalContext * the current ExternalContext * @param expressionFactory * the ExpressionFactory to use * * @return the current runtime configuration */ protected RuntimeConfig buildConfiguration(ServletContext servletContext, ExternalContext externalContext, ExpressionFactory expressionFactory) { RuntimeConfig runtimeConfig = RuntimeConfig.getCurrentInstance(externalContext); runtimeConfig.setExpressionFactory(expressionFactory); ApplicationImpl.setInitializingRuntimeConfig(runtimeConfig); // And configure everything new FacesConfigurator(externalContext).configure(); validateFacesConfig(servletContext, externalContext); return runtimeConfig; }