org.apache.beehive.netui.pageflow
Class FacesBackingBeanFactory

Object
  extended by Factory
      extended by FacesBackingBeanFactory
All Implemented Interfaces:
Serializable, InternalConstants

public class FacesBackingBeanFactory
extends Factory
implements InternalConstants

Factory for creating "backing beans" for JavaServer Faces pages.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface InternalConstants
ACTION_EXTENSION_LEN, ACTION_OVERRIDE_PREFIX, ANNOTATION_QUALIFIER, ATTR_PREFIX, BACKING_CLASS_IMPLICIT_OBJECT, BEGIN_ACTION_PATH, CURRENT_JPF_ATTR, CURRENT_LONGLIVED_ATTR, FACES_BACKING_ATTR, FACES_BACKING_EXTENSION, FACES_EXTENSION, FACES_EXTENSION_DOT, GLOBALAPP_CLASSNAME, GLOBALAPP_MEMBER_NAME, GLOBALAPP_MODULE_CONTEXT_PATH, INTERNAL_VAR_PREFIX, JSF_EXTENSION, JSF_EXTENSION_DOT, MESSAGE_IS_EXPRESSION_PREFIX, MESSAGE_IS_EXPRESSION_PREFIX_LENGTH, NETUI_CONFIG_PATH, RETURN_ACTION_VIEW_RENDERER_PARAM, RETURNING_FORM_ATTR, RETURNING_FROM_NESTING_ATTR, SHARED_FLOW_ATTR_PREFIX, SHARED_FLOW_EXTENSION, SHARED_FLOW_MODULE_PREFIX, SHARED_FLOW_MODULE_PREFIX_LEN, SHARED_FLOW_ROOT_MODULE, WEBINF_DIR
 
Constructor Summary
protected FacesBackingBeanFactory()
           
 
Method Summary
static FacesBackingBeanFactory get(ServletContext servletContext)
          Get a FacesBackingBeanFactory.
 Class getFacesBackingBeanClass(String className)
          Get a FacesBackingBean class.
 FacesBackingBean getFacesBackingBeanForRequest(RequestContext requestContext)
          Get the "backing bean" associated with the JavaServer Faces page for a request.
 FacesBackingBean getFacesBackingBeanInstance(Class beanClass)
          Get a FacesBackingBean instance, given a FacesBackingBean class.
static void init(ServletContext servletContext)
          Initialize an instance of this class in the ServletContext.
protected  FacesBackingBean loadFacesBackingBean(RequestContext requestContext, String backingClassName)
          Load a "backing bean" associated with the JavaServer Faces page for a request.
protected  void onCreate()
          Called after this factory has been created and initialized.
protected  void reinit(ServletContext servletContext)
          Called to reinitialize this instance, most importantly after it has been serialized/deserialized.
 
Methods inherited from class Factory
getConfig, getServletContext
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesBackingBeanFactory

protected FacesBackingBeanFactory()
Method Detail

onCreate

protected void onCreate()
Description copied from class: Factory
Called after this factory has been created and initialized.

Overrides:
onCreate in class Factory

init

public static void init(ServletContext servletContext)
Initialize an instance of this class in the ServletContext. This is a framework-invoked method and should normally be called directly.


reinit

protected void reinit(ServletContext servletContext)
Called to reinitialize this instance, most importantly after it has been serialized/deserialized.

Overrides:
reinit in class Factory
Parameters:
servletContext - the current ServletContext.

get

public static FacesBackingBeanFactory get(ServletContext servletContext)
Get a FacesBackingBeanFactory.

Parameters:
servletContext - the current ServletContext.
Returns:
a FacesBackingBeanFactory for the given ServletContext. It may or may not be a cached instance.

getFacesBackingBeanForRequest

public FacesBackingBean getFacesBackingBeanForRequest(RequestContext requestContext)
Get the "backing bean" associated with the JavaServer Faces page for a request.

Parameters:
requestContext - a RequestContext object which contains the current request and response.

loadFacesBackingBean

protected FacesBackingBean loadFacesBackingBean(RequestContext requestContext,
                                                String backingClassName)
Load a "backing bean" associated with the JavaServer Faces page for a request.

Parameters:
requestContext - a RequestContext object which contains the current request and response.
backingClassName - the name of the backing bean class.
Returns:
an initialized FacesBackingBean, or null if an error occurred.

getFacesBackingBeanClass

public Class getFacesBackingBeanClass(String className)
                               throws ClassNotFoundException
Get a FacesBackingBean class. By default, this loads the class using the thread context class loader.

Parameters:
className - the name of the FacesBackingBean class to load.
Returns:
the loaded FacesBackingBean class.
Throws:
ClassNotFoundException - if the requested class could not be found.

getFacesBackingBeanInstance

public FacesBackingBean getFacesBackingBeanInstance(Class beanClass)
                                             throws InstantiationException,
                                                    IllegalAccessException
Get a FacesBackingBean instance, given a FacesBackingBean class.

Parameters:
beanClass - the Class, which must be assignable to FacesBackingBean.
Returns:
a new FacesBackingBean instance.
Throws:
InstantiationException
IllegalAccessException