X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.core%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2Fgenerator%2FExecutionFlowGenerator.java;h=db1d276d7975fe705daeddae28920648bb893ca7;hb=9d38eeed9b5571a26a9e4d1844dc42a57699dd13;hp=5451402ff6255d13bdfee837a22c79cf73082a90;hpb=78c26de935d15dafb2a6bfd81be4d3bb3ae61b23;p=gpl%2Fargeo-slc.git
diff --git a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/ExecutionFlowGenerator.java b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/ExecutionFlowGenerator.java
index 5451402ff..db1d276d7 100644
--- a/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/ExecutionFlowGenerator.java
+++ b/runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/generator/ExecutionFlowGenerator.java
@@ -26,10 +26,6 @@ import org.springframework.core.PriorityOrdered;
* Application Context after configuring the ExecutionContext
,
* and outputs of a RunnableFactory
.
*/
-/**
- * @author Olivier Capillon
- *
- */
public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,
PriorityOrdered {
@@ -63,6 +59,12 @@ public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,
* RunnableCallFlow
beans.
*/
private String contextValuesBeanName = "executionFlowGenerator.contextValues";
+
+ /**
+ * Prefix added to the bean names defined in each
+ * RunnableCallFlowDescriptor
+ */
+ private String flowBeanNamesPrefix = "";
public void postProcessBeanFactory(
ConfigurableListableBeanFactory beanFactory) throws BeansException {
@@ -100,11 +102,13 @@ public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,
GenericBeanDefinition flowBean = new GenericBeanDefinition();
flowBean.setBeanClass(RunnableCallFlow.class);
+ String beanName = flowBeanNamesPrefix + flowDescriptor.getBeanName();
+
MutablePropertyValues mpv = new MutablePropertyValues();
mpv.addPropertyValue("runnableCalls", flowDescriptor.getRunnableCalls());
mpv.addPropertyValue("sharedContextValuesMap", new RuntimeBeanReference(contextValuesBeanName));
- mpv.addPropertyValue("name", flowDescriptor.getBeanName());
+ mpv.addPropertyValue("name", beanName);
mpv.addPropertyValue("path", flowDescriptor.getPath());
mpv.addPropertyValue("executionContext", new RuntimeBeanReference(executionContextBeanName));
@@ -113,9 +117,9 @@ public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,
// register it
if(log.isDebugEnabled()) {
- log.debug("Registering bean definition for RunnableCallFlow " + flowDescriptor.getBeanName());
+ log.debug("Registering bean definition for RunnableCallFlow " + beanName);
}
- registry.registerBeanDefinition(flowDescriptor.getBeanName(), flowBean);
+ registry.registerBeanDefinition(beanName, flowBean);
}
/**
@@ -151,5 +155,7 @@ public class ExecutionFlowGenerator implements BeanFactoryPostProcessor,
this.contextValuesBeanName = contextValuesBeanName;
}
-
+ public void setFlowBeanNamesPrefix(String flowBeanNamesPrefix) {
+ this.flowBeanNamesPrefix = flowBeanNamesPrefix;
+ }
}