/** * <p> * This method bootstraps JSF based on the parsed configuration resources. * </p> * * @param sc the <code>ServletContext</code> for the application that * requires initialization */ public void initialize(ServletContext sc) { if (!hasBeenInitialized(sc)) { initializedContexts.add(sc); try { CONFIG_PROCESSOR_CHAIN.process(sc, getConfigDocuments(sc)); } catch (Exception e) { // clear out any configured factories releaseFactories(); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.log(Level.FINE, "Unsanitized stacktrace from failed start...", e); } Throwable t = unwind(e); throw new ConfigurationException("CONFIGURATION FAILED! " + t.getMessage(), t); } } }
public static ConfigManager createInstance(ServletContext sc) { ConfigManager result = new ConfigManager(); sc.setAttribute(CONFIG_MANAGER_INSTANCE_KEY, result); return result; }
protected void processAnnotations(Class<? extends Annotation> annotationType) { FacesContext ctx = FacesContext.getCurrentInstance(); ApplicationAssociate associate = ApplicationAssociate.getInstance(ctx.getExternalContext()); AnnotationManager manager = associate.getAnnotationManager(); manager.applyConfigAnnotations(ctx, annotationType, ConfigManager.getAnnotatedClasses(ctx).get(annotationType)); }
if (!hasBeenInitialized(servletContext)) { initializeConfigProcessers(servletContext, facesContext); ExecutorService executor = null; boolean validating = webConfig.isOptionEnabled(ValidateFacesConfigFiles); if (useThreads(servletContext)) { executor = createExecutorService(); getXMLDocuments(servletContext, getFacesConfigResourceProviders(), executor, validating), getProgrammaticDocuments(getConfigPopulators())); boolean isFaceletsDisabled = isFaceletsDisabled(webConfig, lastFacesConfigInfo); findAnnotations(facesDocuments, containerConnector, servletContext, facesContext, executor); ThreadContext threadContext = getThreadContext(containerConnector); Object parentWebContext = threadContext != null ? threadContext.getParentWebContext() : null; getXMLDocuments( servletContext, getFaceletConfigResourceProviders(), executor, validating)); releaseFactories();
ConfigManager configManager = ConfigManager.getInstance(context); if (configManager == null) { configManager = ConfigManager.createInstance(context); if (configManager.hasBeenInitialized(context)) { return; configManager.destroy(context, initContext); ConfigManager.removeInstance(context); InitFacesContext.cleanupInitMaps(context); configManager.initialize(context, initContext); configManager.publishPostConfigEvent();
if (!hasBeenInitialized(sc)) { initializedContexts.add(sc); initializeConfigProcessers(sc); ExecutorService executor = null; try { WebConfiguration webConfig = WebConfiguration.getInstance(sc); boolean validating = webConfig.isOptionEnabled(ValidateFacesConfigFiles); if (useThreads(sc)) { executor = createExecutorService(); getConfigDocuments(sc, getFacesConfigResourceProviders(), executor, validating); facesDocuments = sortDocuments(facesDocuments, lastFacesConfigInfo); InitFacesContext context = (InitFacesContext) FacesContext.getCurrentInstance(); isFaceletsDisabled(webConfig, lastFacesConfigInfo); if (executor != null) { annotationScan = executor.submit(new AnnotationScanTask(sc, context, taskMetadata)); pushTaskToContext(sc, annotationScan); } else { annotationScan = pushTaskToContext(sc, annotationScan); if (!isFaceletsDisabled) {
ConfigManager configManager = ConfigManager.getInstance(servletContext); configManager.destroy(servletContext, initContext); ConfigManager.removeInstance(servletContext); } else { if (LOGGER.isLoggable(SEVERE)) { ConfigManager configManager = ConfigManager.createInstance(servletContext); if (null != configManager) { configManager.initialize(servletContext, initContext); } else { LOGGER.log(SEVERE, "Unexpected state during reload: no ConfigManager instance in current ServletContext but one is expected to exist.");
ServletContext context = sce.getServletContext(); ConfigManager configManager = ConfigManager.getInstance(context); if (configManager == null || !configManager.hasBeenInitialized(context)) { return; configManager.destroy(context, initContext); ConfigManager.removeInstance(context); FactoryFinder.releaseFactories(); ReflectionUtils.clearCache(Thread.currentThread().getContextClassLoader());
ConfigManager configManager = ConfigManager.getInstance(); if (configManager.hasBeenInitialized(context)) { return; initScripting(); configManager.initialize(context); initConfigMonitoring(context);
ApplicationAssociate.setCurrentInstance(null); ConfigManager.getInstance().destory(sc); initContext.release(); ReflectionUtils.clearCache(Thread.currentThread().getContextClassLoader()); ConfigManager configManager = ConfigManager.getInstance(); configManager.initialize(sc);
/** * <p> * This method will remove any information about the application. * </p> * @param sc the <code>ServletContext</code> for the application that * needs to be removed */ public void destory(ServletContext sc) { releaseFactories(); initializedContexts.remove(sc); }
ApplicationAssociate.setCurrentInstance(null); ConfigManager.getInstance().destory(context); FactoryFinder.releaseFactories(); initContext.release();
if (useThreads(sc)) { executor = Executors.newFixedThreadPool(NUMBER_OF_TASK_THREADS);
if (!hasBeenInitialized(servletContext)) { initializeConfigProcessers(servletContext, facesContext); ExecutorService executor = null; boolean validating = webConfig.isOptionEnabled(ValidateFacesConfigFiles); if (useThreads(servletContext)) { executor = createExecutorService(); getXMLDocuments(servletContext, getFacesConfigResourceProviders(), executor, validating), getProgrammaticDocuments(getConfigPopulators())); boolean isFaceletsDisabled = isFaceletsDisabled(webConfig, lastFacesConfigInfo); findAnnotations(facesDocuments, containerConnector, servletContext, facesContext, executor); ThreadContext threadContext = getThreadContext(containerConnector); Object parentWebContext = threadContext != null ? threadContext.getParentWebContext() : null; getXMLDocuments( servletContext, getFaceletConfigResourceProviders(), executor, validating)); releaseFactories();
ConfigManager configManager = ConfigManager.getInstance(context); if (null == configManager) { configManager = ConfigManager.createInstance(context); if (configManager.hasBeenInitialized(context)) { return; configManager.destroy(context); ConfigManager.removeInstance(context); InitFacesContext.cleanupInitMaps(context); return; configManager.initialize(context); if (shouldInitConfigMonitoring()) { initConfigMonitoring(context); configManager.publishPostConfigEvent();
ConfigManager configManager = ConfigManager.getInstance(servletContext); configManager.destroy(servletContext, initContext); ConfigManager.removeInstance(servletContext); } else { if (LOGGER.isLoggable(SEVERE)) { ConfigManager configManager = ConfigManager.createInstance(servletContext); if (null != configManager) { configManager.initialize(servletContext, initContext); } else { LOGGER.log(SEVERE, "Unexpected state during reload: no ConfigManager instance in current ServletContext but one is expected to exist.");
ServletContext context = sce.getServletContext(); ConfigManager configManager = ConfigManager.getInstance(context); if (configManager == null || !configManager.hasBeenInitialized(context)) { return; configManager.destroy(context, initContext); ConfigManager.removeInstance(context); FactoryFinder.releaseFactories(); ReflectionUtils.clearCache(Thread.currentThread().getContextClassLoader());
if (!hasBeenInitialized(servletContext)) { initializeConfigProcessers(servletContext, facesContext); ExecutorService executor = null; boolean validating = webConfig.isOptionEnabled(ValidateFacesConfigFiles); if (useThreads(servletContext)) { executor = createExecutorService(); getXMLDocuments(servletContext, getFacesConfigResourceProviders(), executor, validating), getProgrammaticDocuments(getConfigPopulators())); findAnnotations(facesDocuments, containerConnector, servletContext, facesContext, executor); ClassLoader parentContextClassLoader = Thread.currentThread().getContextClassLoader(); ThreadContext threadContext = getThreadContext(containerConnector); Object parentWebContext = threadContext != null ? threadContext.getParentWebContext() : null; getXMLDocuments( servletContext, getFaceletConfigResourceProviders(), executor, validating)); } catch (Exception e) { releaseFactories();
ConfigManager configManager = ConfigManager.getInstance(context); if (configManager == null) { configManager = ConfigManager.createInstance(context); if (configManager.hasBeenInitialized(context)) { return; configManager.destroy(context, initContext); ConfigManager.removeInstance(context); InitFacesContext.cleanupInitMaps(context); configManager.initialize(context, initContext); configManager.publishPostConfigEvent();
ConfigManager configManager = ConfigManager.getInstance(servletContext); configManager.destroy(servletContext, initContext); ConfigManager.removeInstance(servletContext); } else { if (LOGGER.isLoggable(SEVERE)) { ConfigManager configManager = ConfigManager.createInstance(servletContext); if (null != configManager) { configManager.initialize(servletContext, initContext); } else { LOGGER.log(SEVERE, "Unexpected state during reload: no ConfigManager instance in current ServletContext but one is expected to exist.");