Gets the current Lifecycle instance from the LifecycleFactory
@param facesContext
@return
516257
private Lifecycle _getLifecycle(FacesContext facesContext)
    {
        LifecycleFactory factory = (LifecycleFactory) FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY);
        String id = facesContext.getExternalContext().getInitParameter(FacesServlet.LIFECYCLE_ID_ATTR);
        if (id == null)
        {
            id = LifecycleFactory.DEFAULT_LIFECYCLE;
        }
        return factory.getLifecycle(id);  
    }
92359
public static InterceptorFactory getInstance()
	{
		if (instance == null)
		{
			instance = new InterceptorFactory();
			OjbConfigurator.getInstance().configure(instance);
		}
		return instance;
	}
1252941
private <T> T getInstance(DatastoreType datastoreType, TransactionalCache.Mode cacheMode) {
        DatastoreId id = getDatastoreId(datastoreType);
        Object instance = cache.get(id, cacheMode);
        if (instance == null) {
            DynamicType<?> types = getTypes(datastoreType);
            instance = newInstance(id, datastoreType, types, cacheMode);
            if (TransactionalCache.Mode.READ.equals(cacheMode)) {
                instanceListenerService.postLoad(instance);
            }
        }
        return (T) instance;
    }
211899
@Override
    protected WeldCreationalContext<T> getCreationalContext(ManagedObjectInvocationContext<T> invocationContext, boolean nonContextual) throws ManagedObjectException {

        ManagedObjectContext moc;
        // for managed bean case, if invocation context is not null, use that
        if (invocationContext != null) {
            moc = invocationContext.getManagedObjectContext();

        } else {
            //otherwise, use the one created when creating this object(annotated with scope)
            moc = createContext(nonContextual);
        }
        @SuppressWarnings("unchecked")
        WeldCreationalContext<T> creationalContext = moc.getContextData(WeldCreationalContext.class);
        return creationalContext;
    }
750992
public static synchronized TypefaceCache getInstance(Context context) {
		if (sInstance == null)
			sInstance = new TypefaceCache((Application)context.getApplicationContext());
		return sInstance;
	}
1192474
public static final synchronized StateManager getInstance(Object context) {
		
		return (instance == null)? 
				(instance = new StateService(ContextUtils.asApplication(context))) :instance;
	}
818675
private static FacesInitializer _getFacesInitializerFromInitParam(ServletContext context)
    {
        String initializerClassName = context.getInitParameter(FACES_INITIALIZER_PARAM);
        if (initializerClassName != null)
        {
            try
            {
                // get Class object
                Class<?> clazz = ClassUtils.classForName(initializerClassName);
                if (!FacesInitializer.class.isAssignableFrom(clazz))
                {
                    throw new FacesException("Class " + clazz 
                            + " does not implement FacesInitializer");
                }
                
                // create instance and return it
                return (FacesInitializer) ClassUtils.newInstance(clazz);
            }
            catch (ClassNotFoundException cnfe)
            {
                throw new FacesException("Could not find class of specified FacesInitializer", cnfe);
            }
        }
        return null;
    }
1150901
public static ReflectionUtil getInstance() {

    if (instance == null) {
      ReflectionUtilImpl impl = null;
      synchronized (ReflectionUtilImpl.class) {
        if (instance == null) {
          impl = new ReflectionUtilImpl();
          instance = impl;
        }
      }
      if (impl != null) {
        // static access is generally discouraged, cyclic dependency forces this ugly initialization to
        // prevent deadlock.
        impl.initialize();
      }
    }
    return instance;
  }
904648
public static AnnotationUtilImpl getInstance() {

    if (instance == null) {
      synchronized (AnnotationUtilImpl.class) {
        if (instance == null) {
          AnnotationUtilImpl util = new AnnotationUtilImpl();
          util.setReflectionUtil(ReflectionUtilImpl.getInstance());
          instance = util;
        }
      }
    }
    return instance;
  }
1156310
private Facelet _getFacelet(FacesContext context, String viewId) throws IOException
    {
        // grab our FaceletFactory and create a Facelet
        FaceletFactory.setInstance(_faceletFactory);
        try
        {
            return _faceletFactory.getFacelet(context, viewId);
        }
        finally
        {
            FaceletFactory.setInstance(null);
        }
    }
383415
@Override
    public Client getClientInstance()
    {
        // if threadsafe recycle the same single instance; if not create a new
        // instance

        if (isThreadSafe())
        {
            logger.info("Returning threadsafe used client instance for persistence unit : " + persistenceUnit);
            if (client == null)
            {
                client = instantiateClient(persistenceUnit);
            }
        }
        else
        {
            logger.debug("Returning fresh client instance for persistence unit : " + persistenceUnit);
            // no need to hold a client reference.
            return instantiateClient(persistenceUnit);
        }

        return client;
    }
873076
private Object getSavedState(FacesContext facesContext)
    {
        Object encodedState = 
            facesContext.getExternalContext().getRequestParameterMap().get(STANDARD_STATE_SAVING_PARAM);
        if(encodedState==null || (((String) encodedState).length() == 0))
        {
            return null;
        }

        Object savedStateObject = _stateTokenProcessor.decode(facesContext, (String)encodedState);
        
        return savedStateObject;
    }
