Backport of small enhancement:

FlowExecutorFactoryBean now has an 'inputMapper' property to conveniently configure the 'inputMapper' property of the created FlowExecutorImpl object.
This commit is contained in:
Erwin Vervaet
2007-04-27 18:06:42 +00:00
parent 71c6e47328
commit 209d17e27a
2 changed files with 43 additions and 2 deletions

View File

@@ -2,6 +2,13 @@ SPRING WEB FLOW (SWF) CHANGELOG
===============================
http://www.springframework.org
Changes in version 1.0.4 (08.05.2007)
-------------------------------------
Package org.springframework.webflow.config
* FlowExecutorFactoryBean now has an 'inputMapper' property to conveniently configure the 'inputMapper'
property of the created FlowExecutorImpl object.
Changes in version 1.0.3 (19.04.2007)
-------------------------------------

View File

@@ -19,7 +19,9 @@ import java.util.Map;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.binding.mapping.AttributeMapper;
import org.springframework.util.Assert;
import org.springframework.webflow.context.ExternalContext;
import org.springframework.webflow.conversation.ConversationManager;
import org.springframework.webflow.conversation.impl.SessionBindingConversationManager;
import org.springframework.webflow.core.collection.AttributeMap;
@@ -29,6 +31,7 @@ import org.springframework.webflow.definition.registry.FlowDefinitionLocator;
import org.springframework.webflow.definition.registry.FlowDefinitionRegistry;
import org.springframework.webflow.engine.impl.FlowExecutionImplFactory;
import org.springframework.webflow.engine.impl.FlowExecutionImplStateRestorer;
import org.springframework.webflow.execution.FlowExecution;
import org.springframework.webflow.execution.FlowExecutionFactory;
import org.springframework.webflow.execution.FlowExecutionListener;
import org.springframework.webflow.execution.factory.FlowExecutionListenerLoader;
@@ -101,6 +104,13 @@ public class FlowExecutorFactoryBean implements FactoryBean, InitializingBean {
* Only used when the repository type is {@link RepositoryType#CONTINUATION}.
*/
private Integer maxContinuations;
/**
* A custom attribute mapper to use for mapping attributes of an
* {@link ExternalContext} to a new {@link FlowExecution} during the
* {@link FlowExecutor#launch(String, ExternalContext) launch flow} operation.
*/
private AttributeMapper inputMapper;
/**
* The flow executor this factory bean creates.
@@ -235,7 +245,26 @@ public class FlowExecutorFactoryBean implements FactoryBean, InitializingBean {
protected Integer getMaxConversations() {
return maxConversations;
}
/**
* Set the service responsible for mapping attributes of an
* {@link ExternalContext} to a new {@link FlowExecution} during the
* {@link FlowExecutor#launch(String, ExternalContext) launch flow} operation.
* <p>
* This is optional. If not set, a default implementation will be used
* that simply exposes all request parameters as flow execution input attributes.
*/
public void setInputMapper(AttributeMapper inputMapper) {
this.inputMapper = inputMapper;
}
/**
* Return the configured input mapper.
*/
protected AttributeMapper getInputMapper() {
return inputMapper;
}
/**
* Set system defaults that should be used.
* @param defaults the defaults to use.
@@ -396,7 +425,12 @@ public class FlowExecutorFactoryBean implements FactoryBean, InitializingBean {
protected FlowExecutor createFlowExecutor(
FlowDefinitionLocator definitionLocator, FlowExecutionFactory executionFactory,
FlowExecutionRepository executionRepository) {
return new FlowExecutorImpl(definitionLocator, executionFactory, executionRepository);
FlowExecutorImpl flowExecutor =
new FlowExecutorImpl(definitionLocator, executionFactory, executionRepository);
if (getInputMapper() != null) {
flowExecutor.setInputMapper(inputMapper);
}
return flowExecutor;
}
// implementing FactoryBean