restored minor 1.x compat

This commit is contained in:
Scott Andrews
2008-04-12 01:09:35 +00:00
parent 8ec63dcf65
commit 8bc7d4f282
2 changed files with 60 additions and 9 deletions

View File

@@ -73,17 +73,17 @@ import org.springframework.webflow.execution.repository.FlowExecutionRepository;
public class FlowExecutorImpl implements FlowExecutor {
/**
* A locator to access flow definitions registered in a central registry.
* The locator to access flow definitions registered in a central registry.
*/
private FlowDefinitionLocator definitionLocator;
/**
* An abstract factory for creating a new execution of a flow definition.
* The abstract factory for creating a new execution of a flow definition.
*/
private FlowExecutionFactory executionFactory;
/**
* An repository used to save, update, and load existing flow executions to/from a persistent store.
* The repository used to save, update, and load existing flow executions to/from a persistent store.
*/
private FlowExecutionRepository executionRepository;
@@ -103,6 +103,27 @@ public class FlowExecutorImpl implements FlowExecutor {
this.executionRepository = executionRepository;
}
/**
* Returns the locator to load flow definitions to execute.
*/
public FlowDefinitionLocator getDefinitionLocator() {
return definitionLocator;
}
/**
* Returns the abstract factory used to create new executions of a flow.
*/
public FlowExecutionFactory getExecutionFactory() {
return executionFactory;
}
/**
* Returns the repository used to save, update, and load existing flow executions to/from a persistent store.
*/
public FlowExecutionRepository getExecutionRepository() {
return executionRepository;
}
public FlowExecutionResult launchExecution(String flowId, MutableAttributeMap input, ExternalContext context)
throws FlowException {
try {

View File

@@ -52,7 +52,7 @@ public class FlowController extends AbstractController {
private static final Log logger = LogFactory.getLog(FlowController.class);
/**
* The entry point into Spring Web Flow.
* The central service for executing flows and the entry point into the Web Flow system.
*/
private FlowExecutor flowExecutor;
@@ -72,16 +72,31 @@ public class FlowController extends AbstractController {
*/
private Map flowHandlers = new HashMap();
public FlowController() {
initDefaults();
}
/**
* Creates a new flow controller.
* @param flowExecutor the web flow executor service
*/
public FlowController(FlowExecutor flowExecutor) {
this.flowExecutor = flowExecutor;
this.urlHandler = new DefaultFlowUrlHandler();
this.ajaxHandler = new SpringJavascriptAjaxHandler();
// set the cache seconds property to 0 so no pages are cached by default for flows
setCacheSeconds(0);
initDefaults();
}
/**
* Returns the central service for executing flows and the entry point into the Web Flow system.
*/
public FlowExecutor getFlowExecutor() {
return flowExecutor;
}
/**
* Sets the central service for executing flows and the entry point into the Web Flow system.
*/
public void setFlowExecutor(FlowExecutor flowExecutor) {
this.flowExecutor = flowExecutor;
}
/**
@@ -95,7 +110,7 @@ public class FlowController extends AbstractController {
* Sets the configured flow url handler.
* @param urlHandler the flow url handler.
*/
public void setFlowRequestUrlHandler(FlowUrlHandler urlHandler) {
public void setFlowUrlHandler(FlowUrlHandler urlHandler) {
this.urlHandler = urlHandler;
}
@@ -114,6 +129,14 @@ public class FlowController extends AbstractController {
this.ajaxHandler = ajaxHandler;
}
/**
* Sets the custom flow handles for managing access to specific flows in a custom manner.
* @param flowHandlers the flow handler map
*/
public void setFlowHandlers(Map flowHandlers) {
this.flowHandlers = flowHandlers;
}
/**
* Registers a handler for managing access to a specific flow definition.
* @param handler the flow handler
@@ -202,6 +225,13 @@ public class FlowController extends AbstractController {
// internal helpers
private void initDefaults() {
urlHandler = new DefaultFlowUrlHandler();
ajaxHandler = new SpringJavascriptAjaxHandler();
// set the cache seconds property to 0 so no pages are cached by default for flows
setCacheSeconds(0);
}
private ModelAndView handleFlowExecutionResult(FlowExecutionResult result, ServletExternalContext context,
HttpServletRequest request, HttpServletResponse response) throws IOException {
if (result.paused()) {