code: public static Object getFactory(String factoryName)
           throws FacesException {
  
          FactoryFinderInstance manager;
          // Bug 20458755: If the factory being requested is the special 
          // SERVLET_CONTEXT_FINDER, do not lazily create the FactoryFinderInstance.
          if (null != factoryName && factoryName.equals(ServletContextFacesContextFactory.SERVLET_CONTEXT_FINDER_NAME)) {
              manager = FACTORIES_CACHE.getApplicationFactoryManager(false);
          } else {
              manager = FACTORIES_CACHE.getApplicationFactoryManager();
          }
          Object result = null;
          if (null != manager) {
           result = manager.getFactory(factoryName);
          }
          return result;
  
      }
docs: <p><span class="changed_modified_2_0">Create</span> (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>
  
  <p class="changed_added_2_0">The standard injectionProvider and wrappers
  in JSF all implement the interface {@link FacesWrapper}.  If the
  returned <code>Object</code> is an implementation of one of the
  standard injectionProvider, it must be legal to cast it to an instance of
  <code>FacesWrapper</code> and call {@link
  FacesWrapper#getWrapped} on the instance.</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