org.apache.beehive.netui.pageflow
Class PageFlowStack

Object
  extended by PageFlowStack
All Implemented Interfaces:
Serializable, EventListener, HttpSessionBindingListener

public class PageFlowStack
extends Object
implements HttpSessionBindingListener, Serializable

Stack for keeping track of a series of nested page flows. When a nested page flow is entered, the previous page flow is pushed onto this stack, which is kept in the user session.

See Also:
Serialized Form

Nested Class Summary
static class PageFlowStack.PushedPageFlow
          Wrapper that contains a pushed page flow and information related to it.
 
Method Summary
static void destroy(HttpServletRequest request)
          Destroy the stack of PageFlowControllers that have invoked nested page flows.
static PageFlowStack get(HttpServletRequest request)
          Get the stack of nested page flows for the current user session.
static PageFlowStack get(HttpServletRequest request, boolean createIfNotExist)
          Get the stack of nested page flows for the current user session.
 boolean isEmpty()
          Tell whether the stack of nested page flows is empty.
 PageFlowStack.PushedPageFlow peek()
          Get the most recently-pushed page flow from the stack of nested page flows in the session.
 PageFlowStack.PushedPageFlow pop(HttpServletRequest request)
          Pop the most recently-pushed page flow from the stack of nested page flows in the session.
 void push(PageFlowController pageFlow, HttpServletRequest request)
          Push a page flow onto the stack of nested page flows in the session.
 int size()
          Get the size of the stack of nested page flows.
 void valueBound(HttpSessionBindingEvent event)
           
 void valueUnbound(HttpSessionBindingEvent event)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

get

public static final PageFlowStack get(HttpServletRequest request)
Get the stack of nested page flows for the current user session. Create and store an empty stack if none exists.

Parameters:
request - the current HttpServletRequest
Returns:
the stack of nested page flows PageFlowStack.PushedPageFlows) for the current user session.

get

public static PageFlowStack get(HttpServletRequest request,
                                boolean createIfNotExist)
Get the stack of nested page flows for the current user session. Create and store an empty stack if none exists.

Parameters:
request - the current HttpServletRequest
Returns:
a PageFlowStack of nested page flows (PageFlowControllers) for the current user session.

destroy

public static void destroy(HttpServletRequest request)
Destroy the stack of PageFlowControllers that have invoked nested page flows.

Parameters:
request - the current HttpServletRequest.

push

public void push(PageFlowController pageFlow,
                 HttpServletRequest request)
Push a page flow onto the stack of nested page flows in the session.

Parameters:
pageFlow - the page flow to push.
request - the current HttpServletRequest.

pop

public PageFlowStack.PushedPageFlow pop(HttpServletRequest request)
Pop the most recently-pushed page flow from the stack of nested page flows in the session.

Parameters:
request - the current HttpServletRequest.
Returns:
a PageFlowStack.PushedPageFlow that represents the popped page flow.

peek

public PageFlowStack.PushedPageFlow peek()
Get the most recently-pushed page flow from the stack of nested page flows in the session.

Returns:
a PageFlowStack.PushedPageFlow that represents the page flow at the top of the stack.

isEmpty

public boolean isEmpty()
Tell whether the stack of nested page flows is empty.

Returns:
true if there are no nested page flows on the stack.

size

public int size()
Get the size of the stack of nested page flows.

Returns:
the number of page flows that are currently (hidden away) on the stack.

valueBound

public void valueBound(HttpSessionBindingEvent event)
Specified by:
valueBound in interface HttpSessionBindingListener

valueUnbound

public void valueUnbound(HttpSessionBindingEvent event)
Specified by:
valueUnbound in interface HttpSessionBindingListener