com.google.code.rees.scope.struts2.programmatic
Class ProgrammaticModelDrivenConversationSupport<T extends Serializable>

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by com.google.code.rees.scope.struts2.programmatic.ProgrammaticModelDrivenConversationSupport<T>
Type Parameters:
T -
All Implemented Interfaces:
ProgrammaticModelDrivenConversation<T>, com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.ModelDriven<T>, com.opensymphony.xwork2.Preparable, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, Serializable

public abstract class ProgrammaticModelDrivenConversationSupport<T extends Serializable>
extends com.opensymphony.xwork2.ActionSupport
implements ProgrammaticModelDrivenConversation<T>, com.opensymphony.xwork2.Preparable

This class makes it simple to manage models with conversation-scoped life-cycles programmatically. All access to the model is through the getModel() and setModel(Serializable) methods so that retrieval and insertion of the model from and into conversation instances can be managed on behalf of inheriting classes. Use of this class requires zero configuration (no interceptors, etc.).

Author:
rees.byars
See Also:
Serialized Form

Field Summary
protected  ScopeContainer scopeContainer
           
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ProgrammaticModelDrivenConversationSupport()
           
 
Method Summary
protected  void beginConversations()
          Begins new instances of this class's conversations
protected  void continueConversations()
          Continues this class's conversations associated with the current request
protected  void endConversations()
          Ends this class's conversations associated with the current request
 T getModel()
           The model is scoped to the conversations indicated by ProgrammaticModelDrivenConversation.getConversations()
protected  String getModelName()
          The name of the model used to identify it in the ConversationContext.
 void prepare()
          
 void setModel(T model)
          Set the model instance.
 void setScopeContainerProvider(ScopeContainerProvider scopeContainerProvider)
           
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getFormatted, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.code.rees.scope.struts2.programmatic.ProgrammaticModelDrivenConversation
getConversations
 

Field Detail

scopeContainer

protected ScopeContainer scopeContainer
Constructor Detail

ProgrammaticModelDrivenConversationSupport

public ProgrammaticModelDrivenConversationSupport()
Method Detail

setScopeContainerProvider

public void setScopeContainerProvider(ScopeContainerProvider scopeContainerProvider)

getModel

public T getModel()
The model is scoped to the conversations indicated by ProgrammaticModelDrivenConversation.getConversations()

Specified by:
getModel in interface com.opensymphony.xwork2.ModelDriven<T extends Serializable>

setModel

public void setModel(T model)
Set the model instance. The model is scoped to the conversations indicated by ProgrammaticModelDrivenConversation.getConversations()

Specified by:
setModel in interface ProgrammaticModelDrivenConversation<T extends Serializable>

getModelName

protected String getModelName()
The name of the model used to identify it in the ConversationContext. This can be overridden to provide the name of choice. The default is this.getClass().getName().

Returns:

prepare

public void prepare()

Specified by:
prepare in interface com.opensymphony.xwork2.Preparable

beginConversations

protected void beginConversations()
Begins new instances of this class's conversations


continueConversations

protected void continueConversations()
Continues this class's conversations associated with the current request


endConversations

protected void endConversations()
Ends this class's conversations associated with the current request



Copyright © 2012-2013. All Rights Reserved.