/** * <p>This method will store the argument * <code>factoryName/implName</code> mapping in such a way that * {@link #getFactory} will find this mapping when searching for a * match.</p> * <p/> * <p>This method has no effect if <code>getFactory()</code> has * already been called looking for a factory for this * <code>factoryName</code>.</p> * <p/> * <p>This method can be used by implementations to store a factory * mapping while parsing the Faces configuration file</p> * * @throws IllegalArgumentException if <code>factoryName</code> does not * identify a standard JavaServer Faces factory name * @throws NullPointerException if <code>factoryname</code> * is null */ public static void setFactory(String factoryName, String implName) { validateFactoryName(factoryName); // Identify the web application class loader ClassLoader classLoader = getClassLoader(); FactoryManager manager = FACTORIES_CACHE.getApplicationFactoryManager(classLoader); manager.addFactory(factoryName, implName); }
/** * <p>Create (if necessary) and return a per-web-application instance of * the appropriate implementation class for the specified JavaServer Faces * factory class, based on the discovery algorithm described in the * class description.</p> * * @param factoryName Fully qualified name of the JavaServer Faces factory * for which an implementation instance is requested * @throws FacesException if the web application class loader * cannot be identified * @throws FacesException if an instance of the configured factory * implementation class cannot be loaded * @throws FacesException if an instance of the configured factory * implementation class cannot be instantiated * @throws IllegalArgumentException if <code>factoryName</code> does not * identify a standard JavaServer Faces factory name * @throws IllegalStateException if there is no configured factory * implementation class for the specified factory name * @throws NullPointerException if <code>factoryname</code> * is null */ public static Object getFactory(String factoryName) throws FacesException { validateFactoryName(factoryName); // Identify the web application class loader ClassLoader classLoader = getClassLoader(); FactoryManager manager = FACTORIES_CACHE.getApplicationFactoryManager(classLoader); return manager.getFactory(classLoader, factoryName); }
/** * <p>This method will store the argument * <code>factoryName/implName</code> mapping in such a way that * {@link #getFactory} will find this mapping when searching for a * match.</p> * <p/> * <p>This method has no effect if <code>getFactory()</code> has * already been called looking for a factory for this * <code>factoryName</code>.</p> * <p/> * <p>This method can be used by implementations to store a factory * mapping while parsing the Faces configuration file</p> * * @throws IllegalArgumentException if <code>factoryName</code> does not * identify a standard JavaServer Faces factory name * @throws NullPointerException if <code>factoryname</code> * is null */ public static void setFactory(String factoryName, String implName) { validateFactoryName(factoryName); // Identify the web application class loader ClassLoader classLoader = getClassLoader(); FactoryManager manager = FACTORIES_CACHE.getApplicationFactoryManager(classLoader); manager.addFactory(factoryName, implName); }
throws FacesException { validateFactoryName(factoryName);