com.ervacon.springframework.web.servlet.mvc.webflow
Class WebFlowMementoStack

java.lang.Object
  extended bycom.ervacon.springframework.web.servlet.mvc.webflow.WebFlowMementoStack
All Implemented Interfaces:
java.io.Serializable

public class WebFlowMementoStack
extends java.lang.Object
implements java.io.Serializable

Stack of flow mementos. This stack is necessary since a web flow can start another web flow as a sub flow, so we need to maintain a stack of flow mementos: one for each nested flow invokation.

Objects of this class are serializable, so they can be safely stored in the HTTP session.

One way of looking at an object of this class is as a call stack: a stack of activation records build up when one flow calls another.

There should be little need to work directly with this class from inside web application code. Take a look at the asList() method if you want to expose the stack of mementos to the application (e.g. in a view).

Author:
Erwin Vervaet, Steven Bazyl
See Also:
WebFlowMemento, Serialized Form

Constructor Summary
WebFlowMementoStack()
           
 
Method Summary
 java.util.List asList()
          Get the stack of mementos as a list (bottom of stack is at index 0), suitable for export to the page model for use in breadcrumbs or other devices.
 boolean empty()
          Returns whether or not the stack is empty.
 java.lang.String getCurrentState()
          Get the current state of the memento at the top of the stack.
 WebFlow getFlow(org.springframework.context.ApplicationContext appCtx)
          Get the flow object of the memento at the top of the stack from given application context.
 java.lang.String getFlowName()
          Get the flow name of the memento at the top of the stack.
 long getLastAccessedTime()
          Returns the last time a flow in this memento stack processed a client request.
 java.util.Map getModel()
          Get the flow model of the memento at the top of the stack.
 WebFlowMemento peek()
          Returns the memento at the top of the stack without removing it from the stack.
 WebFlowMemento pop()
          Pops the top memento from the stack.
 void push(WebFlowMemento memento)
          Push given memento onto the stack.
 void setCurrentState(java.lang.String state)
          Set the current state of the memento at the top of the stack.
 int size()
          Returns the size (depth) of the stack.
 void touch()
          Update the last accessed time of this memento stack.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebFlowMementoStack

public WebFlowMementoStack()
Method Detail

empty

public boolean empty()

Returns whether or not the stack is empty.


size

public int size()

Returns the size (depth) of the stack.


push

public void push(WebFlowMemento memento)

Push given memento onto the stack.


peek

public WebFlowMemento peek()
                    throws java.util.EmptyStackException

Returns the memento at the top of the stack without removing it from the stack.

Throws:
java.util.EmptyStackException - if the stack is empty

pop

public WebFlowMemento pop()

Pops the top memento from the stack. If the stack is empty, null will be returned.


getLastAccessedTime

public long getLastAccessedTime()

Returns the last time a flow in this memento stack processed a client request.


touch

public void touch()

Update the last accessed time of this memento stack.


asList

public java.util.List asList()

Get the stack of mementos as a list (bottom of stack is at index 0), suitable for export to the page model for use in breadcrumbs or other devices.


getFlowName

public java.lang.String getFlowName()

Get the flow name of the memento at the top of the stack.


getFlow

public WebFlow getFlow(org.springframework.context.ApplicationContext appCtx)
                throws org.springframework.beans.BeansException

Get the flow object of the memento at the top of the stack from given application context.

Throws:
org.springframework.beans.BeansException

getCurrentState

public java.lang.String getCurrentState()

Get the current state of the memento at the top of the stack.


setCurrentState

public void setCurrentState(java.lang.String state)

Set the current state of the memento at the top of the stack.


getModel

public java.util.Map getModel()

Get the flow model of the memento at the top of the stack.