Top Inners Fields Constructors Methods
javax.faces

pack-priv final Class CurrentThreadToServletContext

extends Object
Class Inheritance
Static Imports
com.sun.faces.util.Util.coalesce, .Util.getContextClassLoader2, .Util.isAnyNull, java.lang.System.currentTimeMillis, .System.identityHashCode, java.util.logging.Level.WARNING

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
pack-priv ConcurrentMap<CurrentThreadToServletContext.FactoryFinderCacheKey, FactoryFinderInstance>
private static final Logger
private AtomicBoolean
private AtomicBoolean
private final ServletContextFacesContextFactory

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
private boolean

Returns:

true if the currentKeyrent execution falls into the special initialization case.
detectSpecialInitializationCase
(FacesContext
the currentKeyrent FacesContext for this request
facesContext
)

This method is used to detect the following special initialization case.

pack-priv FactoryFinderInstance
pack-priv FactoryFinderInstance
getFactoryFinder(boolean create)

private FactoryFinderInstance
getFactoryFinder(ClassLoader classLoader, boolean create)

pack-priv Object
getFallbackFactory(FactoryFinderInstance brokenFactoryManager, String factoryName)

pack-priv Object
getServletContextForCurrentClassLoader()

Uses the FactoryManagerCacheKey system to find the ServletContext associated with the current ClassLoader, if any.

pack-priv void
pack-priv void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

factoryFinderMapback to summary
pack-priv ConcurrentMap<CurrentThreadToServletContext.FactoryFinderCacheKey, FactoryFinderInstance> factoryFinderMap
LOGGERback to summary
private static final Logger LOGGER
logNonNullFacesContextback to summary
private AtomicBoolean logNonNullFacesContext
logNullFacesContextback to summary
private AtomicBoolean logNullFacesContext
servletContextFacesContextFactoryback to summary
private final ServletContextFacesContextFactory servletContextFacesContextFactory

Constructor Detail

CurrentThreadToServletContextback to summary
pack-priv CurrentThreadToServletContext()

Method Detail

detectSpecialInitializationCaseback to summary
private boolean detectSpecialInitializationCase(FacesContext facesContext)

This method is used to detect the following special initialization case. IF no FactoryFinderInstance can be found for key, AND this call to getApplicationFactoryFinderInstance() *does* have a currentKeyrent FacesContext BUT a previous call to getApplicationFactoryFinderInstance *did not* have a currentKeyrent FacesContext

Parameters
facesContext:FacesContext

the currentKeyrent FacesContext for this request

Returns:boolean

true if the currentKeyrent execution falls into the special initialization case.

getFactoryFinderback to summary
pack-priv FactoryFinderInstance getFactoryFinder()
getFactoryFinderback to summary
pack-priv FactoryFinderInstance getFactoryFinder(boolean create)
getFactoryFinderback to summary
private FactoryFinderInstance getFactoryFinder(ClassLoader classLoader, boolean create)
getFallbackFactoryback to summary
pack-priv Object getFallbackFactory(FactoryFinderInstance brokenFactoryManager, String factoryName)
getServletContextForCurrentClassLoaderback to summary
pack-priv Object getServletContextForCurrentClassLoader()

Uses the FactoryManagerCacheKey system to find the ServletContext associated with the current ClassLoader, if any.

removeFactoryFinderback to summary
pack-priv void removeFactoryFinder()
resetSpecialInitializationCaseFlagsback to summary
pack-priv void resetSpecialInitializationCaseFlags()
javax.faces back to summary

private final Class CurrentThreadToServletContext.FactoryFinderCacheKey

extends Object
Class Inheritance
  • java.lang.Object
  • javax.faces.CurrentThreadToServletContext.FactoryFinderCacheKey

Field Summary

Modifier and TypeField and Description
private ClassLoader
classLoader

The ClassLoader that is active the first time this key is created.

private Object
context

The ServletContext corresponding to this marker/ClassLoader pair.

private static final String
private Long
marker

A marker that disambiguates the case when multiple web apps have the same web app ClassLoader but different ServletContext instances.

private static final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
private ClassLoader
pack-priv ClassLoader
pack-priv Object
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
private void
private void
private ClassLoader
resolveToFirstTimeUsedClassLoader(ClassLoader classLoaderToResolve, ExternalContext extContext)

Resolve the argument ClassLoader to be the ClassLoader that was passed in to the ctor the first time a FactoryManagerCacheKey was created for this web app.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

classLoaderback to summary
private ClassLoader classLoader

The ClassLoader that is active the first time this key is created. At startup time, this is assumed to be the web app ClassLoader

contextback to summary
private Object context

The ServletContext corresponding to this marker/ClassLoader pair.

INIT_TIME_CL_KEYback to summary
private static final String INIT_TIME_CL_KEY
markerback to summary
private Long marker

A marker that disambiguates the case when multiple web apps have the same web app ClassLoader but different ServletContext instances.

MARKER_KEYback to summary
private static final String MARKER_KEY

Constructor Detail

FactoryFinderCacheKeyback to summary
pack-priv FactoryFinderCacheKey(FacesContext facesContext, ClassLoader classLoaderIn, Map<CurrentThreadToServletContext.FactoryFinderCacheKey, FactoryFinderInstance> factoryMap)

Method Detail

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
obj:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
findMatchConsideringParentClassLoaderback to summary
private ClassLoader findMatchConsideringParentClassLoader(ClassLoader argumentClassLoader, ClassLoader currentKeyCL)
getClassLoaderback to summary
pack-priv ClassLoader getClassLoader()
getContextback to summary
pack-priv Object getContext()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
initFromApplicationMapback to summary
private void initFromApplicationMap(ExternalContext extContext, ClassLoader classLoaderIn)
initFromFactoryMapback to summary
private void initFromFactoryMap(ClassLoader classLoaderIn, Map<CurrentThreadToServletContext.FactoryFinderCacheKey, FactoryFinderInstance> factoryFinderMap)
resolveToFirstTimeUsedClassLoaderback to summary
private ClassLoader resolveToFirstTimeUsedClassLoader(ClassLoader classLoaderToResolve, ExternalContext extContext)

Resolve the argument ClassLoader to be the ClassLoader that was passed in to the ctor the first time a FactoryManagerCacheKey was created for this web app.