org.apache.myfaces.config
Class FacesConfigurator

java.lang.Object
  extended by org.apache.myfaces.config.FacesConfigurator

public class FacesConfigurator
extends java.lang.Object

Configures everything for a given context. The FacesConfigurator is independent of the concrete implementations that lie behind FacesConfigUnmarshaller and FacesConfigDispenser.

Version:
$Revision: 931402 $ $Date: 2010-04-06 20:43:27 -0500 (Tue, 06 Apr 2010) $
Author:
Manfred Geiler (latest modification by $Author: lu4242 $)

Field Summary
static java.lang.String COMMONS_EL_PACKAGE_NAME
           
static java.lang.String JSP_API_PACKAGE_NAME
           
static java.lang.String MYFACES_API_PACKAGE_NAME
           
static java.lang.String MYFACES_IMPL_PACKAGE_NAME
           
static java.lang.String MYFACES_ORCHESTRA_PACKAGE_NAME
           
static java.lang.String MYFACES_ORCHESTRA12_PACKAGE_NAME
           
static java.lang.String MYFACES_TOBAGO_PACKAGE_NAME
           
static java.lang.String MYFACES_TOMAHAWK_PACKAGE_NAME
           
static java.lang.String MYFACES_TOMAHAWK_SANDBOX_PACKAGE_NAME
           
static java.lang.String MYFACES_TOMAHAWK_SANDBOX12_PACKAGE_NAME
           
static java.lang.String MYFACES_TOMAHAWK_SANDBOX15_PACKAGE_NAME
           
static java.lang.String MYFACES_TOMAHAWK12_PACKAGE_NAME
           
static java.lang.String MYFACES_TRINIDAD_API_PACKAGE_NAME
           
static java.lang.String MYFACES_TRINIDAD_IMPL_PACKAGE_NAME
           
static java.lang.String REGEX_LIBRARY
          Regular expression used to extract the jar information from the files present in the classpath.
 
Constructor Summary
FacesConfigurator(ExternalContext externalContext)
           
 
Method Summary
protected  java.util.List<FacesConfig> applySortingAlgorithm(java.util.List<FacesConfig> appConfigResources)
          Sort using topological ordering algorithm.
 void configure()
           
protected  void feedMetaInfServicesFactories()
          This method performs part of the factory search outlined in section 10.2.6.1.
protected  AnnotationConfigurator getAnnotationConfigurator()
           
protected  FacesConfigDispenser<FacesConfig> getDispenser()
           
protected  java.util.List<FacesConfig> getPostOrderedList(java.util.List<FacesConfig> appConfigResources)
          Pre Sort the appConfigResources, detecting cyclic references, so when sort process start, it is just necessary to traverse the preOrderedList once.
protected  RuntimeConfig getRuntimeConfig()
           
protected  FacesConfigUnmarshaller<? extends FacesConfig> getUnmarshaller()
           
protected  void logMetaInf()
          This method performs part of the factory search outlined in section 10.2.6.1.
protected  void orderAndFeedArtifacts(java.util.List<FacesConfig> appConfigResources, FacesConfig webAppConfig)
           
 void setAnnotationConfigurator(AnnotationConfigurator configurator)
           
 void setDispenser(FacesConfigDispenser<FacesConfig> dispenser)
           
 void setRuntimeConfig(RuntimeConfig runtimeConfig)
           
 void setUnmarshaller(FacesConfigUnmarshaller<? extends FacesConfig> unmarshaller)
           
protected  java.util.List<FacesConfig> sortRelativeOrderingList(java.util.List<FacesConfig> preOrderedList)
          Sort a list of pre ordered elements.
 void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MYFACES_API_PACKAGE_NAME

public static final java.lang.String MYFACES_API_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_IMPL_PACKAGE_NAME

public static final java.lang.String MYFACES_IMPL_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TOMAHAWK_PACKAGE_NAME

public static final java.lang.String MYFACES_TOMAHAWK_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TOMAHAWK12_PACKAGE_NAME

public static final java.lang.String MYFACES_TOMAHAWK12_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_ORCHESTRA_PACKAGE_NAME

public static final java.lang.String MYFACES_ORCHESTRA_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_ORCHESTRA12_PACKAGE_NAME

public static final java.lang.String MYFACES_ORCHESTRA12_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TRINIDAD_API_PACKAGE_NAME

