http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
\r
- <bean id="basic.executionSpec" class="org.argeo.slc.core.execution.SimpleExecutionSpec">\r
+ <bean id="basic.spec" parent="slcTemplate.simpleSpec">\r
<property name="attributes">\r
<map>\r
<entry key="testedComponentId">\r
- <bean parent="specAttribute" p:value="100" p:isParameter="true"/>\r
+ <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"\r
+ p:type="integer" />\r
</entry>\r
<entry key="testData1">\r
- <bean parent="refAttribute" p:targetClass="org.argeo.slc.core.test.BasicTestData" />\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
</entry>\r
<entry key="testData2">\r
- <bean parent="refAttribute" p:targetClass="org.argeo.slc.core.test.BasicTestData" />\r
+ <bean parent="specAttr.ref" p:targetClass="org.argeo.slc.core.test.BasicTestData"\r
+ p:isParameter="true" p:isFrozen="true" />\r
</entry>\r
</map>\r
</property>\r
</bean>\r
\r
- <bean id="basic.ref" factory-bean="basic.executionSpec"\r
- factory-method="createRef" abstract="true" />\r
+ <bean id="basic.ref" factory-bean="basic.spec" factory-method="createRef"\r
+ abstract="true" />\r
\r
- <bean id="basic.executionFlowTemplate" class="org.argeo.slc.core.execution.SimpleExecutionFlow"\r
+ <bean id="basic.flowTemplate" parent="slcTemplate.simpleFlow"\r
abstract="true">\r
- <property name="executionSpec" ref="basic.executionSpec" />\r
+ <property name="executionSpec" ref="basic.spec" />\r
<property name="executables">\r
<list>\r
<ref bean="echo1" />\r
<constructor-arg value="testData2" />\r
</bean>\r
\r
- \r
- <bean id="basic.testData" class="org.argeo.slc.core.test.BasicTestData"\r
- >\r
+\r
+ <bean id="basic.testData" class="org.argeo.slc.core.test.BasicTestData">\r
<aop:scoped-proxy />\r
<property name="expected" value="tata" />\r
<property name="reached" value="tata" />\r
</bean>\r
- \r
- \r
- <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition"\r
- scope="prototype" />\r
-\r
- <bean id="testResult" parent="slcDefault.test.basicSimpleTestResult" />\r
-\r
- <bean id="testRun" class="org.argeo.slc.core.test.SimpleTestRun"\r
- abstract="true">\r
- <property name="testResult" ref="testResult" />\r
- </bean>\r
-\r
- <!--\r
- <bean class="org.springframework.aop.framework.ProxyFactoryBean">\r
- <property name="targetClass"\r
- value="org.argeo.slc.core.test.BasicTestData" /> <property\r
- name="targetSource"> <bean\r
- class="org.argeo.slc.executionflow.ExecutionTargetSource"> <property\r
- name="name" value="testData" /> <property name="targetClass"\r
- value="org.argeo.slc.core.test.BasicTestData" /> </bean> </property>\r
- <property name="proxyTargetClass" value="true" /> </bean>\r
- -->\r
\r
</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="\r
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
+\r
+ <bean id="canonic.spec" parent="slcTemplate.simpleSpec">\r
+ <property name="attributes">\r
+ <map>\r
+ <entry key="parameterAtInstantiation">\r
+ <bean parent="specAttr.primitive" p:isParameter="true" p:type="integer" />\r
+ </entry>\r
+ <entry key="displayWithoutControl">\r
+ <bean parent="specAttr.primitive" p:value="100" p:isParameter="true"\r
+ p:isFrozen="true" p:type="integer" />\r
+ </entry>\r
+ <entry key="displayWithControl">\r
+ <bean parent="specAttr.primitive" p:value="200" p:isParameter="true"\r
+ p:isFrozen="false" p:type="integer" />\r
+ </entry>\r
+ <entry key="hide">\r
+ <bean parent="specAttr.primitive" p:value="300" p:isParameter="true"\r
+ p:isFrozen="false" p:isHidden="true" p:type="integer" />\r
+ </entry>\r
+ </map>\r
+ </property>\r
+ </bean>\r
+\r
+ <bean id="canonic.flowTemplate" parent="slcTemplate.simpleFlow"\r
+ abstract="true">\r
+ <property name="executionSpec" ref="canonic.spec" />\r
+ <property name="executables">\r
+ <list>\r
+ <bean parent="task.echo"\r
+ p:message="Canonical: displayWithControl=@{displayWithControl}, displayWithoutControl=@{displayWithoutControl}, hide=@{hide}"\r
+ scope="execution">\r
+ <aop:scoped-proxy />\r
+ </bean>\r
+ </list>\r
+ </property>\r
+ </bean>\r
+</beans>
\ No newline at end of file
-<?xml version="1.0" encoding="UTF-8"?>\r
-<beans xmlns="http://www.springframework.org/schema/beans"\r
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
- xmlns:aop="http://www.springframework.org/schema/aop"\r
- xsi:schemaLocation="\r
- http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
- http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
-\r
- <import\r
- resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />\r
-\r
- <bean id="specAttribute" class="org.argeo.slc.core.execution.SimpleSpecAttribute"\r
- abstract="true" />\r
-\r
- <bean id="refAttribute" class="org.argeo.slc.core.execution.RefSpecAttribute"\r
- abstract="true" />\r
-\r
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition"
+ scope="prototype" />
+
+ <bean id="testResult" parent="slcDefault.test.basicSimpleTestResult" />
+
+ <bean id="testRun" class="org.argeo.slc.core.test.SimpleTestRun"
+ abstract="true">
+ <property name="testResult" ref="testResult" />
+ </bean>
+
</beans>
\ No newline at end of file
<import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
+ <import
+ resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />
+
</beans>
\ No newline at end of file
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
\r
-<!-- \r
- <bean id="testLaunch" class="org.argeo.slc.execution.old.TestLaunch"\r
- p:flowName="main" init-method="launch" />\r
--->\r
-\r
<bean id="executionModule" class="org.argeo.slc.osgi.OsgiExecutionModule" />\r
\r
- <bean id="main" class="org.argeo.slc.core.execution.SimpleExecutionFlow">\r
+ <bean id="main" parent="slcTemplate.simpleFlow">\r
<property name="executionSpec">\r
- <bean class="org.argeo.slc.core.execution.SimpleExecutionSpec">\r
+ <bean parent="slcTemplate.simpleSpec">\r
<property name="attributes">\r
<map>\r
<entry key="testKey">\r
- <bean parent="specAttribute" p:value="660" />\r
+ <bean parent="specAttr.primitive" p:value="660" />\r
</entry>\r
</map>\r
</property>\r
<ref bean="basic.001" />\r
<ref bean="basic.001" />\r
<ref bean="basic.002" />\r
+ <ref bean="canonic.001" />\r
+ <ref bean="canonic.002" />\r
</list>\r
</property>\r
</bean>\r
\r
- <bean id="echo1" parent="echoTemplate" scope="execution">\r
+ <bean id="echo1" parent="task.echo" scope="execution">\r
<property name="message"\r
value="From main! @{testKey}, slc.flows=@{slc.flows}" />\r
<aop:scoped-proxy />\r
</bean>\r
-\r
- <bean id="echoTemplate" class="org.argeo.slc.core.execution.tasks.Echo"\r
- abstract="true">\r
- </bean>\r
-\r
</beans>
\ No newline at end of file
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
\r
- <bean id="basic.001" parent="basic.executionFlowTemplate">\r
+ <bean id="basic.001" parent="basic.flowTemplate">\r
<constructor-arg>\r
<map>\r
<entry key="testData1" value-ref="basic.001.testData" />\r
\r
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
\r
- <bean id="basic.002" parent="basic.executionFlowTemplate">\r
+ <bean id="basic.002" parent="basic.flowTemplate">\r
<constructor-arg>\r
<map>\r
<entry key="testData1">\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="\r
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
+\r
+ <bean id="canonic.001" parent="canonic.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="parameterAtInstantiation" value="1" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+</beans>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans xmlns="http://www.springframework.org/schema/beans"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"\r
+ xmlns:aop="http://www.springframework.org/schema/aop"\r
+ xsi:schemaLocation="\r
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd\r
+ http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd\r
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
+\r
+ <bean id="canonic.002" parent="canonic.flowTemplate">\r
+ <constructor-arg>\r
+ <map>\r
+ <entry key="parameterAtInstantiation" value="2" />\r
+ <entry key="displayWithoutControl" value="102" />\r
+ <entry key="displayWithControl" value="202" />\r
+ <entry key="hide" value="202" />\r
+ </map>\r
+ </constructor-arg>\r
+ </bean>\r
+</beans>\r
package org.argeo.slc.demo.basic;
+import java.util.Map;
+
import junit.framework.TestCase;
import org.argeo.slc.core.execution.ExecutionContext;
-import org.argeo.slc.core.execution.NewExecutionEvent;
import org.argeo.slc.execution.ExecutionFlow;
-import org.argeo.slc.process.SlcExecution;
+import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public class BasicExecutionTest extends TestCase {
public void testExecution() throws Exception {
- String[] files = { "conf/main.xml", "conf/imports.xml",
- "conf/common.xml", "conf/basic.xml",
- "conf/testCases/basic-001.xml", "conf/testCases/basic-002.xml" };
+ String[] files = { "conf/imports.xml", "conf/common.xml",
+ "conf/basic.xml", "conf/canonic.xml",
+ "conf/testCases/basic-001.xml", "conf/testCases/basic-002.xml",
+ "conf/testCases/canonic-001.xml",
+ "conf/testCases/canonic-002.xml", "conf/main.xml" };
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
files);
applicationContext.start();
+ // GenericBeanFactoryAccessor accessor = new
+ // GenericBeanFactoryAccessor(applicationContext);
+ // Map<String, Execut>
+
String bean = "main";
ExecutionContext.registerExecutionContext(new ExecutionContext());
ExecutionContext.getVariables().put("slc.flows", bean);
.getBean(bean);
executionFlow.execute();
-// SlcExecution slcExecution = new SlcExecution();
-// slcExecution.getAttributes().put("slc.flows", "main");
-// applicationContext.publishEvent(new NewExecutionEvent(this,
-// slcExecution));
-//
-// Thread.sleep(5000);
+ // SlcExecution slcExecution = new SlcExecution();
+ // slcExecution.getAttributes().put("slc.flows", "main");
+ // applicationContext.publishEvent(new NewExecutionEvent(this,
+ // slcExecution));
+ //
+ // Thread.sleep(5000);
applicationContext.close();
}
http://www.springframework.org/schema/beans \r
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
\r
- <list id="executionModules" interface="org.argeo.slc.execution.ExecutionModule" />\r
+ <list id="executionModules" interface="org.argeo.slc.execution.ExecutionModule"\r
+ cardinality="0..N" />\r
</beans:beans>
\ No newline at end of file
package org.argeo.slc.demo.manager;
+import java.net.URI;
+import java.net.URISyntaxException;
+
import javax.jms.ConnectionFactory;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;
import javax.jms.TextMessage;
+import org.apache.activemq.broker.BrokerService;
+import org.apache.activemq.broker.TransportConnector;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.xbean.spring.context.ClassPathXmlApplicationContext;
-import org.springframework.beans.BeansException;
-import org.springframework.jms.JmsException;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
* @param args
*/
public static void main(String[] args) {
+// BrokerService broker;
+// try {
+// broker = new BrokerService();
+// broker.setPersistent(false);
+// TransportConnector transportConnector = new TransportConnector();
+// transportConnector.setUri(new URI("tcp://localhost:61616"));
+// broker.addConnector(transportConnector);
+// broker.start();
+//
+// Thread.sleep(5000);
+// } catch (URISyntaxException e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// } catch (Exception e1) {
+// // TODO Auto-generated catch block
+// e1.printStackTrace();
+// }
+
ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
"org/argeo/slc/activemq/spring.xml");
try {
+
ConnectionFactory connectionFactory = (ConnectionFactory) applicationContext
.getBean("slcDefault.jms.connectionFactory");
JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);
}
private static void info(Object obj) {
- System.out.println("[INFO] " + obj);
+ //System.out.println("[INFO] " + obj);
}
private static void bundleInstallWarn(Object obj) {
<artifactId>com.springsource.org.apache.activemq.web</artifactId>
<version>${version.activemq}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>com.springsource.org.apache.activemq.pool</artifactId>
+ <version>${version.activemq}</version>
+ </dependency>
<!--
<dependency> <groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
<artifactId>com.springsource.org.apache.xbean.spring</artifactId>
<version>3.3.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>com.springsource.org.apache.camel</artifactId>
+ <version>1.3.0</version>
+ </dependency>
</dependencies>
</dependencyManagement>
<Export-Package>
org.argeo.slc.*
</Export-Package>
+ <Import-Package>*,
+ org.hibernate.proxy;resolution:="optional"
+ </Import-Package>
</instructions>
</configuration>
</plugin>
import org.argeo.slc.process.Executable;
-public interface ExecutionFlow extends Executable{
- public Object getParameter(String name);
+public interface ExecutionFlow extends Executable {
+ public Object getParameter(String key);
+
+ public Boolean isSetAsParameter(String key);
+
public ExecutionSpec getExecutionSpec();
+
public String getName();
}
public interface ExecutionSpecAttribute {
public Object getValue();
+
public Boolean getIsParameter();
+
+ public Boolean getIsFrozen();
+
+ public Boolean getIsHidden();
+
}
--- /dev/null
+package org.argeo.slc.castor.execution;
+
+import org.argeo.slc.core.execution.PrimitiveSpecAttribute;
+import org.argeo.slc.core.execution.PrimitiveValue;
+import org.exolab.castor.mapping.AbstractFieldHandler;
+
+public class PrimitiveFieldHandler extends AbstractFieldHandler {
+
+ @Override
+ public Object getValue(Object object) throws IllegalStateException {
+ if (object == null)
+ return null;
+
+ Object value = null;
+ if (object instanceof PrimitiveSpecAttribute)
+ value = ((PrimitiveSpecAttribute) object).getValue();
+ else if (object instanceof PrimitiveValue)
+ value = ((PrimitiveValue) object).getValue();
+ else
+ throw new IllegalStateException("Unkown type " + object.getClass());
+
+ return value != null ? value.toString() : null;
+ }
+
+ @Override
+ public Object newInstance(Object parent, Object[] args)
+ throws IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object newInstance(Object parent) throws IllegalStateException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void resetValue(Object object) throws IllegalStateException,
+ IllegalArgumentException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setValue(Object object, Object value)
+ throws IllegalStateException, IllegalArgumentException {
+ // TODO: could probably be more generic
+
+ PrimitiveSpecAttribute attr = (PrimitiveSpecAttribute) object;
+ String type = attr.getType();
+ String str = value.toString();
+
+ // FIXME: generalize
+ if (object instanceof PrimitiveSpecAttribute)
+ ((PrimitiveSpecAttribute) object).setValue(convert(type, str));
+ else if (object instanceof PrimitiveValue)
+ ((PrimitiveValue) object).setValue(convert(type, str));
+ else
+ throw new IllegalStateException("Unkown type " + object.getClass());
+ }
+
+ protected Object convert(String type, String str) {
+ if (PrimitiveSpecAttribute.TYPE_STRING.equals(type)) {
+ return str;
+ } else if (PrimitiveSpecAttribute.TYPE_INTEGER.equals(type)) {
+ return (Integer.parseInt(str));
+ } else if (PrimitiveSpecAttribute.TYPE_LONG.equals(type)) {
+ return (Long.parseLong(str));
+ } else if (PrimitiveSpecAttribute.TYPE_FLOAT.equals(type)) {
+ return (Float.parseFloat(str));
+ } else if (PrimitiveSpecAttribute.TYPE_DOUBLE.equals(type)) {
+ return (Double.parseDouble(str));
+ } else if (PrimitiveSpecAttribute.TYPE_BOOLEAN.equals(type)) {
+ return (Boolean.parseBoolean(str));
+ } else {
+ return str;
+ }
+ }
+}
<field name="key" type="string">\r
<bind-xml name="key" node="attribute" />\r
</field>\r
- <field name="value" type="string">\r
- <bind-xml node="text" />\r
+ <field name="value">\r
+ <bind-xml auto-naming="deriveByClass" />\r
</field>\r
</class>\r
</bind-xml>\r
</field>\r
</class>\r
\r
- <class name="org.argeo.slc.core.execution.SimpleExecutionSpec">\r
+ <!-- Specs -->\r
+ <class name="org.argeo.slc.core.execution.DefaultExecutionSpec">\r
<map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
ns-prefix="slc" />\r
<field name="name" identity="true">\r
<field name="isParameter">\r
<bind-xml name="isParameter" node="attribute" />\r
</field>\r
+ <field name="isFrozen">\r
+ <bind-xml name="isFrozen" node="attribute" />\r
+ </field>\r
+ <field name="isHidden">\r
+ <bind-xml name="isHidden" node="attribute" />\r
+ </field>\r
</class>\r
\r
- <class name="org.argeo.slc.core.execution.SimpleSpecAttribute"\r
- extends="org.argeo.slc.execution.AbstractSpecAttribute">\r
+ <class name="org.argeo.slc.core.execution.PrimitiveSpecAttribute"\r
+ extends="org.argeo.slc.core.execution.AbstractSpecAttribute">\r
<map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
ns-prefix="slc" />\r
- <field name="value" />\r
+ <field name="type">\r
+ <bind-xml name="type" node="attribute" />\r
+ </field>\r
+ <field name="value" type="string"\r
+ handler="org.argeo.slc.castor.execution.PrimitiveFieldHandler" />\r
</class>\r
\r
- <class name="org.argeo.slc.core.execution.RefSpecAttribute" extends="org.argeo.slc.execution.AbstractSpecAttribute">\r
+ <class name="org.argeo.slc.core.execution.RefSpecAttribute"\r
+ extends="org.argeo.slc.core.execution.AbstractSpecAttribute">\r
<map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
ns-prefix="slc" />\r
<field name="targetClassName">\r
<bind-xml name="targetClassName" node="attribute" />\r
</field>\r
</class>\r
+\r
+ <!-- Values -->\r
+ <class name="org.argeo.slc.core.execution.PrimitiveValue">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="type">\r
+ <bind-xml name="type" node="attribute" />\r
+ </field>\r
+ <field name="value" type="string"\r
+ handler="org.argeo.slc.castor.execution.PrimitiveFieldHandler" />\r
+ </class>\r
+\r
+ <class name="org.argeo.slc.core.execution.RefValue">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="label" />\r
+ </class>\r
</mapping>
\ No newline at end of file
import java.util.List;
import java.util.Map;
-import org.argeo.slc.core.execution.SimpleExecutionFlow;
+import org.argeo.slc.core.execution.DefaultExecutionFlow;
import org.argeo.slc.execution.ExecutionFlow;
import org.argeo.slc.process.Executable;
public ExecutionFlow createExecutionFlow(Map<String, Object> attributes){
- SimpleExecutionFlow executionFlow = new SimpleExecutionFlow();
+ DefaultExecutionFlow executionFlow = new DefaultExecutionFlow();
executionFlow.setExecutables(executables);
return executionFlow;
}
org.argeo.slc.*,org.argeo.slc.core.test.spring
</Export-Package>
<Import-Package>*,org.apache.commons.logging;version="1.1",
+ org.hibernate.proxy;resolution:="optional",
org.dbunit;resolution:="optional",
org.dbunit.database;resolution:="optional",
org.dbunit.dataset;resolution:="optional",
import org.argeo.slc.execution.ExecutionSpecAttribute;
public abstract class AbstractSpecAttribute implements ExecutionSpecAttribute {
- private Boolean isParameter = true;
+ private Boolean isParameter = false;
+ private Boolean isFrozen = false;
+ private Boolean isHidden = false;
+ /** Has to be set at instantiation */
public Boolean getIsParameter() {
return isParameter;
}
this.isParameter = isParameter;
}
+ /** Cannot be overridden at runtime */
+ public Boolean getIsFrozen() {
+ return isFrozen;
+ }
+
+ public void setIsFrozen(Boolean isFinal) {
+ this.isFrozen = isFinal;
+ }
+
+ /** Should not be shown to the end user */
+ public Boolean getIsHidden() {
+ return isHidden;
+ }
+
+ public void setIsHidden(Boolean isHidden) {
+ this.isHidden = isHidden;
+ }
+
}
import java.util.HashMap;
import java.util.Map;
+import java.util.TreeMap;
+import org.argeo.slc.SlcException;
import org.argeo.slc.execution.ExecutionFlow;
import org.argeo.slc.execution.ExecutionFlowDescriptor;
import org.argeo.slc.execution.ExecutionModule;
import org.argeo.slc.execution.ExecutionSpec;
import org.argeo.slc.execution.ExecutionSpecAttribute;
import org.argeo.slc.process.SlcExecution;
+import org.springframework.aop.scope.ScopedObject;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor;
import org.springframework.context.ApplicationContext;
Assert.notNull(executionSpec);
Assert.notNull(executionSpec.getName());
- Map<String, Object> values = new HashMap<String, Object>();
+ Map<String, Object> values = new TreeMap<String, Object>();
for (String key : executionSpec.getAttributes().keySet()) {
ExecutionSpecAttribute attribute = executionSpec
.getAttributes().get(key);
- if (attribute instanceof SimpleExecutionSpec
- && attribute.getIsParameter()) {
- values.put(key, executionFlow.getParameter(key));
+
+ if (executionFlow.isSetAsParameter(key)) {
+ Object value = executionFlow.getParameter(key);
+ if (attribute instanceof PrimitiveSpecAttribute) {
+ PrimitiveValue primitiveValue = new PrimitiveValue();
+ primitiveValue
+ .setType(((PrimitiveSpecAttribute) attribute)
+ .getType());
+ primitiveValue.setValue(value);
+ values.put(key, primitiveValue);
+ } else if (attribute instanceof RefSpecAttribute) {
+ RefValue refValue = new RefValue();
+ if (value instanceof ScopedObject) {
+ refValue.setLabel("RUNTIME "
+ + value.getClass().getName());
+ } else {
+ refValue.setLabel("STATIC "
+ + value.getClass().getName());
+ }
+ values.put(key, refValue);
+ } else {
+ throw new SlcException("Unkown spec attribute type "
+ + attribute.getClass());
+ }
}
+
}
ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(name,
values, executionSpec);
+ // Add execution spec if necessary
if (!md.getExecutionSpecs().contains(executionSpec))
md.getExecutionSpecs().add(executionSpec);
+
+ // Add execution flow
md.getExecutionFlows().add(efd);
}
--- /dev/null
+package org.argeo.slc.core.execution;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.commons.lang.math.RandomUtils;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.execution.ExecutionSpec;
+import org.argeo.slc.execution.ExecutionSpecAttribute;
+import org.argeo.slc.process.Executable;
+import org.argeo.slc.test.ExecutableTestRun;
+import org.springframework.beans.factory.BeanNameAware;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.validation.MapBindingResult;
+
+public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
+ BeanNameAware {
+ private ExecutionSpec executionSpec = new DefaultExecutionSpec();
+ private String name = null;
+ private Map<String, Object> parameters = new HashMap<String, Object>();
+ private List<Executable> executables = new ArrayList<Executable>();
+
+ public DefaultExecutionFlow() {
+
+ }
+
+ public DefaultExecutionFlow(Map<String, Object> parameters) {
+ this.parameters.putAll(parameters);
+ }
+
+ public void execute() {
+ for (Executable executable : executables) {
+ executable.execute();
+ }
+ }
+
+ public void afterPropertiesSet() throws Exception {
+ // Validate execution specs
+ if (executionSpec == null)
+ return;
+
+ MapBindingResult errors = new MapBindingResult(parameters, "execution#"
+ + getName());
+ for (String key : executionSpec.getAttributes().keySet()) {
+ ExecutionSpecAttribute attr = executionSpec.getAttributes()
+ .get(key);
+
+ if (attr.getIsParameter() && !isSetAsParameter(key)) {
+ errors.rejectValue(key, "Parameter not set");
+ break;
+ }
+
+ if (attr.getIsFrozen() && !isSetAsParameter(key)) {
+ errors.rejectValue(key, "Frozen but not set as parameter");
+ break;
+ }
+
+ if (attr.getIsHidden() && !isSetAsParameter(key)) {
+ errors.rejectValue(key, "Hidden but not set as parameter");
+ break;
+ }
+
+ /*
+ * if (!parameters.containsKey(key)) { Object defaultValue =
+ * attr.getValue(); if (defaultValue == null)
+ * errors.rejectValue(key, "Not set and no default value"); else
+ * parameters.put(key, defaultValue); } else {// contains key Object
+ * obj = parameters.get(key); if (attr instanceof RefSpecAttribute)
+ * { RefSpecAttribute rsa = (RefSpecAttribute) attr; // TODO: make
+ * sure this will not cause pb with OSGi Class targetClass =
+ * rsa.getTargetClass(); if
+ * (!targetClass.isAssignableFrom(obj.getClass())) {
+ * errors.reject(key + " not compatible with target class " +
+ * targetClass); } } }
+ */
+ }
+
+ if (errors.hasErrors())
+ throw new SlcException("Could not prepare execution flow: "
+ + errors.toString());
+ }
+
+ public void setBeanName(String name) {
+ this.name = name;
+ }
+
+ public void setExecutables(List<Executable> executables) {
+ this.executables = executables;
+ }
+
+ public void setExecutionSpec(ExecutionSpec executionSpec) {
+ this.executionSpec = executionSpec;
+ }
+
+ public void setParameters(Map<String, Object> attributes) {
+ this.parameters = attributes;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public ExecutionSpec getExecutionSpec() {
+ return executionSpec;
+ }
+
+ public Object getParameter(String name) {
+ if (parameters.containsKey(name)) {
+ return parameters.get(name);
+ } else {
+ if (executionSpec.getAttributes().containsKey(name)) {
+ ExecutionSpecAttribute esa = executionSpec.getAttributes().get(
+ name);
+ if (esa.getValue() != null)
+ return esa.getValue();
+ } else {
+ throw new SlcException("Key " + name
+ + " is not defined in the specifications of "
+ + toString());
+ }
+ }
+ throw new SlcException("Key " + name + " is not set as parameter in "
+ + toString());
+ }
+
+ public Boolean isSetAsParameter(String key) {
+ return parameters.containsKey(key)
+ || (executionSpec.getAttributes().containsKey(key) && executionSpec
+ .getAttributes().get(key).getValue() != null);
+ }
+
+ public String toString() {
+ return new StringBuffer("Flow ").append(name).toString();
+ }
+
+ public boolean equals(Object obj) {
+ return ((ExecutionFlow) obj).getName().equals(name);
+ }
+}
--- /dev/null
+package org.argeo.slc.core.execution;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.SlcException;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.execution.ExecutionSpec;
+import org.argeo.slc.execution.ExecutionSpecAttribute;
+import org.springframework.beans.factory.BeanNameAware;
+
+public class DefaultExecutionSpec implements ExecutionSpec, BeanNameAware {
+ private final static Log log = LogFactory.getLog(DefaultExecutionSpec.class);
+
+ private final static ThreadLocal<ExecutionFlow> initializingFlow = new ThreadLocal<ExecutionFlow>();
+
+ private Map<String, ExecutionSpecAttribute> attributes = new HashMap<String, ExecutionSpecAttribute>();
+
+ private String name = null;
+
+ public Map<String, ExecutionSpecAttribute> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, ExecutionSpecAttribute> attributes) {
+ this.attributes = attributes;
+ }
+
+ public Object createRef(String name) {
+ ExecutionFlow flow = initializingFlow.get();
+ if (flow == null)
+ throw new SlcException("No flow is currently initializing."
+ + " Declare flow refs as inner beans or prototypes.");
+ /*
+ * RefSpecAttribute refSpecAttribute = (RefSpecAttribute) attributes
+ * .get(name); Class<?> targetClass = refSpecAttribute.getTargetClass();
+ * ExecutionTargetSource targetSource = new ExecutionTargetSource(flow,
+ * targetClass, name); ProxyFactory proxyFactory = new ProxyFactory();
+ * proxyFactory.setTargetClass(targetClass);
+ * proxyFactory.setProxyTargetClass(true);
+ * proxyFactory.setTargetSource(targetSource);
+ *
+ * return proxyFactory.getProxy();
+ */
+ return flow.getParameter(name);
+ }
+
+ public void setBeanName(String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ // FLOWS INITIALIZATION SUPPORT
+
+ public static void flowInitializationStarted(ExecutionFlow flow) {
+ if (log.isTraceEnabled())
+ log.trace("Start initialization of " + flow.hashCode() + " ("
+ + flow + " - " + flow.getClass() + ")");
+ initializingFlow.set(flow);
+ }
+
+ public static void flowInitializationFinished(ExecutionFlow flow) {
+ if (log.isTraceEnabled())
+ log.trace("Finish initialization of " + flow.hashCode() + " ("
+ + flow + " - " + flow.getClass() + ")");
+ ExecutionFlow registeredFlow = initializingFlow.get();
+ if (registeredFlow != null) {
+ if (!flow.getName().equals(registeredFlow.getName()))
+ throw new SlcException("Current flow is " + flow);
+ initializingFlow.set(null);
+ }
+ }
+
+ public static Object getInitializingFlowParameter(String key) {
+ if (initializingFlow.get() == null)
+ throw new SlcException("No initializing flow available.");
+ return initializingFlow.get().getParameter(key);
+ }
+
+ public static Boolean isInFlowInitialization() {
+ return initializingFlow.get() != null;
+ }
+
+ public boolean equals(Object obj) {
+ return ((ExecutionSpec) obj).getName().equals(name);
+ }
+
+}
Map<String, ExecutionSpecAttribute> specAttrs = executionFlow
.getExecutionSpec().getAttributes();
for (String key : specAttrs.keySet()) {
- ExecutionSpecAttribute esa = specAttrs.get(key);
- if (esa.getIsParameter()) {
+ //ExecutionSpecAttribute esa = specAttrs.get(key);
+ if (executionFlow.isSetAsParameter(key)) {
runtime.getLocalVariables().put(key,
executionFlow.getParameter(key));
if (log.isTraceEnabled())
public PropertyValues postProcessPropertyValues(PropertyValues pvs,
PropertyDescriptor[] pds, Object bean, String beanName)
throws BeansException {
- if (!ExecutionContext.isExecuting())
+ if (!ExecutionContext.isExecuting()){
+ //&& !DefaultExecutionSpec.isInFlowInitialization()) {
+ //log.info("Skip parameter conversion for bean " + beanName);
return pvs;
-
-// ExecutionFlow currentFlow = ExecutionContext.getCurrentFlow();
-//
-// Properties props = new Properties();
-// Map<String, Object> attributes = currentFlow.getAttributes();
-// Map<String, ExecutionSpecAttribute> specAttributes = currentFlow
-// .getExecutionSpec().getAttributes();
-//
-// for (String key : specAttributes.keySet()) {
-// ExecutionSpecAttribute obj = specAttributes.get(key);
-// if (!(obj instanceof RefSpecAttribute)) {
-// if (!attributes.containsKey(key))
-// throw new SlcException("Specified attribute " + key
-// + " is not set in " + currentFlow);
-//
-// props.setProperty(key, attributes.get(key).toString());
-// // if (log.isTraceEnabled())
-// // log.trace("Use attribute " + key);
-// }
-// }
+ } else {
+ //log.info("Execute parameter conversion for bean " + beanName);
+ }
Properties props = new Properties();
CustomPpc ppc = new CustomPpc(props);
for (PropertyValue pv : pvs.getPropertyValues()) {
+// log.info(" PropertyValue pv " + pv.getValue() + " - "
+// + pv.getValue().getClass());
+ String originalValue = null;
+ String convertedValue = null;
if (pv.getValue() instanceof TypedStringValue) {
TypedStringValue tsv = (TypedStringValue) pv.getValue();
- String originalValue = tsv.getValue();
- String convertedValue = ppc.process(originalValue);
+ originalValue = tsv.getValue();
+ convertedValue = ppc.process(originalValue);
tsv.setValue(convertedValue);
- if (log.isTraceEnabled()) {
- if (!originalValue.equals(convertedValue))
- log.trace("Converted field '" + pv.getName() + "': '"
- + originalValue + "' to '" + convertedValue
- + "' in bean " + beanName);
- }
- } else {
- // if (log.isTraceEnabled())
- // log.trace(beanName + "[" + pv.getName() + "]: "
- // + pv.getValue().getClass());
+ } else if (pv.getValue() instanceof String) {
+ originalValue = pv.getValue().toString();
+ convertedValue = ppc.process(originalValue);
+ pv.setConvertedValue(convertedValue);
+ }
+ if (convertedValue != null && log.isTraceEnabled()) {
+ if (!originalValue.equals(convertedValue))
+ log.trace("Converted field '" + pv.getName() + "': '"
+ + originalValue + "' to '" + convertedValue
+ + "' in bean " + beanName);
}
}
@Override
protected String resolvePlaceholder(String placeholder, Properties props) {
+ //log.info("Try convert placeholder " + placeholder);
if (ExecutionContext.isExecuting())
return ExecutionContext.getVariable(placeholder).toString();
- else if (SimpleExecutionSpec.isInFlowInitialization())
- return SimpleExecutionSpec.getInitializingFlowParameter(
+ else if (DefaultExecutionSpec.isInFlowInitialization())
+ return DefaultExecutionSpec.getInitializingFlowParameter(
placeholder).toString();
else
return super.resolvePlaceholder(placeholder, props);
public boolean postProcessAfterInstantiation(Object bean, String beanName)
throws BeansException {
if (bean instanceof ExecutionFlow)
- SimpleExecutionSpec.flowInitializationStarted((ExecutionFlow) bean);
+ DefaultExecutionSpec
+ .flowInitializationStarted((ExecutionFlow) bean);
return true;
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName)
throws BeansException {
+ return bean;
+ }
+
+ @Override
+ public Object postProcessAfterInitialization(Object bean, String beanName)
+ throws BeansException {
if (bean instanceof ExecutionFlow)
- SimpleExecutionSpec
+ DefaultExecutionSpec
.flowInitializationFinished((ExecutionFlow) bean);
return bean;
}
+
}
--- /dev/null
+package org.argeo.slc.core.execution;
+
+public class PrimitiveSpecAttribute extends AbstractSpecAttribute {
+// public enum Type {
+// string, integer
+// }
+
+ public final static String TYPE_STRING = "string";
+ public final static String TYPE_INTEGER = "integer";
+ public final static String TYPE_LONG = "long";
+ public final static String TYPE_FLOAT = "float";
+ public final static String TYPE_DOUBLE = "double";
+ public final static String TYPE_BOOLEAN = "boolean";
+
+ private String type = "string";
+ private Object value = null;
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.core.execution;
+
+public class PrimitiveValue {
+ private String type;
+
+ private Object value;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+ public void setValue(Object value) {
+ this.value = value;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.core.execution;
+
+public class RefValue {
+ private String label;
+
+ public String getLabel() {
+ return label;
+ }
+
+ public void setLabel(String label) {
+ this.label = label;
+ }
+
+}
+++ /dev/null
-package org.argeo.slc.core.execution;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.commons.lang.math.RandomUtils;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.execution.ExecutionFlow;
-import org.argeo.slc.execution.ExecutionSpec;
-import org.argeo.slc.execution.ExecutionSpecAttribute;
-import org.argeo.slc.process.Executable;
-import org.argeo.slc.test.ExecutableTestRun;
-import org.springframework.beans.factory.BeanNameAware;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.validation.MapBindingResult;
-
-public class SimpleExecutionFlow implements ExecutionFlow, InitializingBean,
- BeanNameAware {
- private ExecutionSpec executionSpec = new SimpleExecutionSpec();
- private String name = null;
- private Map<String, Object> parameters = new HashMap<String, Object>();
- private List<Executable> executables = new ArrayList<Executable>();
-
- public SimpleExecutionFlow() {
-
- }
-
- public SimpleExecutionFlow(Map<String, Object> parameters) {
- this.parameters.putAll(parameters);
- }
-
- public void execute() {
- for (Executable executable : executables) {
- executable.execute();
- }
- }
-
- public void afterPropertiesSet() throws Exception {
- // Validate execution specs
- if (executionSpec == null)
- return;
-
- MapBindingResult errors = new MapBindingResult(parameters, "execution#"
- + getName());
- for (String key : executionSpec.getAttributes().keySet()) {
- ExecutionSpecAttribute executionSpecAttr = executionSpec
- .getAttributes().get(key);
- if (!parameters.containsKey(key)) {
- Object defaultValue = executionSpecAttr.getValue();
- if (defaultValue == null)
- errors.rejectValue(key, "Not set and no default value");
- else
- parameters.put(key, defaultValue);
- } else {// contains key
- Object obj = parameters.get(key);
- if (executionSpecAttr instanceof RefSpecAttribute) {
- RefSpecAttribute rsa = (RefSpecAttribute) executionSpecAttr;
- // TODO: make sure this will not cause pb with OSGi
- Class targetClass = rsa.getTargetClass();
- if (!targetClass.isAssignableFrom(obj.getClass())) {
- errors.reject(key
- + " not compatible with target class "
- + targetClass);
- }
- }
- }
- }
-
- if (errors.hasErrors())
- throw new SlcException("Could not prepare execution flow: "
- + errors.toString());
- }
-
- public void setBeanName(String name) {
- this.name = name;
- }
-
- public void setExecutables(List<Executable> executables) {
- this.executables = executables;
- }
-
- public void setExecutionSpec(ExecutionSpec executionSpec) {
- this.executionSpec = executionSpec;
- }
-
- public void setParameters(Map<String, Object> attributes) {
- this.parameters = attributes;
- }
-
- public String getName() {
- return name;
- }
-
- public ExecutionSpec getExecutionSpec() {
- return executionSpec;
- }
-
- public Object getParameter(String name) {
- if (parameters.containsKey(name)) {
- return parameters.get(name);
- } else {
- if (executionSpec.getAttributes().containsKey(name)) {
- ExecutionSpecAttribute esa = executionSpec.getAttributes().get(
- name);
- if (esa.getValue() != null)
- return esa.getValue();
- } else {
- throw new SlcException("Key " + name
- + " is not defined in the specifications of "
- + toString());
- }
- }
- throw new SlcException("Key " + name + " is not set as parameter in "
- + toString());
- }
-
- public String toString() {
- return new StringBuffer("Flow ").append(name).toString();
- }
-
- public boolean equals(Object obj) {
- return ((ExecutionFlow) obj).getName().equals(name);
- }
-}
+++ /dev/null
-package org.argeo.slc.core.execution;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.SlcException;
-import org.argeo.slc.execution.ExecutionFlow;
-import org.argeo.slc.execution.ExecutionSpec;
-import org.argeo.slc.execution.ExecutionSpecAttribute;
-import org.springframework.beans.factory.BeanNameAware;
-
-public class SimpleExecutionSpec implements ExecutionSpec, BeanNameAware {
- private final static Log log = LogFactory.getLog(SimpleExecutionSpec.class);
-
- private final static ThreadLocal<ExecutionFlow> initializingFlow = new ThreadLocal<ExecutionFlow>();
-
- private Map<String, ExecutionSpecAttribute> attributes = new HashMap<String, ExecutionSpecAttribute>();
-
- private String name = null;
-
- public Map<String, ExecutionSpecAttribute> getAttributes() {
- return attributes;
- }
-
- public void setAttributes(Map<String, ExecutionSpecAttribute> attributes) {
- this.attributes = attributes;
- }
-
- public Object createRef(String name) {
- ExecutionFlow flow = initializingFlow.get();
- if (flow == null)
- throw new SlcException("No flow is currently initializing."
- + " Declare flow refs as inner beans or prototypes.");
- /*
- * RefSpecAttribute refSpecAttribute = (RefSpecAttribute) attributes
- * .get(name); Class<?> targetClass = refSpecAttribute.getTargetClass();
- * ExecutionTargetSource targetSource = new ExecutionTargetSource(flow,
- * targetClass, name); ProxyFactory proxyFactory = new ProxyFactory();
- * proxyFactory.setTargetClass(targetClass);
- * proxyFactory.setProxyTargetClass(true);
- * proxyFactory.setTargetSource(targetSource);
- *
- * return proxyFactory.getProxy();
- */
- return flow.getParameter(name);
- }
-
- public void setBeanName(String name) {
- this.name = name;
- }
-
- public String getName() {
- return name;
- }
-
- // FLOWS INITIALIZATION SUPPORT
-
- public static void flowInitializationStarted(ExecutionFlow flow) {
- if (log.isTraceEnabled())
- log.trace("Start initialization of " + flow.hashCode() + " ("
- + flow + " - " + flow.getClass() + ")");
- initializingFlow.set(flow);
- }
-
- public static void flowInitializationFinished(ExecutionFlow flow) {
- if (log.isTraceEnabled())
- log.trace("Finish initialization of " + flow.hashCode() + " ("
- + flow + " - " + flow.getClass() + ")");
- ExecutionFlow registeredFlow = initializingFlow.get();
- if (registeredFlow != null) {
- if (!flow.getName().equals(registeredFlow.getName()))
- throw new SlcException("Current flow is " + flow);
- initializingFlow.set(null);
- }
- }
-
- public static Object getInitializingFlowParameter(String key) {
- if (initializingFlow.get() == null)
- throw new SlcException("No initializing flow available.");
- return initializingFlow.get().getParameter(key);
- }
-
- public static Boolean isInFlowInitialization() {
- return initializingFlow.get() != null;
- }
-
- public boolean equals(Object obj) {
- return ((ExecutionSpec) obj).getName().equals(name);
- }
-
-}
+++ /dev/null
-package org.argeo.slc.core.execution;
-
-public class SimpleSpecAttribute extends AbstractSpecAttribute {
- private Object value = null;
-
- public Object getValue() {
- return value;
- }
-
- public void setValue(Object value) {
- this.value = value;
- }
-}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="specAttr.primitive" class="org.argeo.slc.core.execution.PrimitiveSpecAttribute"
+ abstract="true" />
+ <bean id="specAttr.ref" class="org.argeo.slc.core.execution.RefSpecAttribute"
+ abstract="true" />
+
+ <bean id="slcTemplate.simpleFlow" class="org.argeo.slc.core.execution.DefaultExecutionFlow"
+ abstract="true" />
+ <bean id="slcTemplate.simpleSpec" class="org.argeo.slc.core.execution.DefaultExecutionSpec"
+ abstract="true" />
+
+</beans>
\ No newline at end of file
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang-2.5.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+ <import resource="specs.xml" />
+ <import resource="tasks/core.xml" />
+
<bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
<property name="scopes">
<map>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <bean id="task.echo" class="org.argeo.slc.core.execution.tasks.Echo"
+ abstract="true" />
+</beans>
\ No newline at end of file