org.springframework.webflow.execution
Class ScopeType

java.lang.Object
  extended by org.springframework.core.enums.AbstractLabeledEnum
      extended by org.springframework.core.enums.StaticLabeledEnum
          extended by org.springframework.webflow.execution.ScopeType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, org.springframework.core.enums.LabeledEnum

public abstract class ScopeType
extends org.springframework.core.enums.StaticLabeledEnum

An enumeration of the core scope types of Spring Web Flow. Provides easy access to each scope by type using getScope(RequestContext).

A "scope" defines a data structure for storing custom user attributes within a flow execution. Different scope types have different semantics in terms of how long attributes placed in those scope maps remain valid.

Author:
Keith Donald, Erwin Vervaet
See Also:
Serialized Form

Field Summary
static ScopeType CONVERSATION
          The "conversation" scope type.
static ScopeType FLASH
          The "flash" scope type.
static ScopeType FLOW
          The "flow" scope type.
static ScopeType REQUEST
          The "request" scope type.
 
Fields inherited from interface org.springframework.core.enums.LabeledEnum
CODE_ORDER, DEFAULT_ORDER, LABEL_ORDER
 
Method Summary
abstract  MutableAttributeMap getScope(RequestContext context)
          Accessor that returns the mutable attribute map for this scope type for a given flow execution request context.
 java.lang.Class getType()
           
 
Methods inherited from class org.springframework.core.enums.StaticLabeledEnum
getCode, getLabel, readResolve, shortValue
 
Methods inherited from class org.springframework.core.enums.AbstractLabeledEnum
compareTo, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

REQUEST

public static final ScopeType REQUEST
The "request" scope type. Attributes placed in request scope exist for the life of the current request into the flow execution. When the request ends any attributes in request scope go out of scope.


FLASH

public static final ScopeType FLASH
The "flash" scope type. Attributes placed in flash scope exist through the life of the current request and until the next user event is signaled in a subsequent request. When the next external user event is signaled flash scope is cleared.

Flash scope is typically used to store messages that should be preserved across refreshes of the next view state (for example, on a redirect and any browser refreshes).


FLOW

public static final ScopeType FLOW
The "flow" scope type. Attributes placed in flow scope exist through the life of an executing flow session, representing an instance a single flow definition. When the flow session ends any data in flow scope goes out of scope.


CONVERSATION

public static final ScopeType CONVERSATION
The "conversation" scope type. Attributes placed in conversation scope are shared by all flow sessions started within a flow execution and live for the life of the entire flow execution (representing a single logical user conversation). When the governing execution ends, any data in conversation scope goes out of scope.

Method Detail

getType

public java.lang.Class getType()
Specified by:
getType in interface org.springframework.core.enums.LabeledEnum
Overrides:
getType in class org.springframework.core.enums.AbstractLabeledEnum

getScope

public abstract MutableAttributeMap getScope(RequestContext context)
Accessor that returns the mutable attribute map for this scope type for a given flow execution request context.

Parameters:
context - the context representing an executing request
Returns:
the scope map of this type for that request, allowing attributes to be accessed and set


Copyright © 2009 Spring Framework. All Rights Reserved.