com.sun.faces.application
Class ApplicationAssociate

java.lang.Object
  extended by com.sun.faces.application.ApplicationAssociate

public class ApplicationAssociate
extends java.lang.Object

Break out the things that are associated with the Application, but need to be present even when the user has replaced the Application instance.

For example: the user replaces ApplicationFactory, and wants to intercept calls to createValueExpression() and createMethodExpression() for certain kinds of expressions, but allow the existing application to handle the rest.


Constructor Summary
ApplicationAssociate(ApplicationImpl appImpl)
           
 
Method Summary
 void addManagedBeanFactory(java.lang.String managedBeanName, ManagedBeanFactory factory)
          Adds a new mapping of managed bean name to a managed bean factory instance.
 void addNavigationCase(ConfigNavigationCase navigationCase)
          Add a navigation case to the internal case list.
 void addResourceBundleBean(java.lang.String var, ResourceBundleBean bean)
           
static void clearInstance(javax.faces.context.ExternalContext externalContext)
           
 java.lang.Object createAndMaybeStoreManagedBeans(javax.faces.context.FacesContext context, java.lang.String managedBeanName)
          The managedBeanFactories HashMap has been populated with ManagedBeanFactoryImpl object keyed by the bean name.
 java.util.List<javax.el.ELResolver> getApplicationELResolvers()
           
 java.lang.String getContextName()
           
 java.util.List<javax.el.ELResolver> getELResolversFromFacesConfig()
           
 javax.el.ExpressionFactory getExpressionFactory()
           
 javax.el.CompositeELResolver getFacesELResolverForJsp()
           
 InjectionProvider getInjectionProvider()
           
static ApplicationAssociate getInstance(javax.faces.context.ExternalContext externalContext)
           
static ApplicationAssociate getInstance(javax.servlet.ServletContext context)
           
 JSFVersionTracker getJSFVersionTracker()
          Getter for property JSFVersionTracker.
 javax.faces.el.PropertyResolver getLegacyPRChainHead()
           
 javax.faces.el.PropertyResolver getLegacyPropertyResolver()
          Returns the PropertyResolver called through Application.getPropertyResolver()
 javax.faces.el.VariableResolver getLegacyVariableResolver()
          Returns the VariableResolver called through Application.getVariableResolver()
 javax.faces.el.VariableResolver getLegacyVRChainHead()
           
 java.util.Map<java.lang.String,ManagedBeanFactory> getManagedBeanFactoryMap()
           
 java.util.Map<java.lang.String,java.util.List<ConfigNavigationCase>> getNavigationCaseListMappings()
          Return a Map of navigation mappings loaded from the configuration system.
 java.util.TreeSet<java.lang.String> getNavigationWildCardList()
          Return all navigation mappings whose from-view-id contained a trailing "*".
 java.util.ResourceBundle getResourceBundle(javax.faces.context.FacesContext context, java.lang.String var)
           
 java.util.Map<java.lang.String,ResourceBundleBean> getResourceBundleBeanMap()
           
 void handlePreDestroy(java.lang.String beanName, java.lang.Object bean, ManagedBeanFactory.Scope scope)
          Attempts to look up a ManagedBeanFactory from the managedBeanFactoriesMap.
 boolean hasRequestBeenServiced()
           
 void setContextName(java.lang.String contextName)
           
 void setELResolversFromFacesConfig(java.util.List<javax.el.ELResolver> resolvers)
           
 void setExpressionFactory(javax.el.ExpressionFactory expressionFactory)
           
 void setFacesELResolverForJsp(javax.el.CompositeELResolver celr)
           
 void setJSFVersionTracker(JSFVersionTracker JSFVersionTracker)
          Setter for property JSFVersionTracker.
 void setLegacyPRChainHead(javax.faces.el.PropertyResolver resolver)
          This method is called by ConfigureListener and will contain any PropertyResolvers defined within faces-config configuration files.
 void setLegacyPropertyResolver(javax.faces.el.PropertyResolver resolver)
          Maintains the PropertyResolver called through Application.setPropertyResolver()
 void setLegacyVariableResolver(javax.faces.el.VariableResolver resolver)
          Maintains the PropertyResolver called through Application.setVariableResolver()
 void setLegacyVRChainHead(javax.faces.el.VariableResolver resolver)
          This method is called by ConfigureListener and will contain any VariableResolvers defined within faces-config configuration files.
 void setRequestServiced()
          Called by application code to indicate we've processed the first request to the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ApplicationAssociate

public ApplicationAssociate(ApplicationImpl appImpl)
Method Detail

getInstance

public static ApplicationAssociate getInstance(javax.faces.context.ExternalContext externalContext)

getInstance

public static ApplicationAssociate getInstance(javax.servlet.ServletContext context)

clearInstance

public static void clearInstance(javax.faces.context.ExternalContext externalContext)

setLegacyVRChainHead

public void setLegacyVRChainHead(javax.faces.el.VariableResolver resolver)
This method is called by ConfigureListener and will contain any VariableResolvers defined within faces-config configuration files.

Parameters:
resolver -

getLegacyVRChainHead

public javax.faces.el.VariableResolver getLegacyVRChainHead()

setLegacyPRChainHead

public void setLegacyPRChainHead(javax.faces.el.PropertyResolver resolver)
This method is called by ConfigureListener and will contain any PropertyResolvers defined within faces-config configuration files.

Parameters:
resolver -

getLegacyPRChainHead

public javax.faces.el.PropertyResolver getLegacyPRChainHead()

