From 98f9f7d8033bd203f3637b83e38aec62c6ac82b9 Mon Sep 17 00:00:00 2001 From: Erwin Vervaet Date: Wed, 9 May 2007 09:41:42 +0000 Subject: [PATCH] Added initBuilder() hook method to AbstractFlowBuilder. --- spring-webflow/changelog.txt | 1 + .../webflow/engine/builder/AbstractFlowBuilder.java | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/spring-webflow/changelog.txt b/spring-webflow/changelog.txt index 043316d7..292a9e72 100644 --- a/spring-webflow/changelog.txt +++ b/spring-webflow/changelog.txt @@ -18,6 +18,7 @@ Package org.springframework.webflow.conversation Package org.springframework.webflow.engine * Added invoke(String, Action) method to AbstractFlowBuilder. +* Added initBuilder() hook method to AbstractFlowBuilder. Package org.springframework.webflow.executor * JSF integration code now manages flow execution locks properly in exceptional situations and when the diff --git a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java index d4e04726..9326581e 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/engine/builder/AbstractFlowBuilder.java @@ -185,6 +185,7 @@ public abstract class AbstractFlowBuilder extends BaseFlowBuilder { public void init(String flowId, AttributeMap attributes) throws FlowBuilderException { setFlow(getFlowArtifactFactory().createFlow(flowId, flowAttributes().union(attributes))); + initBuilder(); } /** @@ -196,6 +197,15 @@ public abstract class AbstractFlowBuilder extends BaseFlowBuilder { protected AttributeMap flowAttributes() { return CollectionUtils.EMPTY_ATTRIBUTE_MAP; } + + /** + * Hook method subclasses can override to initialize the flow builder. + * Will be called by {@link #init(String, AttributeMap)} after + * creating the initial Flow object. As a consequence, {@link #getFlow()} + * can be called to retrieve the Flow object under construction. + */ + protected void initBuilder() { + } // view state