<instructions>
<Import-Package>org.apache.commons.logging,org.springframework.beans.factory.config</Import-Package>
<Require-Bundle>org.argeo.slc.execution,org.argeo.slc.specs,org.argeo.slc.support.simple,org.springframework.aop,com.springsource.net.sf.cglib,com.springsource.org.aopalliance</Require-Bundle>
- <Spring-Context>conf/main.xml</Spring-Context>
+ <Spring-Context>conf/*,conf/testCases/*</Spring-Context>
</instructions>
</configuration>
+ <executions>
+ <execution>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ <phase>resources</phase>
+ </execution>
+ </executions>
</plugin>
</plugins>
</build>
<groupId>org.argeo.slc.runtime</groupId>
<artifactId>org.argeo.slc.support.simple</artifactId>
</dependency>
- <dependency>
- <groupId>org.argeo.slc</groupId>
- <artifactId>org.argeo.slc.detached.launcher</artifactId>
- <version>${project.version}</version>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.springframework.osgi</groupId>
- <artifactId>org.springframework.osgi.extender</artifactId>
- </dependency>
</dependencies>
</project>
--- /dev/null
+import org.argeo.slc.test.*;
+
+public class BasicExecutionFlow implements org.argeo.slc.executionflow.ExecutionFlow {
+
+ ExecutableTestRun firstSubTest = null;
+ ExecutableTestRun secondSubTest = null;
+
+ void execute(){
+ firstSubTest?.execute();
+ secondSubTest?.execute();
+ }
+}
+++ /dev/null
-Manifest-Version: 1.0\r
-Private-Package: conf;version="0.11.3-SNAPSHOT",conf.testCases;version\r
- ="0.11.3-SNAPSHOT"\r
-Tool: Bnd-0.0.255\r
-Bundle-Name: SLC Sandbox Execution Flow\r
-Created-By: 1.6.0_0 (Sun Microsystems Inc.)\r
-Require-Bundle: org.argeo.slc.execution,org.argeo.slc.specs,org.argeo.\r
- slc.support.simple,org.springframework.aop,com.springsource.net.sf.cg\r
- lib,com.springsource.org.aopalliance\r
-Bundle-Vendor: Argeo\r
-Bundle-Version: 0.11.3.SNAPSHOT\r
-Spring-Context: conf/main.xml\r
-Bundle-ManifestVersion: 2\r
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
-Import-Package: org.apache.commons.logging;version="1.1",org.springfra\r
- mework.beans.factory.config\r
-Bundle-SymbolicName: org.argeo.slc.sandbox.executionflow\r
-Bundle-DocURL: http://www.argeo.org\r
-Originally-Created-By: 1.6.0_0 (Sun Microsystems Inc.)\r
-\r
+++ /dev/null
-import org.argeo.slc.test.*;
-
-public class BasicExecutionFlow implements org.argeo.slc.executionflow.ExecutionFlow {
-
- ExecutableTestRun firstSubTest = null;
- ExecutableTestRun secondSubTest = null;
-
- void execute(){
- firstSubTest?.execute();
- secondSubTest?.execute();
- }
-}
<property name="attributes">\r
<map>\r
<entry key="testedComponentId">\r
- <bean parent="specAttribute" p:value="100" />\r
+ <bean parent="specAttribute" p:value="100" p:isParameter="true"/>\r
</entry>\r
<entry key="testData1">\r
<bean parent="refAttribute" p:targetClass="org.argeo.slc.core.test.BasicTestData" />\r
--- /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"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+ <import resource="classpath:org/argeo/slc/execution/spring.xml" />
+
+</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" xmlns:context="http://www.springframework.org/schema/context"\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/context http://www.springframework.org/schema/context/spring-context-2.5.xsd\r
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
\r
- <import resource="common.xml" />\r
-\r
- <import resource="basic.xml" />\r
- <import resource="testCases/basic-001.xml" />\r
- <import resource="testCases/basic-002.xml" />\r
-\r
+<!-- \r
<bean id="testLaunch" class="org.argeo.slc.execution.TestLaunch"\r
- p:flowName="main" init-method="launch"/>\r
+ p:flowName="main" init-method="launch" />\r
+-->\r
+\r
+ <bean id="executionModule" class="org.argeo.slc.execution.OsgiExecutionModule" />\r
\r
<bean id="main" class="org.argeo.slc.execution.SimpleExecutionFlow">\r
<property name="executionSpec">\r
abstract="true">\r
</bean>\r
\r
- <context:annotation-config />\r
- <bean class="org.argeo.slc.execution.ExecutionRegister" />\r
-\r
-\r
- <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">\r
- <property name="scopes">\r
- <map>\r
- <entry key="execution">\r
- <bean class="org.argeo.slc.execution.ExecutionScope" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean\r
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />\r
- <bean class="org.argeo.slc.execution.ExecutionParameterPostProcessor" />\r
- <bean class="org.argeo.slc.execution.InstantiationPostProcessor" />\r
- <bean class="org.argeo.slc.execution.Executor" />\r
-\r
- <bean class="org.argeo.slc.execution.ExecutionAspect"></bean>\r
- <aop:aspectj-autoproxy />\r
-\r
</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <service interface="org.argeo.slc.execution.ExecutionModule"\r
+ ref="executionModule" />\r
+</beans:beans>
\ No newline at end of file
+++ /dev/null
-log4j.rootLogger=WARN, console
-
-## Levels
-log4j.logger.org.argeo=DEBUG
-log4j.logger.org.argeo.slc.executionflow.ExecutionParameterPostProcessor=TRACE
-log4j.logger.org.argeo.slc.executionflow.ExecutionContext=TRACE
-
-## Appenders
-# console is set to be a ConsoleAppender.
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-
-# console uses PatternLayout.
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n
-
-testCase=002
\ 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:lang="http://www.springframework.org/schema/lang"\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
- ">\r
-\r
- <import\r
- resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />\r
-\r
- <import resource="testCases/basic-001.xml" />\r
- <import resource="testCases/basic-002.xml" />\r
-\r
- <bean id="executionFlow.basic1" class="org.argeo.slc.executionflow.SimpleExecutionFlow">\r
- <meta key="meta1" value="mata1Value" />\r
- <qualifier>\r
- <attribute key="qual1" value="qual1value" />\r
- </qualifier>\r
- <property name="executables">\r
- <list>\r
- <ref local="testGroovyImpl" />\r
- <ref local="testBshImpl" />\r
- <bean parent="testRun" p:testDefinition-ref="testDef"\r
- p:testData-ref="testData-${testCase}" />\r
- <bean parent="testRun" p:testDefinition-ref="testDef"\r
- p:testData-ref="testData-${testCase}" />\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <lang:groovy id="executionFlow.groovy1" script-source="src/slc/conf/BasicExecutionFlow.groovy">\r
- <lang:property name="firstSubTest">\r
- <bean parent="testRun" p:testDefinition-ref="testDef"\r
- p:testData-ref="testData-${testCase}" />\r
- </lang:property>\r
- </lang:groovy>\r
-\r
- <bean id="testGroovyImpl" parent="testGroovy">\r
- <property name="message" value="Hello World! Groovy" />\r
- </bean>\r
- <bean id="testBshImpl" parent="testBsh">\r
- <property name="message" value="Hello World! Beanshell" />\r
- </bean>\r
-\r
- <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition"\r
- scope="prototype" />\r
-\r
- <bean\r
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />\r
-\r
- <bean id="testResult" parent="slcDefault.test.basicSimpleTestResult">\r
- </bean>\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
- <lang:groovy id="testGroovyBean">\r
- <lang:inline-script><![CDATA[\r
- class Message {\r
- String message = 'test'\r
- \r
- public String getMessage(){\r
- return message;\r
- }\r
- }\r
- ]]></lang:inline-script>\r
- </lang:groovy>\r
-\r
- <lang:groovy id="testGroovy">\r
- <lang:inline-script><![CDATA[\r
- class GroovyMessenger extends org.argeo.slc.core.test.SimpleTestRun {\r
- \r
- String message = 'test'\r
- \r
- void execute(){\r
- println(message);\r
- }\r
- }\r
- ]]></lang:inline-script>\r
- </lang:groovy>\r
-\r
- <lang:bsh id="testBsh" script-interfaces="org.argeo.slc.test.ExecutableTestRun">\r
- <lang:inline-script><![CDATA[\r
- setStrictJava(true);\r
-\r
- class BshMessenger extends org.argeo.slc.core.test.SimpleTestRun {\r
-\r
- String message = "test";\r
-\r
- public void execute(){\r
- System.out.println(message);\r
- }\r
- \r
- public void setMessage(String message){\r
- this.message = message;\r
- }\r
- }\r
- ]]></lang:inline-script>\r
- </lang:bsh>\r
-\r
-</beans>
\ No newline at end of file
--- /dev/null
+log4j.rootLogger=WARN, console
+
+## Levels
+log4j.logger.org.argeo=DEBUG
+log4j.logger.org.argeo.slc.executionflow.ExecutionParameterPostProcessor=TRACE
+log4j.logger.org.argeo.slc.executionflow.ExecutionContext=TRACE
+
+## Appenders
+# console is set to be a ConsoleAppender.
+log4j.appender.console=org.apache.log4j.ConsoleAppender
+
+# console uses PatternLayout.
+log4j.appender.console.layout=org.apache.log4j.PatternLayout
+log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n
+
+testCase=002
\ 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:lang="http://www.springframework.org/schema/lang"\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
+ ">\r
+\r
+ <import\r
+ resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />\r
+\r
+ <import resource="testCases/basic-001.xml" />\r
+ <import resource="testCases/basic-002.xml" />\r
+\r
+ <bean id="executionFlow.basic1" class="org.argeo.slc.executionflow.SimpleExecutionFlow">\r
+ <meta key="meta1" value="mata1Value" />\r
+ <qualifier>\r
+ <attribute key="qual1" value="qual1value" />\r
+ </qualifier>\r
+ <property name="executables">\r
+ <list>\r
+ <ref local="testGroovyImpl" />\r
+ <ref local="testBshImpl" />\r
+ <bean parent="testRun" p:testDefinition-ref="testDef"\r
+ p:testData-ref="testData-${testCase}" />\r
+ <bean parent="testRun" p:testDefinition-ref="testDef"\r
+ p:testData-ref="testData-${testCase}" />\r
+ </list>\r
+ </property>\r
+ </bean>\r
+\r
+ <lang:groovy id="executionFlow.groovy1" script-source="src/slc/conf/BasicExecutionFlow.groovy">\r
+ <lang:property name="firstSubTest">\r
+ <bean parent="testRun" p:testDefinition-ref="testDef"\r
+ p:testData-ref="testData-${testCase}" />\r
+ </lang:property>\r
+ </lang:groovy>\r
+\r
+ <bean id="testGroovyImpl" parent="testGroovy">\r
+ <property name="message" value="Hello World! Groovy" />\r
+ </bean>\r
+ <bean id="testBshImpl" parent="testBsh">\r
+ <property name="message" value="Hello World! Beanshell" />\r
+ </bean>\r
+\r
+ <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition"\r
+ scope="prototype" />\r
+\r
+ <bean\r
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />\r
+\r
+ <bean id="testResult" parent="slcDefault.test.basicSimpleTestResult">\r
+ </bean>\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
+ <lang:groovy id="testGroovyBean">\r
+ <lang:inline-script><![CDATA[\r
+ class Message {\r
+ String message = 'test'\r
+ \r
+ public String getMessage(){\r
+ return message;\r
+ }\r
+ }\r
+ ]]></lang:inline-script>\r
+ </lang:groovy>\r
+\r
+ <lang:groovy id="testGroovy">\r
+ <lang:inline-script><![CDATA[\r
+ class GroovyMessenger extends org.argeo.slc.core.test.SimpleTestRun {\r
+ \r
+ String message = 'test'\r
+ \r
+ void execute(){\r
+ println(message);\r
+ }\r
+ }\r
+ ]]></lang:inline-script>\r
+ </lang:groovy>\r
+\r
+ <lang:bsh id="testBsh" script-interfaces="org.argeo.slc.test.ExecutableTestRun">\r
+ <lang:inline-script><![CDATA[\r
+ setStrictJava(true);\r
+\r
+ class BshMessenger extends org.argeo.slc.core.test.SimpleTestRun {\r
+\r
+ String message = "test";\r
+\r
+ public void execute(){\r
+ System.out.println(message);\r
+ }\r
+ \r
+ public void setMessage(String message){\r
+ this.message = message;\r
+ }\r
+ }\r
+ ]]></lang:inline-script>\r
+ </lang:bsh>\r
+\r
+</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.argeo.slc.demo.basic</name>
+ <name>org.argeo.slc.demo.manager</name>
<comment></comment>
<projects>
</projects>
</configSuffixes>
<enableImports><![CDATA[true]]></enableImports>
<configs>
+ <config>src/main/resources/conf/manager-osgi.xml</config>
+ <config>src/main/resources/conf/manager.xml</config>
</configs>
<configSets>
</configSets>
<relativePath>../../org.argeo.slc</relativePath>
</parent>
<groupId>org.argeo.slc.demo</groupId>
- <artifactId>org.argeo.slc.demo.basic</artifactId>
- <name>SLC Demo Basic Test Module</name>
- <packaging>jar</packaging>
+ <artifactId>org.argeo.slc.demo.manager</artifactId>
+ <name>SLC Demo Manager</name>
+ <packaging>bundle</packaging>
<properties></properties>
<build>
<plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Import-Package>org.apache.commons.logging,org.springframework.beans.factory.config</Import-Package>
- <Require-Bundle>org.argeo.slc.execution,org.argeo.slc.specs,org.argeo.slc.support.simple,org.springframework.aop,com.springsource.net.sf.cglib,com.springsource.org.aopalliance</Require-Bundle>
- <Spring-Context>conf/main.xml</Spring-Context>
+ <Require-Bundle>org.springframework.jms,com.springsource.org.castor,com.springsource.org.apache.xbean.spring,com.springsource.org.apache.activemq,org.argeo.slc.execution,org.argeo.slc.support.activemq,org.argeo.slc.specs,org.argeo.slc.support.simple,org.springframework.aop,org.springframework.oxm,com.springsource.net.sf.cglib,com.springsource.org.aopalliance</Require-Bundle>
+ <Spring-Context>conf/*</Spring-Context>
+ <!--
+ <Embed-Dependency>com.springsource.org.castor</Embed-Dependency>
+ <Embed-Transitive>true</Embed-Transitive>
+ <Import-Package>*,javax.xml.parsers;resolution:=optional,
+ javax.xml.transform;resolution:=optional,
+ javax.xml.transform.dom;resolution:=optional,
+ javax.xml.transform.stream;resolution:=optional,
+ org.w3c.dom;resolution:=optional,
+ org.xml.sax;resolution:=optional,
+ org.xml.sax.helpers;resolution:=optional,
+ netscape.ldap;resolution:=optional,
+ org.apache.oro.text.regex;resolution:=optional,
+ org.apache.xerces.utils.regex;resolution:=optional,
+ weblogic.apache.xml.serialize;resolution:=optional,
+ com.sun.org.apache.xml.internal.serialize;resolution:=optional
+ </Import-Package>
+ <Eclipse-RegisterBuddy>com.springsource.org.castor</Eclipse-RegisterBuddy>
+ -->
+
</instructions>
</configuration>
</plugin>
</dependency>
<dependency>
<groupId>org.argeo.slc.runtime</groupId>
- <artifactId>org.argeo.slc.support.simple</artifactId>
+ <artifactId>org.argeo.slc.support.activemq</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.support.castor</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.castor</groupId>
+ <artifactId>com.springsource.org.castor</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.ejb</groupId>
+ <artifactId>com.springsource.javax.ejb</artifactId>
+ <version>3.0.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.xml.rpc</groupId>
+ <artifactId>com.springsource.javax.xml.rpc</artifactId>
+ <version>1.1.0</version>
</dependency>
+ <dependency>
+ <groupId>javax.xml.soap</groupId>
+ <artifactId>com.springsource.javax.xml.soap</artifactId>
+ <version>1.3.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.activation</groupId>
+ <artifactId>com.springsource.javax.activation</artifactId>
+ <version>1.1.1</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>com.springsource.javax.servlet</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.argeo.slc</groupId>
<artifactId>org.argeo.slc.detached.launcher</artifactId>
<groupId>org.springframework.osgi</groupId>
<artifactId>org.springframework.osgi.extender</artifactId>
</dependency>
+
</dependencies>
</project>
+++ /dev/null
-Manifest-Version: 1.0\r
-Private-Package: conf;version="0.11.3-SNAPSHOT",conf.testCases;version\r
- ="0.11.3-SNAPSHOT"\r
-Tool: Bnd-0.0.255\r
-Bundle-Name: SLC Sandbox Execution Flow\r
-Created-By: 1.6.0_0 (Sun Microsystems Inc.)\r
-Require-Bundle: org.argeo.slc.execution,org.argeo.slc.specs,org.argeo.\r
- slc.support.simple,org.springframework.aop,com.springsource.net.sf.cg\r
- lib,com.springsource.org.aopalliance\r
-Bundle-Vendor: Argeo\r
-Bundle-Version: 0.11.3.SNAPSHOT\r
-Spring-Context: conf/main.xml\r
-Bundle-ManifestVersion: 2\r
-Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
-Import-Package: org.apache.commons.logging;version="1.1",org.springfra\r
- mework.beans.factory.config\r
-Bundle-SymbolicName: org.argeo.slc.sandbox.executionflow\r
-Bundle-DocURL: http://www.argeo.org\r
-Originally-Created-By: 1.6.0_0 (Sun Microsystems Inc.)\r
-\r
+++ /dev/null
-import org.argeo.slc.test.*;
-
-public class BasicExecutionFlow implements org.argeo.slc.executionflow.ExecutionFlow {
-
- ExecutableTestRun firstSubTest = null;
- ExecutableTestRun secondSubTest = null;
-
- void execute(){
- firstSubTest?.execute();
- secondSubTest?.execute();
- }
-}
+++ /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="basic.executionSpec" class="org.argeo.slc.execution.SimpleExecutionSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testedComponentId">\r
- <bean parent="specAttribute" p:value="100" />\r
- </entry>\r
- <entry key="testData1">\r
- <bean parent="refAttribute" p:targetClass="org.argeo.slc.core.test.BasicTestData" />\r
- </entry>\r
- <entry key="testData2">\r
- <bean parent="refAttribute" p:targetClass="org.argeo.slc.core.test.BasicTestData" />\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
-\r
- <bean id="basic.executionFlowTemplate" class="org.argeo.slc.execution.SimpleExecutionFlow"\r
- abstract="true">\r
- <property name="executionSpec" ref="basic.executionSpec" />\r
- <property name="executables">\r
- <list>\r
- <ref bean="echo1" />\r
- <bean parent="testRun">\r
- <property name="testDefinition" ref="testDef" />\r
- <property name="testData">\r
- <bean parent="basic.ref">\r
- <constructor-arg value="testData1" />\r
- </bean>\r
- </property>\r
- </bean>\r
- <bean parent="testRun">\r
- <property name="testDefinition" ref="testDef" />\r
- <property name="testData" ref="ref1" />\r
- </bean>\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="ref1" parent="basic.ref" scope="prototype">\r
- <constructor-arg value="testData2" />\r
- </bean>\r
-\r
- \r
- <bean id="basic.testData" class="org.argeo.slc.core.test.BasicTestData"\r
- >\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
- <import\r
- resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />\r
-\r
- <bean id="specAttribute" class="org.argeo.slc.execution.SimpleSpecAttribute"\r
- abstract="true" />\r
-\r
- <bean id="refAttribute" class="org.argeo.slc.execution.RefSpecAttribute"\r
- abstract="true" />\r
-\r
-</beans>
\ No newline at end of file
--- /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"
+ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"
+ default-lazy-init="false">
+
+ <import resource="classpath:org/argeo/slc/castor/spring.xml" />
+
+ <bean id="slcDefault.jms.castorMessageConverter" class="org.argeo.slc.jms.MarshallerMessageConverter">
+ <property name="marshaller" ref="slcDefault.castor.marshaller" />
+ <property name="unmarshaller" ref="slcDefault.castor.marshaller" />
+ </bean>
+
+
+ <bean id="slcDefault.jms.amqConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
+ <property name="brokerURL">
+ <value>tcp://localhost:61616</value>
+ </property>
+ </bean>
+
+
+ <bean id="slcDefault.jms.connectionFactory"
+ class="org.springframework.jms.connection.SingleConnectionFactory">
+ <property name="targetConnectionFactory">
+ <ref local="slcDefault.jms.amqConnectionFactory" />
+ </property>
+ </bean>
+
+ <bean id="slcDefault.jms.jmsTemplateCastor" class="org.springframework.jms.core.JmsTemplate">
+ <property name="connectionFactory" ref="slcDefault.jms.connectionFactory" />
+ <property name="messageConverter" ref="slcDefault.jms.castorMessageConverter" />
+ </bean>
+
+
+
+ <!-- Templates -->
+ <bean id="slcTemplate.jms.listenerContainer"
+ class="org.springframework.jms.listener.DefaultMessageListenerContainer"
+ abstract="true">
+ <property name="connectionFactory" ref="slcDefault.jms.connectionFactory" />
+ </bean>
+
+ <bean id="slcTemplate.jms.listenerAdapterCastor"
+ class="org.springframework.jms.listener.adapter.MessageListenerAdapter"
+ abstract="true">
+ <property name="messageConverter" ref="slcDefault.jms.castorMessageConverter" />
+ </bean>
+</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" xmlns:context="http://www.springframework.org/schema/context"\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/context http://www.springframework.org/schema/context/spring-context-2.5.xsd\r
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">\r
-\r
- <import resource="common.xml" />\r
-\r
- <import resource="basic.xml" />\r
- <import resource="testCases/basic-001.xml" />\r
- <import resource="testCases/basic-002.xml" />\r
-\r
- <bean id="testLaunch" class="org.argeo.slc.execution.TestLaunch"\r
- p:flowName="main" init-method="launch"/>\r
-\r
- <bean id="main" class="org.argeo.slc.execution.SimpleExecutionFlow">\r
- <property name="executionSpec">\r
- <bean class="org.argeo.slc.execution.SimpleExecutionSpec">\r
- <property name="attributes">\r
- <map>\r
- <entry key="testKey">\r
- <bean parent="specAttribute" p:value="660" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
- </property>\r
- <property name="executables">\r
- <list>\r
- <ref local="echo1" />\r
- <ref bean="basic.001" />\r
- <ref bean="basic.001" />\r
- <ref bean="basic.002" />\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <bean id="echo1" parent="echoTemplate" 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.execution.tasks.Echo"\r
- abstract="true">\r
- </bean>\r
-\r
- <context:annotation-config />\r
- <bean class="org.argeo.slc.execution.ExecutionRegister" />\r
-\r
-\r
- <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">\r
- <property name="scopes">\r
- <map>\r
- <entry key="execution">\r
- <bean class="org.argeo.slc.execution.ExecutionScope" />\r
- </entry>\r
- </map>\r
- </property>\r
- </bean>\r
-\r
- <bean\r
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />\r
- <bean class="org.argeo.slc.execution.ExecutionParameterPostProcessor" />\r
- <bean class="org.argeo.slc.execution.InstantiationPostProcessor" />\r
- <bean class="org.argeo.slc.execution.Executor" />\r
-\r
- <bean class="org.argeo.slc.execution.ExecutionAspect"></bean>\r
- <aop:aspectj-autoproxy />\r
-\r
-</beans>
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ 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
+</beans: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" xmlns:context="http://www.springframework.org/schema/context"\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/context http://www.springframework.org/schema/context/spring-context-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="modulesManager" class="org.argeo.slc.execution.ModulesManager">\r
+ <property name="executionModules" ref="executionModules" />\r
+ </bean>\r
+\r
+ <bean id="modulesManager.listenerContainer" parent="slcTemplate.jms.listenerContainer">\r
+ <property name="destinationName" value="modulesManager.request" />\r
+ <property name="messageListener">\r
+ <bean class="org.argeo.slc.jms.ServiceMessageListenerAdapter">\r
+ <property name="methodArguments">\r
+ <map>\r
+ <entry key="getExecutionModuleDescriptor">\r
+ <list>\r
+ <value>name</value>\r
+ <value>version</value>\r
+ </list>\r
+ </entry>\r
+ </map>\r
+ </property>\r
+\r
+ <property name="delegate" ref="modulesManager" />\r
+ <property name="defaultResponseQueueName" value="modulesManager.response" />\r
+ <property name="messageConverter" ref="slcDefault.jms.castorMessageConverter" />\r
+ </bean>\r
+ </property>\r
+ </bean>\r
+\r
+</beans>
\ No newline at end of file
+++ /dev/null
-log4j.rootLogger=WARN, console
-
-## Levels
-log4j.logger.org.argeo=DEBUG
-log4j.logger.org.argeo.slc.executionflow.ExecutionParameterPostProcessor=TRACE
-log4j.logger.org.argeo.slc.executionflow.ExecutionContext=TRACE
-
-## Appenders
-# console is set to be a ConsoleAppender.
-log4j.appender.console=org.apache.log4j.ConsoleAppender
-
-# console uses PatternLayout.
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern= %-5p %d{ISO8601} %m - %c%n
-
-testCase=002
\ 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:lang="http://www.springframework.org/schema/lang"\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
- ">\r
-\r
- <import\r
- resource="classpath:/org/argeo/slc/core/test/spring/applicationContext.xml" />\r
-\r
- <import resource="testCases/basic-001.xml" />\r
- <import resource="testCases/basic-002.xml" />\r
-\r
- <bean id="executionFlow.basic1" class="org.argeo.slc.executionflow.SimpleExecutionFlow">\r
- <meta key="meta1" value="mata1Value" />\r
- <qualifier>\r
- <attribute key="qual1" value="qual1value" />\r
- </qualifier>\r
- <property name="executables">\r
- <list>\r
- <ref local="testGroovyImpl" />\r
- <ref local="testBshImpl" />\r
- <bean parent="testRun" p:testDefinition-ref="testDef"\r
- p:testData-ref="testData-${testCase}" />\r
- <bean parent="testRun" p:testDefinition-ref="testDef"\r
- p:testData-ref="testData-${testCase}" />\r
- </list>\r
- </property>\r
- </bean>\r
-\r
- <lang:groovy id="executionFlow.groovy1" script-source="src/slc/conf/BasicExecutionFlow.groovy">\r
- <lang:property name="firstSubTest">\r
- <bean parent="testRun" p:testDefinition-ref="testDef"\r
- p:testData-ref="testData-${testCase}" />\r
- </lang:property>\r
- </lang:groovy>\r
-\r
- <bean id="testGroovyImpl" parent="testGroovy">\r
- <property name="message" value="Hello World! Groovy" />\r
- </bean>\r
- <bean id="testBshImpl" parent="testBsh">\r
- <property name="message" value="Hello World! Beanshell" />\r
- </bean>\r
-\r
- <bean id="testDef" class="org.argeo.slc.core.test.BasicTestDefinition"\r
- scope="prototype" />\r
-\r
- <bean\r
- class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />\r
-\r
- <bean id="testResult" parent="slcDefault.test.basicSimpleTestResult">\r
- </bean>\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
- <lang:groovy id="testGroovyBean">\r
- <lang:inline-script><![CDATA[\r
- class Message {\r
- String message = 'test'\r
- \r
- public String getMessage(){\r
- return message;\r
- }\r
- }\r
- ]]></lang:inline-script>\r
- </lang:groovy>\r
-\r
- <lang:groovy id="testGroovy">\r
- <lang:inline-script><![CDATA[\r
- class GroovyMessenger extends org.argeo.slc.core.test.SimpleTestRun {\r
- \r
- String message = 'test'\r
- \r
- void execute(){\r
- println(message);\r
- }\r
- }\r
- ]]></lang:inline-script>\r
- </lang:groovy>\r
-\r
- <lang:bsh id="testBsh" script-interfaces="org.argeo.slc.test.ExecutableTestRun">\r
- <lang:inline-script><![CDATA[\r
- setStrictJava(true);\r
-\r
- class BshMessenger extends org.argeo.slc.core.test.SimpleTestRun {\r
-\r
- String message = "test";\r
-\r
- public void execute(){\r
- System.out.println(message);\r
- }\r
- \r
- public void setMessage(String message){\r
- this.message = message;\r
- }\r
- }\r
- ]]></lang:inline-script>\r
- </lang:bsh>\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="basic.001" parent="basic.executionFlowTemplate">\r
- <constructor-arg>\r
- <map>\r
- <entry key="testData1" value-ref="basic.001.testData" />\r
- <entry key="testData2">\r
- <bean class="org.argeo.slc.core.test.BasicTestData" scope="execution">\r
- <aop:scoped-proxy />\r
- <property name="expected" value="tata101" />\r
- <property name="reached" value="tata@{testKey}" />\r
- </bean>\r
- </entry>\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-\r
- <bean id="basic.001.testData" class="org.argeo.slc.core.test.BasicTestData"\r
- scope="execution">\r
- <aop:scoped-proxy />\r
- <property name="expected" value="tata100" />\r
- <property name="reached" value="tata@{testedComponentId}" />\r
- </bean>\r
-\r
- <bean id="basic.001.testData2" class="org.argeo.slc.core.test.context.DefaultContextTestData">\r
- </bean>\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
-\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
- <constructor-arg>\r
- <map>\r
- <entry key="testData1">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="toto" />\r
- <property name="reached" value="toto" />\r
- </bean>\r
- </entry>\r
- <entry key="testData2">\r
- <bean class="org.argeo.slc.core.test.BasicTestData">\r
- <property name="expected" value="tata" />\r
- <property name="reached" value="toto" />\r
- </bean>\r
- </entry>\r
- </map>\r
- </constructor-arg>\r
- </bean>\r
-</beans>
\ No newline at end of file
--- /dev/null
+package org.argeo.slc.demo.manager;
+
+import javax.jms.ConnectionFactory;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+
+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;
+
+public class JmsTesting {
+ private final static Log log = LogFactory.getLog(JmsTesting.class);
+
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+ ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext(
+ "conf/jms.xml");
+ try {
+
+ ConnectionFactory connectionFactory = (ConnectionFactory) applicationContext
+ .getBean("slcDefault.jms.connectionFactory");
+ JmsTemplate jmsTemplate = new JmsTemplate(connectionFactory);
+
+ jmsTemplate.send("modulesManager.request", new MessageCreator() {
+
+ public Message createMessage(Session session)
+ throws JMSException {
+ TextMessage message = session.createTextMessage();
+ message.setStringProperty("action",
+ "getExecutionModuleDescriptor");
+ message.setStringProperty("name",
+ "org.argeo.slc.demo.basic");
+ message.setStringProperty("version", "LATEST");
+ return message;
+ }
+ });
+
+ TextMessage message = (TextMessage) jmsTemplate
+ .receive("modulesManager.response");
+ log.info("Received message: " + message.getText() + "\n");
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ applicationContext.close();
+ }
+ }
+
+}
<properties>
<version.spring>2.5.6.A</version.spring>
<version.spring-ws>1.5.5.A</version.spring-ws>
+ <version.spring-osgi>1.1.3.RELEASE</version.spring-osgi>
<version.maven>2.0.9</version.maven>
<version.ant>1.7.0</version.ant>
<version.jetty>6.1.14</version.jetty>
See the License for the specific language governing permissions and
limitations under the License.
]]>
- </comments>
+ </comments>
</license>
</licenses>
<organization>
<dependency>
<groupId>org.springframework.osgi</groupId>
<artifactId>org.springframework.osgi.extender</artifactId>
- <version>1.1.2.B</version>
+ <version>${version.spring-osgi}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.osgi</groupId>
+ <artifactId>org.springframework.osgi.core</artifactId>
+ <version>${version.spring-osgi}</version>
</dependency>
<!-- Ant -->
<id>com.springsource.repository.bundles.release</id>
<name>
SpringSource Enterprise Bundle Repository - SpringSource
- Bundle Releases
+ Bundle
+ Releases
</name>
<url>
http://repository.springsource.com/maven/bundles/release
<id>com.springsource.repository.bundles.external</id>
<name>
SpringSource Enterprise Bundle Repository - External
- Bundle Releases
+ Bundle
+ Releases
</name>
<url>
http://repository.springsource.com/maven/bundles/external
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="src" path="src/main/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
<artifactId>org.argeo.slc.support.simple</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.eclipse.osgi</groupId>
+ <artifactId>org.eclipse.osgi</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework.osgi</groupId>
+ <artifactId>org.springframework.osgi.core</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>com.springsource.org.aspectj.runtime</artifactId>
--- /dev/null
+package org.argeo.slc.execution;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.argeo.slc.process.SlcExecution;
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.ApplicationContextAware;
+import org.springframework.util.Assert;
+
+public abstract class AbstractSpringExecutionModule implements ExecutionModule,
+ ApplicationContextAware {
+ private ApplicationContext applicationContext;
+
+ public ExecutionModuleDescriptor getDescriptor() {
+ ExecutionModuleDescriptor md = new ExecutionModuleDescriptor();
+ md.setName(getName());
+ md.setVersion(getVersion());
+
+ GenericBeanFactoryAccessor accessor = new GenericBeanFactoryAccessor(
+ applicationContext);
+ Map<String, ExecutionFlow> executionFlows = accessor
+ .getBeansOfType(ExecutionFlow.class);
+
+ for (String name : executionFlows.keySet()) {
+ ExecutionFlow executionFlow = executionFlows.get(name);
+
+ Assert.notNull(executionFlow.getName());
+ Assert.state(name.equals(executionFlow.getName()));
+
+ ExecutionSpec executionSpec = executionFlow.getExecutionSpec();
+ Assert.notNull(executionSpec);
+ Assert.notNull(executionSpec.getName());
+
+ Map<String, Object> values = new HashMap<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));
+ }
+ }
+
+ ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(name,
+ values, executionSpec);
+
+ if (!md.getExecutionSpecs().contains(executionSpec))
+ md.getExecutionSpecs().add(executionSpec);
+ md.getExecutionFlows().add(efd);
+ }
+
+ return md;
+ }
+
+ public void execute(SlcExecution slcExecution) {
+ applicationContext.publishEvent(new NewExecutionEvent(this,
+ slcExecution));
+ }
+
+ public void setApplicationContext(ApplicationContext applicationContext)
+ throws BeansException {
+ this.applicationContext = applicationContext;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.execution;
+
+import java.util.List;
+
+import org.argeo.slc.process.SlcExecution;
+import org.eclipse.osgi.framework.console.CommandInterpreter;
+import org.eclipse.osgi.framework.console.CommandProvider;
+
+public class ExecutionCommandProvider implements CommandProvider {
+ private List<ExecutionModule> executionModules;
+
+ public Object _slc_execute(CommandInterpreter ci) {
+ String moduleName = ci.nextArgument();
+ String executionName = ci.nextArgument();
+
+ SlcExecution slcExecution = new SlcExecution();
+ slcExecution.getAttributes().put("slc.flows", executionName);
+
+ ExecutionModule module = null;
+ for (ExecutionModule moduleT : executionModules) {
+ if(moduleT.getName().equals(moduleName)){
+ // TODO: check version
+ module = moduleT;
+ break;
+ }
+ }
+
+ if(module!=null)
+ module.execute(slcExecution);
+
+ return null;
+ }
+
+ public String getHelp() {
+ StringBuffer buf = new StringBuffer();
+ buf.append("---SLC Execution Commands---\n");
+ buf.append("\tslc_execute - Execute an execution flow\n");
+ return buf.toString();
+
+ }
+
+ public void setExecutionModules(List<ExecutionModule> executionModules) {
+ this.executionModules = executionModules;
+ }
+
+}
ExecutionFlowRuntime runtime = new ExecutionFlowRuntime(executionFlow);
stack.push(runtime);
- if (log.isTraceEnabled())
+ if (log.isDebugEnabled())
log.debug(depthSpaces(stack.size()) + "=> " + executionFlow + " #"
+ getCurrentStackUuid() + ", depth=" + stack.size());
public static void leaveFlow(ExecutionFlow executionFlow) {
Stack<ExecutionFlowRuntime> stack = executionContext.get().stack;
- if (log.isTraceEnabled())
+ if (log.isDebugEnabled())
log.debug(depthSpaces(stack.size()) + "<= " + executionFlow + " #"
+ getCurrentStackUuid() + ", depth=" + stack.size());
--- /dev/null
+package org.argeo.slc.execution;
+
+import org.argeo.slc.process.SlcExecution;
+
+public interface ExecutionModule {
+ public String getName();
+
+ public String getVersion();
+
+ public ExecutionModuleDescriptor getDescriptor();
+
+ public void execute(SlcExecution slcExecution);
+}
import java.util.List;
public class ExecutionModuleDescriptor {
+ private String name;
+ private String version;
private List<ExecutionSpec> executionSpecs = new ArrayList<ExecutionSpec>();
private List<ExecutionFlowDescriptor> executionFlows = new ArrayList<ExecutionFlowDescriptor>();
this.executionFlows = executionFlows;
}
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getVersion() {
+ return version;
+ }
+
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
}
+++ /dev/null
-package org.argeo.slc.execution;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.InitializingBean;
-import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.util.Assert;
-
-public class ExecutionRegister implements InitializingBean,
- ApplicationContextAware {
- private final static Log log = LogFactory.getLog(ExecutionRegister.class);
-
- private ApplicationContext applicationContext;
-
- public ExecutionModuleDescriptor getDescriptor() {
- ExecutionModuleDescriptor md = new ExecutionModuleDescriptor();
-
- GenericBeanFactoryAccessor accessor = new GenericBeanFactoryAccessor(
- applicationContext);
- Map<String, ExecutionFlow> executionFlows = accessor
- .getBeansOfType(ExecutionFlow.class);
-
- for (String name : executionFlows.keySet()) {
- ExecutionFlow executionFlow = executionFlows.get(name);
-
- Assert.notNull(executionFlow.getName());
- Assert.state(name.equals(executionFlow.getName()));
-
- ExecutionSpec executionSpec = executionFlow.getExecutionSpec();
- Assert.notNull(executionSpec);
- Assert.notNull(executionSpec.getName());
-
- Map<String, Object> values = new HashMap<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));
- }
- }
-
- ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(name,
- values, executionSpec);
-
- if (!md.getExecutionSpecs().contains(executionSpec))
- md.getExecutionSpecs().add(executionSpec);
- md.getExecutionFlows().add(efd);
- }
-
- return md;
- }
-
- public void afterPropertiesSet() throws Exception {
- log.debug("Execution Module Descriptor:\n" + getDescriptor());
- }
-
- public void setApplicationContext(ApplicationContext applicationContext)
- throws BeansException {
- this.applicationContext = applicationContext;
- }
-
-}
--- /dev/null
+package org.argeo.slc.execution;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.springframework.util.Assert;
+
+public class ModulesManager {
+ private List<ExecutionModule> executionModules = new ArrayList<ExecutionModule>();
+
+ public ExecutionModuleDescriptor getExecutionModuleDescriptor(
+ String moduleName, String version) {
+ ExecutionModule module = null;
+ for (ExecutionModule moduleT : executionModules) {
+ if(moduleT.getName().equals(moduleName)){
+ // TODO: check version
+ module = moduleT;
+ break;
+ }
+ }
+
+ Assert.notNull(module);
+
+ return module.getDescriptor();
+ }
+
+ public void setExecutionModules(List<ExecutionModule> executionModules) {
+ this.executionModules = executionModules;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.execution;
+
+import org.osgi.framework.BundleContext;
+import org.springframework.osgi.context.BundleContextAware;
+
+public class OsgiExecutionModule extends AbstractSpringExecutionModule implements
+ BundleContextAware {
+ private BundleContext bundleContext;
+
+ public String getName() {
+ return bundleContext.getBundle().getSymbolicName();
+ }
+
+ public String getVersion() {
+ return bundleContext.getBundle().getHeaders().get("Bundle-Version")
+ .toString();
+ }
+
+ public void setBundleContext(BundleContext bundleContext) {
+ this.bundleContext = bundleContext;
+ }
+
+}
package org.argeo.slc.execution;
-public class RefSpecAttribute extends AbstractSpecAttribute {
+public class RefSpecAttribute extends AbstractSpecAttribute {
private Class targetClass;
+ /** Read only. */
+ private String targetClassName;
private Object value = null;
public Object getValue() {
public void setTargetClass(Class targetClass) {
this.targetClass = targetClass;
+ this.targetClassName = targetClass.getName();
+ }
+
+ public String getTargetClassName() {
+ return targetClassName;
}
}
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
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+ xsi:schemaLocation="http://www.springframework.org/schema/osgi \r
+ http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+ http://www.springframework.org/schema/beans \r
+ http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
+\r
+ <service interface="org.eclipse.osgi.framework.console.CommandProvider">\r
+ <beans:bean class="org.argeo.slc.execution.ExecutionCommandProvider">\r
+ <beans:property name="executionModules" ref="executionModules" />\r
+ </beans:bean>\r
+ </service>\r
+\r
+ <list id="executionModules" interface="org.argeo.slc.execution.ExecutionModule" />\r
+</beans:beans>
\ No newline at end of file
--- /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"
+ xmlns:aop="http://www.springframework.org/schema/aop"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+ 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">
+
+ <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer">
+ <property name="scopes">
+ <map>
+ <entry key="execution">
+ <bean class="org.argeo.slc.execution.ExecutionScope" />
+ </entry>
+ </map>
+ </property>
+ </bean>
+
+ <bean
+ class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" />
+
+ <bean class="org.argeo.slc.execution.ExecutionParameterPostProcessor" />
+ <bean class="org.argeo.slc.execution.InstantiationPostProcessor" />
+ <bean class="org.argeo.slc.execution.Executor" />
+ <bean class="org.argeo.slc.execution.ExecutionAspect"/>
+
+ <aop:aspectj-autoproxy />
+
+</beans>
\ No newline at end of file
--- /dev/null
+package org.argeo.slc.jms;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.Session;
+
+import org.argeo.slc.SlcException;
+import org.argeo.slc.msg.ExecutionAnswer;
+import org.springframework.jms.listener.adapter.MessageListenerAdapter;
+
+public class ServiceMessageListenerAdapter extends MessageListenerAdapter {
+ public final static String DEFAULT_METHOD_NAME_PARAMETER = "action";
+ public final static String BODY_ARGUMENT = "BODY";
+
+ private Map<String, List<String>> methodArguments = new HashMap<String, List<String>>();
+
+ private static String methodNameParameter = DEFAULT_METHOD_NAME_PARAMETER;
+
+ @Override
+ protected Object extractMessage(Message message) throws JMSException {
+ return new ExtractedMessage(message);
+ }
+
+ @Override
+ protected String getListenerMethodName(Message originalMessage,
+ Object extractedMessage) throws JMSException {
+ return ((ExtractedMessage) extractedMessage).methodName;
+ }
+
+ @Override
+ protected Object[] buildListenerArguments(Object extractedMessage) {
+ return ((ExtractedMessage) extractedMessage).arguments;
+ }
+
+ @Override
+ public void onMessage(Message message, Session session) throws JMSException {
+ try {// hacked and simplified from parent class
+ // Regular case: find a handler method reflectively.
+ Object convertedMessage = extractMessage(message);
+ String methodName = getListenerMethodName(message, convertedMessage);
+
+ // Invoke the handler method with appropriate arguments.
+ Object[] listenerArguments = buildListenerArguments(convertedMessage);
+ Object result = invokeListenerMethod(methodName, listenerArguments);
+ if (result != null) {
+ handleResult(result, message, session);
+ } else {
+ ExecutionAnswer answer = ExecutionAnswer.ok("Execution of "
+ + methodName + " on " + getDelegate() + " succeeeded.");
+ Message okMessage = getMessageConverter().toMessage(answer,
+ session);
+ sendResponse(session, getResponseDestination(message,
+ okMessage, session), okMessage);
+ }
+ } catch (Exception e) {
+ if (session == null)
+ return;
+
+ StringWriter writer = new StringWriter();
+ e.printStackTrace(new PrintWriter(writer));
+ ExecutionAnswer answer = ExecutionAnswer.error(writer.toString());
+ Message errorMessage = getMessageConverter().toMessage(answer,
+ session);
+ sendResponse(session, getResponseDestination(message, errorMessage,
+ session), errorMessage);
+ }
+ }
+
+ protected class ExtractedMessage {
+ private final String methodName;
+ private final Object[] arguments;
+ private final Message originalMessage;
+
+ public ExtractedMessage(Message originalMessage) throws JMSException {
+ this.originalMessage = originalMessage;
+
+ if (!originalMessage.propertyExists(methodNameParameter))
+ throw new SlcException("No property " + methodNameParameter
+ + " in incoming message,"
+ + " cannot determine service method");
+
+ methodName = originalMessage.getStringProperty(methodNameParameter);
+
+ if (!methodArguments.containsKey(methodName)) {// no arg specified
+ arguments = new Object[0];
+ } else {
+ List<String> parameterNames = methodArguments.get(methodName);
+ List<Object> arguments = new ArrayList<Object>();
+ int count = 0;
+ for (String name : parameterNames) {
+ if (name.equals(BODY_ARGUMENT)) {
+ Object body = getMessageConverter().fromMessage(
+ originalMessage);
+ arguments.add(body);
+ } else {
+ if (!originalMessage.propertyExists(name))
+ throw new SlcException("No property " + name
+ + " in incoming message,"
+ + " cannot determine argument #" + count);
+ arguments.add(originalMessage.getObjectProperty(name));
+ }
+ count++;
+ }
+ this.arguments = arguments.toArray();
+ }
+ }
+ }
+
+ public void setMethodArguments(Map<String, List<String>> methodArguments) {
+ this.methodArguments = methodArguments;
+ }
+
+ public static void setMethodNameParameter(String methodNameParameter) {
+ ServiceMessageListenerAdapter.methodNameParameter = methodNameParameter;
+ }
+
+
+}
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core" 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
- http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd"
+ http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core-5.2.0.xsd"
default-lazy-init="false">
<import resource="classpath:org/argeo/slc/castor/spring.xml" />
<amq:topic id="slcJms.destination.agent.newExecution"
physicalName="agent.newExecution" />
+ <amq:queue id="slcJms.destination.modulesManager.request"
+ physicalName="modulesManager.request" />
+ <amq:topic id="slcJms.destination.modulesManager.response"
+ physicalName="modulesManager.response" />
+
<!-- Templates -->
<bean id="slcTemplate.jms.listenerContainer"
class="org.springframework.jms.listener.DefaultMessageListenerContainer"
<Export-Package>
org.argeo.slc.*
</Export-Package>
- <Import-Package>*,javax.xml.parsers;resolution:=optional,
+ <Import-Package>org.argeo.slc.*;resolution:=optional,
+ org.argeo.slc.core.structure;resolution:=optional,
+ org.argeo.slc.core.structure.tree;resolution:=optional,
+ org.argeo.slc.core.test;resolution:=optional,
+ org.argeo.slc.core.test.tree;resolution:=optional,
+ org.argeo.slc.runtime;resolution:=optional,
+ org.argeo.slc.execution;resolution:=optional,
+ org.argeo.slc.msg;resolution:=optional,
+ org.argeo.slc.msg.process;resolution:=optional,
+ org.argeo.slc.msg.test.tree;resolution:=optional
+ </Import-Package>
+ <Fragment-Host>com.springsource.org.castor</Fragment-Host>
+ <!--
+ <Import-Package>*,org.argeo.slc.msg,
+ org.argeo.slc.msg.process,
+ org.argeo.slc.msg.test.tree,
+ javax.xml.parsers;resolution:=optional,
javax.xml.transform;resolution:=optional,
javax.xml.transform.dom;resolution:=optional,
javax.xml.transform.stream;resolution:=optional,
org.w3c.dom;resolution:=optional,
org.xml.sax;resolution:=optional
</Import-Package>
+ -->
</instructions>
</configuration>
</plugin>
--- /dev/null
+<?xml version="1.0"?>\r
+\r
+<!DOCTYPE mapping PUBLIC "-//EXOLAB/Castor Mapping DTD Version 1.0//EN" "http://castor.org/mapping.dtd">\r
+\r
+<mapping>\r
+ <description>Execution objects XML mapping</description>\r
+\r
+ <class name="org.argeo.slc.execution.ExecutionModuleDescriptor">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="name" />\r
+ <field name="version" />\r
+ <field name="executionFlows" collection="arraylist"\r
+ type="org.argeo.slc.execution.ExecutionFlowDescriptor">\r
+ <bind-xml auto-naming="deriveByClass" location="executionFlows" />\r
+ </field>\r
+ <field name="executionSpecs" collection="arraylist"\r
+ type="org.argeo.slc.execution.ExecutionSpec">\r
+ <bind-xml auto-naming="deriveByClass" location="executionSpecs" />\r
+ </field>\r
+ </class>\r
+\r
+ <class name="org.argeo.slc.execution.ExecutionFlowDescriptor">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="name" identity="true">\r
+ <bind-xml name="name" node="attribute" />\r
+ </field>\r
+ <field name="executionSpec">\r
+ <bind-xml name="executionSpec" node="attribute" reference="true" />\r
+ </field>\r
+ <field name="values" collection="map">\r
+ <bind-xml name="value" location="values">\r
+ <class name="org.exolab.castor.mapping.MapItem">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <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>\r
+ </class>\r
+ </bind-xml>\r
+ </field>\r
+ </class>\r
+\r
+ <class name="org.argeo.slc.execution.SimpleExecutionSpec">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="name" identity="true">\r
+ <bind-xml name="name" node="attribute" />\r
+ </field>\r
+ <field name="attributes" collection="map">\r
+ <bind-xml name="value" location="values">\r
+ <class name="org.exolab.castor.mapping.MapItem">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="key" type="string">\r
+ <bind-xml name="key" node="attribute" />\r
+ </field>\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.execution.AbstractSpecAttribute">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="isParameter">\r
+ <bind-xml name="isParameter" node="attribute" />\r
+ </field>\r
+ </class>\r
+\r
+ <class name="org.argeo.slc.execution.SimpleSpecAttribute"\r
+ extends="org.argeo.slc.execution.AbstractSpecAttribute">\r
+ <map-to ns-uri="http://argeo.org/projects/slc/schemas"\r
+ ns-prefix="slc" />\r
+ <field name="value" />\r
+ </class>\r
+\r
+ <class name="org.argeo.slc.execution.RefSpecAttribute" extends="org.argeo.slc.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
+</mapping>
\ No newline at end of file
<value>
classpath:org/argeo/slc/castor/test.xml
</value>
+ <value>
+ classpath:org/argeo/slc/castor/execution.xml
+ </value>
</list>
</property>
<property name="whitespacePreserve" value="true" />