X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FAbstractSpringExecutionModule.java;h=bca30d0ed2baa1c5715e641ce82c8bffae7aafd5;hb=9daa55ce316d52ffd8f30dc0d1b516ccf78a8c73;hp=51ca2f159f8c08db9d48b226620e86c21efbe380;hpb=93c79aaf29bd5dd96b75140f81f38d6e4dbc5504;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java index 51ca2f159..bca30d0ed 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java @@ -19,25 +19,22 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.util.Assert; -public abstract class AbstractSpringExecutionModule implements ExecutionModule, - ApplicationContextAware { +@Deprecated +public abstract class AbstractSpringExecutionModule implements ExecutionModule + { +/* + protected ApplicationContext applicationContext; - private ApplicationContext applicationContext; + protected ExecutionContext executionContext; - private ExecutionContext executionContext; - - private ExecutionFlowDescriptorConverter descriptorConverter = new DefaultDescriptorConverter(); + protected ExecutionFlowDescriptorConverter descriptorConverter = new DefaultDescriptorConverter(); public ExecutionModuleDescriptor getDescriptor() { ExecutionModuleDescriptor md = new ExecutionModuleDescriptor(); md.setName(getName()); md.setVersion(getVersion()); - GenericBeanFactoryAccessor accessor = new GenericBeanFactoryAccessor( - applicationContext); - Map executionFlows = accessor - .getBeansOfType(ExecutionFlow.class); - + Map executionFlows = listFlows(); for (String name : executionFlows.keySet()) { ExecutionFlow executionFlow = executionFlows.get(name); @@ -72,6 +69,13 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, + value.getClass().getName()); } values.put(key, refValue); + } else if (attribute instanceof ResourceSpecAttribute) { + PrimitiveValue primitiveValue = new PrimitiveValue(); + primitiveValue + .setType(((ResourceSpecAttribute) attribute) + .getType()); + primitiveValue.setValue(value); + values.put(key, primitiveValue); } else { throw new SlcException("Unkown spec attribute type " + attribute.getClass()); @@ -96,13 +100,21 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, return md; } + protected Map listFlows() { + GenericBeanFactoryAccessor accessor = new GenericBeanFactoryAccessor( + applicationContext); + Map executionFlows = accessor + .getBeansOfType(ExecutionFlow.class); + return executionFlows; + } + public void execute(ExecutionFlowDescriptor executionFlowDescriptor) { if (descriptorConverter != null) executionContext.addVariables(descriptorConverter .convertValues(executionFlowDescriptor)); ExecutionFlow flow = (ExecutionFlow) applicationContext.getBean( executionFlowDescriptor.getName(), ExecutionFlow.class); - flow.execute(); + flow.run(); } public void setApplicationContext(ApplicationContext applicationContext) @@ -117,6 +129,6 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, public void setDescriptorConverter( ExecutionFlowDescriptorConverter descriptorConverter) { this.descriptorConverter = descriptorConverter; - } + }*/ }