Spring Web Flow

org.springframework.webflow.scope
Class AbstractWebFlowScope

java.lang.Object
  extended by org.springframework.webflow.scope.AbstractWebFlowScope
All Implemented Interfaces:
org.springframework.beans.factory.config.Scope
Direct Known Subclasses:
ConversationScope, FlashScope, FlowScope, RequestScope, ViewScope

public abstract class AbstractWebFlowScope
extends java.lang.Object
implements org.springframework.beans.factory.config.Scope

Base class for Scope implementations that access a Web Flow scope from the current request.

Author:
Keith Donald

Field Summary
protected  org.apache.commons.logging.Log logger
          Logger, usable by subclasses.
 
Constructor Summary
AbstractWebFlowScope()
           
 
Method Summary
 java.lang.Object get(java.lang.String name, org.springframework.beans.factory.ObjectFactory<?> objectFactory)
           
 java.lang.String getConversationId()
          Always returns null as most Spring Web Flow scopes do not have obvious conversation ids.
protected  RequestContext getRequiredRequestContext()
           
protected abstract  MutableAttributeMap<java.lang.Object> getScope()
          Template method that returns the target scope map.
 void registerDestructionCallback(java.lang.String name, java.lang.Runnable callback)
          Will not register a destruction callback as Spring Web Flow does not support destruction of scoped beans.
 java.lang.Object remove(java.lang.String name)
           
 java.lang.Object resolveContextualObject(java.lang.String key)
           
 
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, usable by subclasses.

Constructor Detail

AbstractWebFlowScope

public AbstractWebFlowScope()
Method Detail

get

public java.lang.Object get(java.lang.String name,
                            org.springframework.beans.factory.ObjectFactory<?> objectFactory)
Specified by:
get in interface org.springframework.beans.factory.config.Scope

remove

public java.lang.Object remove(java.lang.String name)
Specified by:
remove in interface org.springframework.beans.factory.config.Scope

getScope

protected abstract MutableAttributeMap<java.lang.Object> getScope()
                                                           throws java.lang.IllegalStateException
Template method that returns the target scope map.

Throws:
java.lang.IllegalStateException - if the scope could not be accessed

getConversationId

public java.lang.String getConversationId()
Always returns null as most Spring Web Flow scopes do not have obvious conversation ids. Subclasses should override this method where conversation ids can be intelligently returned.

Specified by:
getConversationId in interface org.springframework.beans.factory.config.Scope
Returns:
always returns null

resolveContextualObject

public java.lang.Object resolveContextualObject(java.lang.String key)
Specified by:
resolveContextualObject in interface org.springframework.beans.factory.config.Scope

registerDestructionCallback

public void registerDestructionCallback(java.lang.String name,
                                        java.lang.Runnable callback)
Will not register a destruction callback as Spring Web Flow does not support destruction of scoped beans. Subclasses should override this method where where destruction can adequately be accomplished.

Specified by:
registerDestructionCallback in interface org.springframework.beans.factory.config.Scope
Parameters:
name - the name of the bean to register the callback for
callback - the callback to execute

getRequiredRequestContext

protected RequestContext getRequiredRequestContext()

Spring Web Flow