org.apache.beehive.netui.pageflow
Class PageFlowManagedObject

Object
  extended by PageFlowManagedObject
All Implemented Interfaces:
Serializable, EventListener, HttpSessionBindingListener
Direct Known Subclasses:
FacesBackingBean, FlowController

public abstract class PageFlowManagedObject
extends Object
implements Serializable, HttpSessionBindingListener

See Also:
Serialized Form

Constructor Summary
PageFlowManagedObject()
           
 
Method Summary
 void create(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
          Initialize.
abstract  void ensureFailover(HttpServletRequest request)
          Ensures that any changes to this object will be replicated in a cluster (for failover), even if the replication scheme uses a change-detection algorithm that relies on HttpSession.setAttribute to be aware of changes.
protected  boolean fieldIsUninitialized(Field field)
          Tell whether the given Field is uninitialized.
abstract  String getDisplayName()
           
protected  ServletContext getServletContext()
           
protected  void initializeField(Field field, Object instance)
          Initialize the given field with an instance.
protected  void onCreate()
          Create-time callback.
protected  void onDestroy(HttpSession session)
          Callback that occurs when this object is "destroyed", i.e., removed from the session.
abstract  void persistInSession(HttpServletRequest request, HttpServletResponse response)
          Store this object in the user session, in the appropriate place.
 void reinitialize(HttpServletRequest request, HttpServletResponse response, ServletContext servletContext)
          Initialize transient data that may have been lost during session failover.
protected abstract  void removeFromSession(HttpServletRequest request)
          Remove this instance from the session.
 void valueBound(HttpSessionBindingEvent event)
          Callback when this object is added to the user session.
 void valueUnbound(HttpSessionBindingEvent event)
          Callback when this object is removed from the user session.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageFlowManagedObject

public PageFlowManagedObject()
Method Detail

reinitialize

public void reinitialize(HttpServletRequest request,
                         HttpServletResponse response,
                         ServletContext servletContext)
Initialize transient data that may have been lost during session failover.


create

public void create(HttpServletRequest request,
                   HttpServletResponse response,
                   ServletContext servletContext)
            throws Exception
Initialize.

Throws:
Exception

onCreate

protected void onCreate()
                 throws Exception
Create-time callback. Occurs after internal initialization (e.g., Java Controls) is done.

Throws:
Exception

onDestroy

protected void onDestroy(HttpSession session)
Callback that occurs when this object is "destroyed", i.e., removed from the session.

Parameters:
session -

valueBound

public void valueBound(HttpSessionBindingEvent event)
Callback when this object is added to the user session.

Specified by:
valueBound in interface HttpSessionBindingListener

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)
Callback when this object is removed from the user session. Causes onDestroy(javax.servlet.http.HttpSession) to be called.

Specified by:
valueUnbound in interface HttpSessionBindingListener

removeFromSession

protected abstract void removeFromSession(HttpServletRequest request)
Remove this instance from the session.


persistInSession

public abstract void persistInSession(HttpServletRequest request,
                                      HttpServletResponse response)
Store this object in the user session, in the appropriate place.


ensureFailover

public abstract void ensureFailover(HttpServletRequest request)
Ensures that any changes to this object will be replicated in a cluster (for failover), even if the replication scheme uses a change-detection algorithm that relies on HttpSession.setAttribute to be aware of changes. Note that this method is used by the framework and does not need to be called explicitly in most cases.

Parameters:
request - the current HttpServletRequest

getServletContext

protected ServletContext getServletContext()

getDisplayName

public abstract String getDisplayName()

fieldIsUninitialized

protected boolean fieldIsUninitialized(Field field)
Tell whether the given Field is uninitialized.

Returns:
true if the field is non-null and its value is null.

initializeField

protected void initializeField(Field field,
                               Object instance)
Initialize the given field with an instance. Mainly useful for the error handling.