public static final java.lang.String MYFACES_TRINIDAD_API_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TRINIDAD_IMPL_PACKAGE_NAME

public static final java.lang.String MYFACES_TRINIDAD_IMPL_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TOBAGO_PACKAGE_NAME

public static final java.lang.String MYFACES_TOBAGO_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TOMAHAWK_SANDBOX_PACKAGE_NAME

public static final java.lang.String MYFACES_TOMAHAWK_SANDBOX_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TOMAHAWK_SANDBOX12_PACKAGE_NAME

public static final java.lang.String MYFACES_TOMAHAWK_SANDBOX12_PACKAGE_NAME
See Also:
Constant Field Values

MYFACES_TOMAHAWK_SANDBOX15_PACKAGE_NAME

public static final java.lang.String MYFACES_TOMAHAWK_SANDBOX15_PACKAGE_NAME
See Also:
Constant Field Values

COMMONS_EL_PACKAGE_NAME

public static final java.lang.String COMMONS_EL_PACKAGE_NAME
See Also:
Constant Field Values

JSP_API_PACKAGE_NAME

public static final java.lang.String JSP_API_PACKAGE_NAME
See Also:
Constant Field Values

REGEX_LIBRARY

public static final java.lang.String REGEX_LIBRARY
Regular expression used to extract the jar information from the files present in the classpath.

The groups found with the regular expression are:

See Also:
Constant Field Values
Constructor Detail

FacesConfigurator

public FacesConfigurator(ExternalContext externalContext)
Method Detail

setUnmarshaller

public void setUnmarshaller(FacesConfigUnmarshaller<? extends FacesConfig> unmarshaller)
Parameters:
unmarshaller - the unmarshaller to set

getUnmarshaller

protected FacesConfigUnmarshaller<? extends FacesConfig> getUnmarshaller()
Returns:
the unmarshaller

setDispenser

public void setDispenser(FacesConfigDispenser<FacesConfig> dispenser)
Parameters:
dispenser - the dispenser to set

getDispenser

protected FacesConfigDispenser<FacesConfig> getDispenser()
Returns:
the dispenser

setAnnotationConfigurator

public void setAnnotationConfigurator(AnnotationConfigurator configurator)

getAnnotationConfigurator

protected AnnotationConfigurator getAnnotationConfigurator()

update

public void update()

configure

public void configure()
               throws FacesException
Throws:
FacesException

logMetaInf

protected void logMetaInf()
This method performs part of the factory search outlined in section 10.2.6.1.


feedMetaInfServicesFactories

protected void feedMetaInfServicesFactories()
This method performs part of the factory search outlined in section 10.2.6.1.


orderAndFeedArtifacts

protected void orderAndFeedArtifacts(java.util.List<FacesConfig> appConfigResources,
                                     FacesConfig webAppConfig)
                              throws FacesException
Throws:
FacesException

applySortingAlgorithm

protected java.util.List<FacesConfig> applySortingAlgorithm(java.util.List<FacesConfig> appConfigResources)
                                                     throws FacesException
Sort using topological ordering algorithm.

Parameters:
appConfigResources -
Returns:
Throws:
FacesException

sortRelativeOrderingList

protected java.util.List<FacesConfig> sortRelativeOrderingList(java.util.List<FacesConfig> preOrderedList)
Sort a list of pre ordered elements. It scans one by one the elements and apply the conditions mentioned by Ordering object if it is available. The preOrderedList ensures that application config resources referenced by other resources are processed first, making more easier the sort procedure.

Parameters:
preOrderedList -
Returns:

getPostOrderedList

protected java.util.List<FacesConfig> getPostOrderedList(java.util.List<FacesConfig> appConfigResources)
                                                  throws FacesException
Pre Sort the appConfigResources, detecting cyclic references, so when sort process start, it is just necessary to traverse the preOrderedList once. To do that, we just scan "before" and "after" lists for references, and then those references are traversed again, so the first elements of the pre ordered list does not have references and the next elements has references to the already added ones. The elements on the preOrderedList looks like this: [ no ordering elements , referenced elements ... more referenced elements, before others / after others non referenced elements]

Parameters:
appConfigResources -
Returns:
Throws:
FacesException

getRuntimeConfig

protected RuntimeConfig getRuntimeConfig()

setRuntimeConfig

public void setRuntimeConfig(RuntimeConfig runtimeConfig)


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.