org.springframework.webflow.execution.servlet
Class HttpSessionFlowExecutionStorage

java.lang.Object
  extended by org.springframework.webflow.execution.servlet.HttpSessionFlowExecutionStorage
All Implemented Interfaces:
FlowExecutionStorage
Direct Known Subclasses:
HttpSessionContinuationFlowExecutionStorage

public class HttpSessionFlowExecutionStorage
extends java.lang.Object
implements FlowExecutionStorage

Flow execution storage implementation that stores the flow execution in the HTTP session.

This storage strategy requires a ServletEvent.

Author:
Erwin Vervaet
See Also:
ServletEvent

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger, can be used in subclasses.
 
Constructor Summary
HttpSessionFlowExecutionStorage()
           
 
Method Summary
protected  java.lang.String attributeName(java.io.Serializable id)
          Returns an appropriate session attribute name for the flow execution id.
protected  java.io.Serializable createId()
          Helper to generate a unique id for a flow execution in the storage.
 boolean isCreateSession()
          Returns whether or not an HTTP session should be created if non exists.
 FlowExecution load(java.io.Serializable id, Event requestingEvent)
          Load an existing flow execution, identified by given unique id, from the storage.
 void remove(java.io.Serializable id, Event requestingEvent)
          Remove the identified flow execution from the storage.
 java.io.Serializable save(java.io.Serializable id, FlowExecution flowExecution, Event requestingEvent)
          Save given flow execution in the storage.
 void setCreateSession(boolean createSession)
          Set whether or not an HTTP session should be created if non exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger, can be used in subclasses.

Constructor Detail

HttpSessionFlowExecutionStorage

public HttpSessionFlowExecutionStorage()
Method Detail

isCreateSession

public boolean isCreateSession()
Returns whether or not an HTTP session should be created if non exists. Defaults to true.


setCreateSession

public void setCreateSession(boolean createSession)
Set whether or not an HTTP session should be created if non exists.


load

public FlowExecution load(java.io.Serializable id,
                          Event requestingEvent)
                   throws NoSuchFlowExecutionException,
                          FlowExecutionStorageException
Description copied from interface: FlowExecutionStorage
Load an existing flow execution, identified by given unique id, from the storage.

Specified by:
load in interface FlowExecutionStorage
Parameters:
id - the unique id of the flow execution, as returned by the save method
requestingEvent - the event requesting the load of the flow execution
Returns:
the loaded flow execution
Throws:
NoSuchFlowExecutionException - when there is no flow execution with specified id in the storage
FlowExecutionStorageException - when there is a technical problem accessing the flow execution storage

save

public java.io.Serializable save(java.io.Serializable id,
                                 FlowExecution flowExecution,
                                 Event requestingEvent)
                          throws FlowExecutionStorageException
Description copied from interface: FlowExecutionStorage
Save given flow execution in the storage.

Specified by:
save in interface FlowExecutionStorage
Parameters:
id - the unique id of the flow execution, or null if the flow execution does not yet have an id (e.g. was not previously saved)
flowExecution - the flow execution to save
requestingEvent - the event requesting the save of the flow execution
Returns:
the unique id that actually identifies the saved flow execution, this could be different from the id passed into the method
Throws:
FlowExecutionStorageException - when there is a technical problem accessing the flow execution storage

remove

public void remove(java.io.Serializable id,
                   Event requestingEvent)
            throws FlowExecutionStorageException
Description copied from interface: FlowExecutionStorage
Remove the identified flow execution from the storage.

Specified by:
remove in interface FlowExecutionStorage
Parameters:
id - the unique id of the flow execution, as returned by the save method
requestingEvent - the event requesting the remove of the flow execution
Throws:
FlowExecutionStorageException - when there is a technical problem accessing the flow execution storage

createId

protected java.io.Serializable createId()
Helper to generate a unique id for a flow execution in the storage.


attributeName

protected java.lang.String attributeName(java.io.Serializable id)
Returns an appropriate session attribute name for the flow execution id.



Copyright © 2005. All Rights Reserved.