@Override public FacesContext getFacesContext(Object context, Object request, Object response, Lifecycle lifecycle) throws FacesException { FacesContext result = null; if (null != initContextServletContextMap && !initContextServletContextMap.isEmpty()) { ServletContext servletContext = (ServletContext) FactoryFinder.FACTORIES_CACHE.getServletContextForCurrentClassLoader(); if (null != servletContext) { for (Map.Entry<FacesContext, ServletContext> entry : initContextServletContextMap.entrySet()) { if (servletContext.equals(entry.getValue())) { result = entry.getKey(); break; } } } } return result; }
@SuppressWarnings("unused") private static void reInitializeFactoryManager() { FACTORIES_CACHE.resetSpecialInitializationCaseFlags(); }
FactoryFinderInstance getApplicationFactoryManager() { ClassLoader cl = getClassLoader(); FactoryFinderInstance result = getApplicationFactoryManager(cl, true); return result; }
/** * <p><span class="changed_modified_2_0">Release</span> any * references to factory instances associated with the class loader * for the calling web application. <span * class="changed_modified_2_0">This method must be called during of * web application shutdown.</span></p> * * @throws FacesException if the web application class loader * cannot be identified */ public static void releaseFactories() throws FacesException { synchronized(FACTORIES_CACHE) { if (!FACTORIES_CACHE.applicationMap.isEmpty()) { FactoryFinderInstance fm = FACTORIES_CACHE.getApplicationFactoryManager(); fm.releaseFactories(); } FACTORIES_CACHE.removeApplicationFactoryManager(); } }
/** * <p> * <span class="changed_modified_2_0">Release</span> any references to factory instances * associated with the class loader for the calling web application. * <span class="changed_modified_2_0">This method must be called during of web application * shutdown.</span> * </p> * * @throws FacesException if the web application class loader cannot be identified */ public static void releaseFactories() throws FacesException { synchronized (FACTORIES_CACHE) { if (!FACTORIES_CACHE.factoryFinderMap.isEmpty()) { FACTORIES_CACHE.getFactoryFinder().releaseFactories(); } FACTORIES_CACHE.removeFactoryFinder(); } }
void removeFactoryFinder() { ClassLoader classLoader = getContextClassLoader2(); FactoryFinderInstance factoryFinder = getFactoryFinder(classLoader, false); if (factoryFinder != null) { factoryFinder.clearInjectionProvider(); } FacesContext facesContext = servletContextFacesContextFactory.getFacesContextWithoutServletContextLookup(); boolean isSpecialInitializationCase = detectSpecialInitializationCase(facesContext); factoryFinderMap.remove(new FactoryFinderCacheKey(facesContext, classLoader, factoryFinderMap)); if (isSpecialInitializationCase) { resetSpecialInitializationCaseFlags(); } }
void removeApplicationFactoryManager() { ClassLoader cl = getClassLoader(); FactoryFinderInstance fm = this.getApplicationFactoryManager(cl, false); if (null != fm) { fm.clearInjectionProvider(); } FacesContext facesContext = servletContextFacesContextFactory.getFacesContextWithoutServletContextLookup(); boolean isSpecialInitializationCase = detectSpecialInitializationCase(facesContext); FactoryManagerCacheKey key = new FactoryManagerCacheKey(facesContext, cl, applicationMap); applicationMap.remove(key); if (isSpecialInitializationCase) { logNullFacesContext.set(false); logNonNullFacesContext.set(false); } }
LOGGER.log(Level.SEVERE, message); factory = FactoryFinder.FACTORIES_CACHE.getFallbackFactory(this, factoryName); if (null == factory) { message = rb.getString("severe.no_factory_backup_failed");
private FactoryFinderInstance getApplicationFactoryManager(ClassLoader cl, boolean create) { FacesContext facesContext = servletContextFacesContextFactory.getFacesContextWithoutServletContextLookup(); boolean isSpecialInitializationCase = detectSpecialInitializationCase(facesContext); FactoryManagerCacheKey key = new FactoryManagerCacheKey(facesContext, cl, applicationMap); FactoryFinderInstance result = applicationMap.get(key);
FactoryFinderInstance getFactoryFinder(boolean create) { return getFactoryFinder(getContextClassLoader2(), create); }
Object getFallbackFactory(FactoryFinderInstance brokenFactoryManager, String factoryName) { Object result = null; ClassLoader cl = getClassLoader(); for (Map.Entry<FactoryManagerCacheKey, FactoryFinderInstance> cur : applicationMap.entrySet()) { if (cur.getKey().getClassLoader().equals(cl) && !cur.getValue().equals(brokenFactoryManager)) { result = cur.getValue().getFactory(factoryName); if (null != result) { break; } } } return result; }
manager = FACTORIES_CACHE.getApplicationFactoryManager(false); } else { manager = FACTORIES_CACHE.getApplicationFactoryManager();
void removeFactoryFinder() { ClassLoader classLoader = getContextClassLoader2(); FactoryFinderInstance factoryFinder = getFactoryFinder(classLoader, false); if (factoryFinder != null) { factoryFinder.clearInjectionProvider(); } FacesContext facesContext = servletContextFacesContextFactory.getFacesContextWithoutServletContextLookup(); boolean isSpecialInitializationCase = detectSpecialInitializationCase(facesContext); factoryFinderMap.remove(new FactoryFinderCacheKey(facesContext, classLoader, factoryFinderMap)); if (isSpecialInitializationCase) { resetSpecialInitializationCaseFlags(); } }
void removeApplicationFactoryManager() { ClassLoader cl = getClassLoader(); FactoryFinderInstance fm = this.getApplicationFactoryManager(cl, false); if (null != fm) { fm.clearInjectionProvider(); } FacesContext facesContext = servletContextFacesContextFactory.getFacesContextWithoutServletContextLookup(); boolean isSpecialInitializationCase = detectSpecialInitializationCase(facesContext); FactoryManagerCacheKey key = new FactoryManagerCacheKey(facesContext, cl, applicationMap); applicationMap.remove(key); if (isSpecialInitializationCase) { logNullFacesContext.set(false); logNonNullFacesContext.set(false); } }
LOGGER.log(Level.SEVERE, message); factory = FactoryFinder.FACTORIES_CACHE.getFallbackFactory(this, factoryName); if (null == factory) { message = rb.getString("severe.no_factory_backup_failed");
private FactoryFinderInstance getApplicationFactoryManager(ClassLoader cl, boolean create) { FacesContext facesContext = servletContextFacesContextFactory.getFacesContextWithoutServletContextLookup(); boolean isSpecialInitializationCase = detectSpecialInitializationCase(facesContext); FactoryManagerCacheKey key = new FactoryManagerCacheKey(facesContext, cl, applicationMap); FactoryFinderInstance result = applicationMap.get(key);
/** * <p><span class="changed_modified_2_0">Release</span> any * references to factory instances associated with the class loader * for the calling web application. <span * class="changed_modified_2_0">This method must be called during of * web application shutdown.</span></p> * * @throws FacesException if the web application class loader * cannot be identified */ public static void releaseFactories() throws FacesException { synchronized(FACTORIES_CACHE) { if (!FACTORIES_CACHE.applicationMap.isEmpty()) { FactoryFinderInstance fm = FACTORIES_CACHE.getApplicationFactoryManager(); fm.releaseFactories(); } FACTORIES_CACHE.removeApplicationFactoryManager(); } }
FactoryFinderInstance getFactoryFinder() { return getFactoryFinder(getContextClassLoader2(), true); }
/** * <p> * <span class="changed_modified_2_0">Release</span> any references to factory instances * associated with the class loader for the calling web application. * <span class="changed_modified_2_0">This method must be called during of web application * shutdown.</span> * </p> * * @throws FacesException if the web application class loader cannot be identified */ public static void releaseFactories() throws FacesException { synchronized (FACTORIES_CACHE) { if (!FACTORIES_CACHE.factoryFinderMap.isEmpty()) { FACTORIES_CACHE.getFactoryFinder().releaseFactories(); } FACTORIES_CACHE.removeFactoryFinder(); } }
Object getFallbackFactory(FactoryFinderInstance brokenFactoryManager, String factoryName) { Object result = null; ClassLoader cl = getClassLoader(); for (Map.Entry<FactoryManagerCacheKey, FactoryFinderInstance> cur : applicationMap.entrySet()) { if (cur.getKey().getClassLoader().equals(cl) && !cur.getValue().equals(brokenFactoryManager)) { result = cur.getValue().getFactory(factoryName); if (null != result) { break; } } } return result; }