congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
FactoryFinderInstance
Code IndexAdd Tabnine to your IDE (free)

How to use
FactoryFinderInstance
in
javax.faces

Best Java code snippets using javax.faces.FactoryFinderInstance (Showing top 20 results out of 315)

origin: com.sun.faces/jsf-api

/**
 * <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) {
  FactoryFinderInstance manager =
     FACTORIES_CACHE.getApplicationFactoryManager();
  manager.addFactory(factoryName, implName);
}
origin: javax/javaee-web-api

FactoryFinderInstance() {
  lock = new ReentrantReadWriteLock(true);
  factories = new HashMap<>();
  savedFactoryNames = new HashMap<>();
  for (String name : FACTORY_NAMES) {
    factories.put(name, new ArrayList(4));  // NOPMD
  }
  copyInjectionProviderFromFacesContext();
  servletContextFinder = new ServletContextFacesContextFactory();
}
origin: eclipse-ee4j/mojarra

Object getFallbackFactory(FactoryFinderInstance brokenFactoryManager, String factoryName) {
  
  ClassLoader classLoader = getContextClassLoader2();
  for (Map.Entry<FactoryFinderCacheKey, FactoryFinderInstance> cur : factoryFinderMap.entrySet()) {
    if (cur.getKey().getClassLoader().equals(classLoader) && !cur.getValue().equals(brokenFactoryManager)) {
      Object factory = cur.getValue().getFactory(factoryName);
      if (factory != null) {
        return factory;
      }
    }
  }
  
  return null;
}
origin: com.sun.faces/jsf-api

  result = getImplGivenPreviousImpl(classLoader, factoryName,
     curImplClass, null);
List<String> fromServices = getImplNameFromServices(classLoader, factoryName);
if (fromServices != null) {
  for (String name : fromServices) {
    result = getImplGivenPreviousImpl(classLoader,
                     factoryName,
                     name,
  for (len = (implementations.size() - 1); 0 <= len; len--) {
    curImplClass = (String) implementations.remove(len);
    result = getImplGivenPreviousImpl(classLoader, factoryName,
       curImplClass, result);
origin: org.glassfish/javax.faces

void releaseFactories() {
  InjectionProvider provider = getInjectionProvider();
  
  if (provider != null) {
    lock.writeLock().lock();
    try {
      for (Entry<String, Object> entry : factories.entrySet()) {
        Object curFactory = entry.getValue();
        
        // If the current entry is not the injectionProvider itself
        // and the current entry has a non-null value
        // and the value is not a string...
        if (!INJECTION_PROVIDER_KEY.equals(entry.getKey()) && curFactory != null && !(curFactory instanceof String)) {
          try {
            provider.invokePreDestroy(curFactory);
          } catch (Exception ex) {
            logPreDestroyFail(entry.getValue(), ex);
          }
        }
      }
    } finally {
      factories.clear();
      lock.writeLock().unlock();
    }
  } else {
    LOGGER.log(SEVERE,
      "Unable to call @PreDestroy annotated methods because no InjectionProvider can be found. Does this container implement the Mojarra Injection SPI?");
  }
}
origin: org.glassfish/javax.faces

@SuppressWarnings("unchecked")
Object getFactory(String factoryName) {
  validateFactoryName(factoryName);
    Object factory = getImplementationInstance(getContextClassLoader2(), factoryName, (List<String>) factoryOrList);
      logNoFactory(factoryName);
      notNullFactory(factoryName, factory);
origin: javax.faces/javax.faces-api

Object getFactory(String factoryName) {
  validateFactoryName(factoryName);
  if (factoryName.equals(ServletContextFacesContextFactory.SERVLET_CONTEXT_FINDER_NAME)) {
    return servletContextFinder;
    ClassLoader cl = getClassLoader();
    Object factory = getImplementationInstance(cl, factoryName, (List) factoryOrList);
    if (factory == null) {
      ResourceBundle rb = LOGGER.getResourceBundle();
origin: javax/javaee-web-api

 (null != (factoryClass = getFactoryClass(factoryName)))) {
try {
  clazz = Class.forName(implName, false, classLoader);
InjectionProvider provider = getInjectionProvider();
if (null != provider) {
  try {
origin: org.glassfish/javax.faces

Class<?> factoryClass = getFactoryClass(factoryName);
injectImplementation(factoryImplClassName, factoryImplementation);
origin: com.sun.faces/jsf-api

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);
  }
}
origin: javax/javaee-web-api

void releaseFactories() {
  InjectionProvider provider = getInjectionProvider();
  if (null != provider) {
    lock.writeLock().lock();
origin: javax/javaee-web-api

FactoryFinderInstance newResult;
if (null != toCopy) {
  newResult = new FactoryFinderInstance(toCopy);
} else {
  newResult = new FactoryFinderInstance();
origin: org.glassfish/jakarta.faces

@SuppressWarnings("unchecked")
Object getFactory(String factoryName) {
  validateFactoryName(factoryName);
    Object factory = getImplementationInstance(getContextClassLoader2(), factoryName, (List<String>) factoryOrList);
      logNoFactory(factoryName);
      notNullFactory(factoryName, factory);
origin: javax/javaee-web-api

  result = getImplGivenPreviousImpl(classLoader, factoryName,
     curImplClass, null);
List<String> fromServices = getImplNameFromServices(classLoader, factoryName);
if (fromServices != null) {
  for (String name : fromServices) {
    result = getImplGivenPreviousImpl(classLoader,
                     factoryName,
                     name,
  for (len = (implementations.size() - 1); 0 <= len; len--) {
    curImplClass = (String) implementations.remove(len);
    result = getImplGivenPreviousImpl(classLoader, factoryName,
       curImplClass, result);
origin: javax/javaee-web-api

Object getFactory(String factoryName) {
  validateFactoryName(factoryName);
  if (factoryName.equals(ServletContextFacesContextFactory.SERVLET_CONTEXT_FINDER_NAME)) {
    return servletContextFinder;
    ClassLoader cl = getClassLoader();
    Object factory = getImplementationInstance(cl, factoryName, (List) factoryOrList);
    if (factory == null) {
      ResourceBundle rb = LOGGER.getResourceBundle();
origin: com.sun.faces/jsf-api

 (null != (factoryClass = getFactoryClass(factoryName)))) {
try {
  clazz = Class.forName(implName, false, classLoader);
InjectionProvider provider = getInjectionProvider();
if (null != provider) {
  try {
origin: eclipse-ee4j/mojarra

void releaseFactories() {
  InjectionProvider provider = getInjectionProvider();
  
  if (provider != null) {
    lock.writeLock().lock();
    try {
      for (Entry<String, Object> entry : factories.entrySet()) {
        Object curFactory = entry.getValue();
        
        // If the current entry is not the injectionProvider itself
        // and the current entry has a non-null value
        // and the value is not a string...
        if (!INJECTION_PROVIDER_KEY.equals(entry.getKey()) && curFactory != null && !(curFactory instanceof String)) {
          try {
            provider.invokePreDestroy(curFactory);
          } catch (Exception ex) {
            logPreDestroyFail(entry.getValue(), ex);
          }
        }
      }
    } finally {
      factories.clear();
      lock.writeLock().unlock();
    }
  } else {
    LOGGER.log(SEVERE,
      "Unable to call @PreDestroy annotated methods because no InjectionProvider can be found. Does this container implement the Mojarra Injection SPI?");
  }
}
origin: org.glassfish/jakarta.faces

Class<?> factoryClass = getFactoryClass(factoryName);
injectImplementation(factoryImplClassName, factoryImplementation);
origin: javax/javaee-web-api

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);
  }
}
origin: com.sun.faces/jsf-api

void releaseFactories() {
  InjectionProvider provider = getInjectionProvider();
  if (null != provider) {
    lock.writeLock().lock();
javax.facesFactoryFinderInstance

Most used methods

  • <init>
  • addFactory
  • clearInjectionProvider
  • copyInjectionProviderFromFacesContext
  • getFactory
  • getFactoryClass
  • getImplGivenPreviousImpl
    Implement the decorator pattern for the factory implementation. If previousImpl is non-null and
  • getImplNameFromServices
    Perform the logic to get the implementation class for the second step of FactoryFinder#getImplement
  • getImplementationInstance
    Load and return an instance of the specified implementation class using the following algorithm.
  • getInjectionProvider
  • releaseFactories
  • validateFactoryName
  • releaseFactories,
  • validateFactoryName,
  • getClassLoader,
  • injectImplementation,
  • logNoFactory,
  • logPreDestroyFail,
  • notNullFactory,
  • readLineFromStream

Popular in Java

  • Parsing JSON documents to java classes using gson
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now