congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
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

  • Parsing JSON documents to java classes using gson
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • getContentResolver (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • CodeWhisperer alternatives
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