getFacesELResolverForJsp

public javax.el.CompositeELResolver getFacesELResolverForJsp()

setFacesELResolverForJsp

public void setFacesELResolverForJsp(javax.el.CompositeELResolver celr)

setELResolversFromFacesConfig

public void setELResolversFromFacesConfig(java.util.List<javax.el.ELResolver> resolvers)

getELResolversFromFacesConfig

public java.util.List<javax.el.ELResolver> getELResolversFromFacesConfig()

setExpressionFactory

public void setExpressionFactory(javax.el.ExpressionFactory expressionFactory)

getExpressionFactory

public javax.el.ExpressionFactory getExpressionFactory()

getApplicationELResolvers

public java.util.List<javax.el.ELResolver> getApplicationELResolvers()

getInjectionProvider

public InjectionProvider getInjectionProvider()

setContextName

public void setContextName(java.lang.String contextName)

getContextName

public java.lang.String getContextName()

setLegacyPropertyResolver

public void setLegacyPropertyResolver(javax.faces.el.PropertyResolver resolver)
Maintains the PropertyResolver called through Application.setPropertyResolver()


getLegacyPropertyResolver

public javax.faces.el.PropertyResolver getLegacyPropertyResolver()
Returns the PropertyResolver called through Application.getPropertyResolver()


setLegacyVariableResolver

public void setLegacyVariableResolver(javax.faces.el.VariableResolver resolver)
Maintains the PropertyResolver called through Application.setVariableResolver()


getLegacyVariableResolver

public javax.faces.el.VariableResolver getLegacyVariableResolver()
Returns the VariableResolver called through Application.getVariableResolver()


setRequestServiced

public void setRequestServiced()
Called by application code to indicate we've processed the first request to the application.


hasRequestBeenServiced

public boolean hasRequestBeenServiced()
Returns:
true if we've processed a request, otherwise false

addNavigationCase

public void addNavigationCase(ConfigNavigationCase navigationCase)
Add a navigation case to the internal case list. If a case list does not already exist in the case list map containing this case (identified by from-view-id), start a new list, add the case to it, and store the list in the case list map. If a case list already exists, see if a case entry exists in the list with a matching from-view-idfrom-action from-outcome combination. If there is suach an entry, overwrite it with this new case. Otherwise, add the case to the list.

Parameters:
navigationCase - the navigation case containing navigation mapping information from the configuration file.

getNavigationCaseListMappings

public java.util.Map<java.lang.String,java.util.List<ConfigNavigationCase>> getNavigationCaseListMappings()
Return a Map of navigation mappings loaded from the configuration system. The key for the returned Map is from-view-id, and the value is a List of navigation cases.

Returns:
Map the map of navigation mappings.

getNavigationWildCardList

public java.util.TreeSet<java.lang.String> getNavigationWildCardList()
Return all navigation mappings whose from-view-id contained a trailing "*".

Returns:
TreeSet The navigation mappings sorted in descending order.

getResourceBundle

public java.util.ResourceBundle getResourceBundle(javax.faces.context.FacesContext context,
                                                  java.lang.String var)

addResourceBundleBean

public void addResourceBundleBean(java.lang.String var,
                                  ResourceBundleBean bean)

getResourceBundleBeanMap

public java.util.Map<java.lang.String,ResourceBundleBean> getResourceBundleBeanMap()

addManagedBeanFactory

public void addManagedBeanFactory(java.lang.String managedBeanName,
                                  ManagedBeanFactory factory)

Adds a new mapping of managed bean name to a managed bean factory instance.

Parameters:
managedBeanName - the name of the managed bean that will be created by the managed bean factory instance.
factory - the managed bean factory instance.

getManagedBeanFactoryMap

public java.util.Map<java.lang.String,ManagedBeanFactory> getManagedBeanFactoryMap()

createAndMaybeStoreManagedBeans

public java.lang.Object createAndMaybeStoreManagedBeans(javax.faces.context.FacesContext context,
                                                        java.lang.String managedBeanName)
                                                 throws javax.faces.FacesException

The managedBeanFactories HashMap has been populated with ManagedBeanFactoryImpl object keyed by the bean name. Find the ManagedBeanFactoryImpl object and if it exists instantiate the bean and store it in the appropriate scope, if any.

Parameters:
context - The Faces context.
managedBeanName - The name identifying the managed bean.
Returns:
The managed bean.
Throws:
javax.faces.FacesException - if the managed bean could not be created.

handlePreDestroy

public void handlePreDestroy(java.lang.String beanName,
                             java.lang.Object bean,
                             ManagedBeanFactory.Scope scope)

Attempts to look up a ManagedBeanFactory from the managedBeanFactoriesMap. If not null and ManagedBeanFactory.isInjectable() returns true, pass bean to InjectionProvider.invokePreDestr

Parameters:
beanName - the name of the bean for which to call PreDestroy annotated methods. If null, all beans in argument scope have their PreDestroy annotated methods called.
bean - the target bean associated with beanName
scope - the managed bean scope in which to look for the bean or beans.

getJSFVersionTracker

public JSFVersionTracker getJSFVersionTracker()
Getter for property JSFVersionTracker.

Returns:
Value of property JSFVersionTracker.

setJSFVersionTracker

public void setJSFVersionTracker(JSFVersionTracker JSFVersionTracker)
Setter for property JSFVersionTracker.

Parameters:
JSFVersionTracker - New value of property JSFVersionTracker.


Copyright ? 2002-2006 Sun Microsystems, Inc. All Rights Reserved.