|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.faces.FactoryFinder
FactoryFinder implements the standard discovery algorithm for all factory objects specified in the JavaServer Faces APIs. For a given factory class name, a corresponding implementation class is searched for based on the following algorithm:
faces.properties file is visible as a resource
to the web application class loader for the calling application,
and this properties file contains property whose name matches the
name of the desired factory class, its value is assumed to be the
name of the factory implementation class to use.META-INF/services/{factory-class-name} resource
is visible to the web application class loader for the calling
application (typically as a result of being present in the manifest
of a JAR file), its first line is read and assumed to be the
name of the factory implementation class to use.Once the name of the factory implementation class is located, the web application class loader for the calling application is requested to load this class, and a corresponding instance of the class will be created. A side effect of this rule is that each web application will receive its own instance of each factory class, whether the JavaServer Faces implementation is included within the web application or is made visible through the container's facilities for shared libraries.
Factory implementation classes must include a zero-arguments constructor in order to be successfully instantiated.
| Field Summary | |
static java.lang.String |
APPLICATION_FACTORY
The property name for the ApplicationFactory class name. |
static java.lang.String |
FACES_CONTEXT_FACTORY
The property name for the FacesContextFactory class name. |
static java.lang.String |
LIFECYCLE_FACTORY
The property name for the LifecycleFactory class name. |
static java.lang.String |
RENDER_KIT_FACTORY
The property name for the RenderKitFactory class name. |
static java.lang.String |
TREE_FACTORY
The property name for the TreeFactory class name. |
| Method Summary | |
static java.lang.Object |
getFactory(java.lang.String factoryName)
Create (if necessary) and return a per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class, based on the discovery algorithm described in the class description. |
static void |
releaseFactories()
Release any references to factory instances associated with the class loader for the calling web application. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String APPLICATION_FACTORY
The property name for the
ApplicationFactory class name.
public static final java.lang.String FACES_CONTEXT_FACTORY
The property name for the
FacesContextFactory class name.
public static final java.lang.String LIFECYCLE_FACTORY
The property name for the
LifecycleFactory class name.
public static final java.lang.String RENDER_KIT_FACTORY
The property name for the
RenderKitFactory class name.
public static final java.lang.String TREE_FACTORY
The property name for the
TreeFactory class name.
| Method Detail |
public static java.lang.Object getFactory(java.lang.String factoryName)
throws FacesException
Create (if necessary) and return a per-web-application instance of the appropriate implementation class for the specified JavaServer Faces factory class, based on the discovery algorithm described in the class description.
factoryName - Fully qualified name of the JavaServer Faces factory
for which an implementation instance is requested
FacesException - if the web application class loader
cannot be identified
FacesException - if an instance of the configured factory
implementation class cannot be loaded
FacesException - if an instance of the configured factory
implementation class cannot be instantiated
java.lang.IllegalArgumentException - if factoryName does not
identify a standard JavaServer Faces factory name
java.lang.IllegalStateException - if there is no configured factory
implementation class for the specified factory name
java.lang.NullPointerException - if factoryname
is null
public static void releaseFactories()
throws FacesException
Release any references to factory instances associated with the class loader for the calling web application. This method should be called as apart of web application shutdown in a container where the JavaServer Faces API classes are part of the container itself, rather than being included inside the web application.
FacesException - if the web application class loader
cannot be identified
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||