780447
public static SelectionCriteriaFactory getInstance() {

		if (_instance == null) {
			synchronized (SIDestinationAddressFactory.class) {
				try {
					Class cls = Class
							.forName(MESSAGE_SELECTOR_FACTORY_CLASS);
					_instance = (SelectionCriteriaFactory) cls.newInstance();
				} catch (Exception e) {
					 FFDCFilter.processException(e, "com.ibm.wsspi.sib.core.SelectionCriteriaFactory.createFactoryInstance", "100");
					 SibTr.error(tc,"UNABLE_TO_CREATE_FACTORY_CWSIB0001",e);

				}
			}
		}
		/* Otherwise, return the singleton */
		return _instance;
	}
496274
@Override
    public FacesConfig getMetaInfServicesFacesConfig(ExternalContext ectx)
    {
        try
        {
            org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl facesConfig
                    = new org.apache.myfaces.config.impl.digester.elements.FacesConfigImpl();
            org.apache.myfaces.config.impl.digester.elements.FactoryImpl factory
                    = new org.apache.myfaces.config.impl.digester.elements.FactoryImpl();
            
            facesConfig.addFactory(factory);
            
            for (String factoryName : FACTORY_NAMES)
            {
                List<String> classList = ServiceProviderFinderFactory.getServiceProviderFinder(ectx)
                        .getServiceProviderList(factoryName);
                
                for (String className : classList)
                {
                    if (log.isLoggable(Level.INFO))
                    {
                        log.info("Found " + factoryName + " factory implementation: " + className);
                    }

                    if (factoryName.equals(FactoryFinder.APPLICATION_FACTORY))
                    {
                        factory.addApplicationFactory(className);
                    } 
                    else if(factoryName.equals(FactoryFinder.EXCEPTION_HANDLER_FACTORY)) 
                    {
                        factory.addExceptionHandlerFactory(className);
                    } 
                    else if (factoryName.equals(FactoryFinder.EXTERNAL_CONTEXT_FACTORY))
                    {
                        factory.addExternalContextFactory(className);
                    } 
                    else if (factoryName.equals(FactoryFinder.FACES_CONTEXT_FACTORY))
                    {
                        factory.addFacesContextFactory(className);
                    } 
                    else if (factoryName.equals(FactoryFinder.LIFECYCLE_FACTORY))
                    {
                        factory.addLifecycleFactory(className);
                    } 
                    else if (factoryName.equals(FactoryFinder.RENDER_KIT_FACTORY))
                    {
                        factory.addRenderkitFactory(className);
                    } 
                    else if(factoryName.equals(FactoryFinder.TAG_HANDLER_DELEGATE_FACTORY)) 
                    {
                        factory.addTagHandlerDelegateFactory(className);
                    } 
                    else if (factoryName.equals(FactoryFinder.PARTIAL_VIEW_CONTEXT_FACTORY))
                    {
                        factory.addPartialViewContextFactory(className);
                    } 
                    else if(factoryName.equals(FactoryFinder.VISIT_CONTEXT_FACTORY)) 
                    {
                        factory.addVisitContextFactory(className);
                    } 
                    else if(factoryName.equals(FactoryFinder.VIEW_DECLARATION_LANGUAGE_FACTORY)) 
                    {
                        factory.addViewDeclarationLanguageFactory(className);
                    }
                    else if(factoryName.equals(FactoryFinder.FLASH_FACTORY)) 
                    {
                        factory.addFlashFactory(className);
                    }
                    else if(factoryName.equals(FactoryFinder.FLOW_HANDLER_FACTORY)) 
                    {
                        factory.addFlowHandlerFactory(className);
                    }
                    else if(factoryName.equals(FactoryFinder.CLIENT_WINDOW_FACTORY)) 
                    {
                        factory.addClientWindowFactory(className);
                    }
                    else if(factoryName.equals(FactoryFinder.FACELET_CACHE_FACTORY)) 
                    {
                        factory.addFaceletCacheFactory(className);
                    }
                    else
                    {
                        throw new IllegalStateException("Unexpected factory name " + factoryName);
                    }
                }
            }
            return facesConfig;
        }
        catch (Throwable e)
        {
            throw new FacesException(e);
        }
    }
729029
public static final synchronized ProfileManager getInstance(Object context) {
		
		return (instance == null)? 
				(instance = new ProfileService(ContextUtils.asApplication(context))) :instance;
	}
1356150
public FacesConfigFacetType<FacesConfigRendererType<T>> getOrCreateFacet()
   {
      List<Node> nodeList = childNode.get("facet");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FacesConfigFacetTypeImpl<FacesConfigRendererType<T>>(this, "facet", childNode, nodeList.get(0));
      }
      return createFacet();
   }
488218
private static SerializerFactory getInstance() {
    if (instance == null) {
      String className = JacksonSerializerFactory.class.getName();
      try {
        className = System.getProperty(SERIALIZER_FACTORY_CLASS_NAME);
      } catch (Exception e) {
      }

      if (className != null) {
        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        try {
          Class<?> clazz = loader.loadClass(className);
          instance = (SerializerFactory) clazz.newInstance();
        } catch (Exception e) {
          throw new IllegalArgumentException("Error instantiating serializer factory.");
        }
      } else {
        instance = new JacksonSerializerFactory();
      }
    }
    return instance;
  }