com.iplanet.jato
Class ViewBeanManager

java.lang.Object
  |
  +--com.iplanet.jato.ViewBeanManager

public class ViewBeanManager
extends java.lang.Object

A factory for the instantiation and retrieval of ViewBean objects within a request. This class guarantees that only a single instance of a requested view bean is created during each request. View beans obtained via this class are shared between all objects in the current request. This class lazily instantiates objects as needed, but never creates more than a single instance of a given type. This class can be used to obtain any of the ViewBeans in the application.

Developers need not create any instances of this class. A single instance is automatically created at the beginning of the request and stored in the request context.

Version:
JATO/1.2.2 $Id: ViewBeanManager.java,v 1.23 2002/03/16 03:26:29 todd Exp $
See Also:
RequestContext, ViewBean

Constructor Summary
ViewBeanManager(RequestContext requestContext, java.lang.String basePackageName)
          Create an instance with the specified request context and module package name
 
Method Summary
 java.lang.String getBasePackageName()
          Return the name of the base package used for local ViewBean lookups
 ViewBean getLocalViewBean(java.lang.String localViewBeanName)
          Obtain a ViewBean instance that corresponds to the supplied logical name (this name is also referred to as the ViewBean's local name).
 ViewBean getViewBean(java.lang.Class clazz)
          Obtain a ViewBean instance by class
 ViewBean getViewBean(java.lang.String className)
          Obtain a ViewBean instance by class name
 ViewBean getViewBeanByClassName(java.lang.String className)
          Deprecated. Use the getViewBean(String) method instead
 ViewBean getViewBeanByName(java.lang.String localViewBeanName)
          Deprecated. Use the getLocalViewBean() method instead
 void notifyRequestCompletionListeners()
          Deprecated. Code that calls this method is no longer required and may be removed.
 void registerInstance(ViewBean bean)
          Register the specified view bean with the ViewBeanManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewBeanManager

public ViewBeanManager(RequestContext requestContext,
                       java.lang.String basePackageName)
Create an instance with the specified request context and module package name
Parameters:
requestContext - The request context for the current request
basePackageName - The fully qualified package name of the module servlet creating this object. This package name is used to later qualify local ViewBean lookups.
Method Detail

getBasePackageName

public java.lang.String getBasePackageName()
Return the name of the base package used for local ViewBean lookups
Returns:
The fully qualified package name of the module servlet creating this object. This package name is used to later qualify local ViewBean lookups.

getViewBeanByName

public ViewBean getViewBeanByName(java.lang.String localViewBeanName)
                           throws java.lang.ClassNotFoundException
Deprecated. Use the getLocalViewBean() method instead


getLocalViewBean

public ViewBean getLocalViewBean(java.lang.String localViewBeanName)
                          throws java.lang.ClassNotFoundException
Obtain a ViewBean instance that corresponds to the supplied logical name (this name is also referred to as the ViewBean's local name). A local view bean name is the unqualified name of the view bean class without the ViewBean suffix. For example, if a module has a view bean class com.foo.PageFooViewBean, the local view bean name is simply PageFoo. Because the local view bean name is automatically qualified by the base package name, local names can only be used to obtain references to view beans within the module whose servlet initially handled the current request.
Parameters:
localViewBeanName - The logical, or local, name of the desired view bean
Returns:
An instance of ViewBean that corresponds to the supplied name

getViewBeanByClassName

public ViewBean getViewBeanByClassName(java.lang.String className)
                                throws java.lang.ClassNotFoundException
Deprecated. Use the getViewBean(String) method instead


getViewBean

public ViewBean getViewBean(java.lang.String className)
                     throws java.lang.ClassNotFoundException
Obtain a ViewBean instance by class name
Parameters:
className - The ViewBean class name
Returns:
An instance of ViewBean that corresponds to the supplied class name

getViewBean

public ViewBean getViewBean(java.lang.Class clazz)
Obtain a ViewBean instance by class
Parameters:
clazz - The ViewBean class name
Returns:
An instance of ViewBean that corresponds to the supplied class

registerInstance

public void registerInstance(ViewBean bean)
Register the specified view bean with the ViewBeanManager. Subsequent requests for the same view bean within the current request will return the registered instance.
Parameters:
bean - The ViewBean to register

notifyRequestCompletionListeners

public final void notifyRequestCompletionListeners()
Deprecated. Code that calls this method is no longer required and may be removed.