congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CurrentThreadToServletContext
Code IndexAdd Tabnine to your IDE (free)

How to use
CurrentThreadToServletContext
in
javax.faces

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

origin: com.sun.faces/jsf-api

@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;
}

origin: org.glassfish/javax.faces

@SuppressWarnings("unused")
private static void reInitializeFactoryManager() {
  FACTORIES_CACHE.resetSpecialInitializationCaseFlags();
}
origin: javax/javaee-web-api

FactoryFinderInstance getApplicationFactoryManager() {
  ClassLoader cl = getClassLoader();
  FactoryFinderInstance result = getApplicationFactoryManager(cl, true);
  return result;
}

origin: javax/javaee-web-api

/**
 * <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();
  }
}
origin: org.glassfish/jakarta.faces

/**
 * <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();
  }
}
origin: org.glassfish/javax.faces

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

  LOGGER.log(Level.SEVERE, message);
factory = FactoryFinder.FACTORIES_CACHE.getFallbackFactory(this, factoryName);
if (null == factory) {
  message = rb.getString("severe.no_factory_backup_failed");
origin: javax/javaee-web-api

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);
origin: org.glassfish/javax.faces

FactoryFinderInstance getFactoryFinder(boolean create) {
  return getFactoryFinder(getContextClassLoader2(), create);
}
origin: com.sun.faces/jsf-api

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

  manager = FACTORIES_CACHE.getApplicationFactoryManager(false);
} else {
  manager = FACTORIES_CACHE.getApplicationFactoryManager();
origin: org.glassfish/jakarta.faces

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

  LOGGER.log(Level.SEVERE, message);
factory = FactoryFinder.FACTORIES_CACHE.getFallbackFactory(this, factoryName);
if (null == factory) {
  message = rb.getString("severe.no_factory_backup_failed");
origin: com.sun.faces/jsf-api

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

/**
 * <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();
  }
}
origin: org.glassfish/javax.faces

FactoryFinderInstance getFactoryFinder() {
  return getFactoryFinder(getContextClassLoader2(), true);
}
origin: org.glassfish/javax.faces

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

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;
}
javax.facesCurrentThreadToServletContext

Most used methods

  • detectSpecialInitializationCase
    This method is used to detect the following special initialization case. IF no FactoryFinderInstance
  • getFallbackFactory
  • getServletContextForCurrentClassLoader
    Uses the FactoryManagerCacheKey system to find the ServletContext associated with the current ClassL
  • resetSpecialInitializationCaseFlags
  • getApplicationFactoryManager
  • getClassLoader
    Identify and return the class loader that is associated with the calling web application.
  • removeApplicationFactoryManager
  • getFactoryFinder
  • removeFactoryFinder

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Collectors (java.util.stream)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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