Simplify minimal configs for execution
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 7 Jul 2009 09:26:49 +0000 (09:26 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 7 Jul 2009 09:26:49 +0000 (09:26 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2705 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

20 files changed:
demo/pom.xml
demo/site/org.argeo.slc.demo.ant/META-INF/MANIFEST.MF
demo/site/org.argeo.slc.demo.ant/conf/ant.xml
demo/site/org.argeo.slc.demo.ant/conf/imports.xml
demo/site/org.argeo.slc.demo.ant/conf/osgi.xml
demo/site/org.argeo.slc.demo.basic/META-INF/MANIFEST.MF
demo/site/org.argeo.slc.demo.basic/conf/osgi.xml
demo/site/org.argeo.slc.demo.minimal/META-INF/MANIFEST.MF
demo/site/org.argeo.slc.demo.minimal/slc/imports.xml
demo/site/org.argeo.slc.demo.minimal/slc/main.xml
demo/site/org.argeo.slc.demo.minimal/slc/osgi.xml
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/AbstractExecutionFlowGenerator.java
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlow.java
runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/tasks/Echo.java
runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/execution/defaults.xml
runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/execution/runtime.xml
runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/execution/simple.xml [new file with mode: 0644]
runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/execution/spring.xml
runtime/org.argeo.slc.support.osgi/src/main/resources/org/argeo/slc/osgi/execution.xml [new file with mode: 0644]
runtime/org.argeo.slc.support.osgi/src/main/resources/org/argeo/slc/osgi/execution/spring.xml [deleted file]

index 71be268c1d29b390b0a2ea5ef4e1bd7328264e6f..389311602659093146b2cd5be08e23c777e05e07 100644 (file)
                                </dependency>
                        </dependencies>
                </profile>
+               <profile>
+                       <id>standalone</id>
+                       <build>
+                               <plugins>
+                                       <plugin>
+                                               <groupId>org.argeo.maven.plugins</groupId>
+                                               <artifactId>maven-argeo-osgi-plugin</artifactId>
+                                               <configuration>
+                                                       <execDir>target/exec/agent</execDir>
+                                                       <systemProperties>
+                                                               <slc.osgi.start>
+                                                                       org.springframework.osgi.extender,
+                                                                       org.argeo.slc.support.equinox,
+                                                                       org.argeo.slc.agent
+                                                               </slc.osgi.start>
+                                                               <slc.osgi.bundles>
+                                                                       ${basedir}/site;in=*;ex=pom.xml;ex=target,
+                                                                       ${basedir}/../modules/agent;in=*;ex=pom.xml;ex=target
+                                                               </slc.osgi.bundles>
+                                                       </systemProperties>
+                                               </configuration>
+                                       </plugin>
+                               </plugins>
+                       </build>
+                       <dependencies>
+                               <dependency>
+                                       <groupId>org.argeo.slc.dep</groupId>
+                                       <artifactId>org.argeo.slc.dep.agent</artifactId>
+                                       <version>${project.version}</version>
+                               </dependency>
+                               <dependency>
+                                       <groupId>org.argeo.slc.runtime</groupId>
+                                       <artifactId>org.argeo.slc.support.ant</artifactId>
+                                       <version>${project.version}</version>
+                               </dependency>
+                       </dependencies>
+               </profile>
                <profile>
                        <id>server_mysql</id>
                        <build>
index 27a4ecff44632221711fd3778331042ce7250c00..ebedc4ac49d8acd5fd4d1630058ced34f619d1f2 100644 (file)
@@ -4,18 +4,12 @@ Bundle-Name: SLC Demo Ant
 Bundle-Description: Demonstrate Ant support\r
 Spring-Context: conf/*,conf/testCases/*\r
 Bundle-SymbolicName: org.argeo.slc.demo.ant\r
-Import-Package: net.sf.cglib.core,\r
- net.sf.cglib.proxy,\r
- net.sf.cglib.reflect,\r
+Import-Package: \r
  org.aopalliance.aop,\r
- org.apache.commons.logging,\r
  org.argeo.slc.ant,\r
  org.argeo.slc.core.execution,\r
- org.argeo.slc.core.execution.tasks,\r
  org.argeo.slc.execution,\r
  org.argeo.slc.osgi,\r
- org.argeo.slc.osgi.execution,\r
- org.argeo.slc.structure,\r
  org.springframework.aop,\r
  org.springframework.aop.framework,\r
  org.springframework.aop.scope,\r
index 7985043dd368a68a1f227d496ada5a0a3f7b3abf..3cff3b49fda276864b32f7ae9d4cc71503b6e375 100644 (file)
@@ -7,7 +7,7 @@
        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="main" parent="slcTemplate.simpleFlow">\r
+       <bean id="main" class="org.argeo.slc.core.execution.DefaultExecutionFlow">\r
                <property name="executables">\r
                        <list>\r
                                <bean class="org.argeo.slc.ant.AntRun">\r
index c5f6e3aceed8b385ec0216d2c92134b8e64357f1..3428e8b852016a2fa0a34b7b7e9e97638cf4d7a6 100644 (file)
@@ -4,5 +4,5 @@
        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/core/execution/spring.xml" />
+       <import resource="classpath:org/argeo/slc/core/execution/simple.xml" />
 </beans>
\ No newline at end of file
index 74b537da90f00aa429c11aad2032ff62be21f7ac..f50522973d921a9dd7ce8539d7295fb4456a7257 100644 (file)
@@ -6,5 +6,5 @@
        http://www.springframework.org/schema/beans   \r
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
 \r
-       <beans:import resource="classpath:org/argeo/slc/osgi/execution/spring.xml" />\r
+       <beans:import resource="classpath:org/argeo/slc/osgi/execution.xml" />\r
 </beans:beans>
\ No newline at end of file
index f26a85e8dbca8fe749485e008e5ab2545deb9ea3..4a06bbe51eba63bdd0d7e7ec21827495f3147073 100644 (file)
@@ -15,13 +15,11 @@ Import-Package:
  org.argeo.slc.test,\r
  org.argeo.slc.execution,\r
  org.argeo.slc.osgi,\r
- org.argeo.slc.osgi.execution,\r
  org.argeo.slc.structure,\r
  net.sf.cglib.core,\r
  net.sf.cglib.proxy,\r
  net.sf.cglib.reflect,\r
  org.aopalliance.aop,\r
- org.apache.commons.logging,\r
  org.springframework.aop,\r
  org.springframework.aop.framework,\r
  org.springframework.aop.scope,\r
index a6f9740efab9b7db90a4f09da346455062f5787b..8cc7a38622c406adced19ec9c2c686ad636989c8 100644 (file)
@@ -6,9 +6,10 @@
        http://www.springframework.org/schema/beans   \r
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
 \r
-       <beans:import resource="classpath:org/argeo/slc/osgi/execution/spring.xml" />\r
+       <beans:import resource="classpath:org/argeo/slc/osgi/execution.xml" />\r
 \r
-       <reference id="attachmentUploader" interface="org.argeo.slc.core.attachment.AttachmentUploader" />\r
+       <reference id="attachmentUploader"\r
+               interface="org.argeo.slc.core.attachment.AttachmentUploader" />\r
 \r
        <list id="resultListeners" interface="org.argeo.slc.core.test.tree.TreeTestResultListener" />\r
 </beans:beans>
\ No newline at end of file
index ba406292b5caee3742620be4205c5e17578b4222..adce16a327e1c779444c1ccb1fcce51297c53cbb 100644 (file)
@@ -5,19 +5,12 @@ Bundle-Name: SLC Demo Minimal Module
 Bundle-Description: Minimal functioning execution module\r
 Spring-Context: slc/*\r
 Import-Package: \r
- net.sf.cglib.core,\r
- net.sf.cglib.proxy,\r
- net.sf.cglib.reflect,\r
  org.aopalliance.aop,\r
- org.apache.commons.logging,\r
  org.argeo.slc.core.execution,\r
  org.argeo.slc.core.execution.tasks,\r
  org.argeo.slc.execution,\r
  org.argeo.slc.osgi,\r
- org.argeo.slc.osgi.execution,\r
- org.argeo.slc.structure,\r
  org.springframework.aop,\r
  org.springframework.aop.framework,\r
  org.springframework.aop.scope,\r
- org.springframework.beans.factory.config,\r
- org.springframework.core.io\r
+ org.springframework.beans.factory.config\r
index c5f6e3aceed8b385ec0216d2c92134b8e64357f1..a7ace36c1687b1306a1052770cceb9e00a786bd2 100644 (file)
@@ -1,8 +1,20 @@
 <?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: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/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+       http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd">
+
+       <import resource="classpath:org/argeo/slc/core/execution/runtime.xml" />
+
+       <bean id="executionContext" class="org.argeo.slc.core.execution.MapExecutionContext"
+               scope="execution">
+               <aop:scoped-proxy proxy-target-class="false"/>
+       </bean>
+
+       <bean id="executionFlowDescriptorConverter"
+               class="org.argeo.slc.core.execution.DefaultExecutionFlowDescriptorConverter" />
+
 
-       <import resource="classpath:org/argeo/slc/core/execution/spring.xml" />
 </beans>
\ No newline at end of file
index 59024bfb6946ca6b2c6acaf8a5750079ccb8c713..e0e35d0723321225398d76259bcc7de59d528ad6 100644 (file)
@@ -4,13 +4,12 @@
        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="main" parent="slcTemplate.simpleFlow">\r
+       <bean id="main" class="org.argeo.slc.core.execution.DefaultExecutionFlow">\r
                <property name="executables">\r
                        <list>\r
-                               <bean p:message="Hello World!" parent="task.echo" />\r
+                               <bean p:message="Hello World!" class="org.argeo.slc.core.execution.tasks.Echo" />\r
                        </list>\r
                </property>\r
        </bean>\r
index 74b537da90f00aa429c11aad2032ff62be21f7ac..f50522973d921a9dd7ce8539d7295fb4456a7257 100644 (file)
@@ -6,5 +6,5 @@
        http://www.springframework.org/schema/beans   \r
        http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">\r
 \r
-       <beans:import resource="classpath:org/argeo/slc/osgi/execution/spring.xml" />\r
+       <beans:import resource="classpath:org/argeo/slc/osgi/execution.xml" />\r
 </beans:beans>
\ No newline at end of file
index 772d445d0e456b95b7ed76211258c89e678164ff..19861151aa006fda305c2370674d557bfd7992a5 100644 (file)
@@ -18,8 +18,7 @@ import org.springframework.core.PriorityOrdered;
 
 public abstract class AbstractExecutionFlowGenerator implements
                BeanFactoryPostProcessor, PriorityOrdered {
-       private final static Log log = LogFactory
-                       .getLog(AbstractExecutionFlowGenerator.class);
+       private final Log log = LogFactory.getLog(getClass());
 
        protected abstract Map<String, BeanDefinition> createExecutionFlowDefinitions(
                        ConfigurableListableBeanFactory beanFactory);
@@ -34,7 +33,7 @@ public abstract class AbstractExecutionFlowGenerator implements
                Map<String, BeanDefinition> definitions = createExecutionFlowDefinitions(beanFactory);
 
                for (String beanName : definitions.keySet()) {
-                       if (log.isDebugEnabled())
+                       if (log.isTraceEnabled())
                                log.debug("Registering execution flow " + beanName);
                        ((BeanDefinitionRegistry) beanFactory).registerBeanDefinition(
                                        beanName, definitions.get(beanName));
index 7fd07fe770ff32c1d28a94be1c21500cd067be4d..a25034e347a3e4dee381b9a2f0819102e91212f7 100644 (file)
@@ -18,7 +18,7 @@ import org.springframework.beans.factory.InitializingBean;
 import org.springframework.validation.MapBindingResult;
 
 public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
-               BeanNameAware, StructureAware<TreeSPath> {
+               BeanNameAware {
 
        private final ExecutionSpec executionSpec;
        private String name = null;
@@ -95,6 +95,11 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                                if (executable instanceof StructureAware) {
                                        ((StructureAware<TreeSPath>) executable).notifyCurrentPath(
                                                        registry, new TreeSPath(path));
+                               } else if (executable instanceof DefaultExecutionFlow) {
+                                       // so we don't need to have DefaultExecutionFlow
+                                       // implementing StructureAware
+                                       DefaultExecutionFlow flow = (DefaultExecutionFlow) executable;
+                                       flow.setPath(path + '/' + flow.getName());
                                }
                        }
                }
@@ -168,11 +173,4 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                this.registry = registry;
        }
 
-       public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,
-                       TreeSPath path) {
-               if (this.path == null) {
-                       this.path = path.toString();
-               }
-       }
-
 }
index 07ec879aa2b15c6192118d2a5f8758664896493f..52195903cb4fc79152f235d936b9268752b3005f 100644 (file)
@@ -31,14 +31,10 @@ public class Echo implements Runnable {
                }
        }
 
-       protected Log log() {
+       private Log log() {
                return log != null ? log : defaultLog;
        }
 
-       public void setLog(Log log) {
-               this.log = log;
-       }
-
        public void setMessage(String message) {
                this.message = message;
        }
index c6c3c64b3207c4c8250df67e5c4c373f0ac09e16..f63903c56048cfb143ed03f0b25227a3443d45a1 100644 (file)
@@ -8,7 +8,7 @@
 
        <bean id="slcDefault.executionResources" parent="slcTemplate.fileResources"
                scope="execution" lazy-init="true">
-               <aop:scoped-proxy />
+               <aop:scoped-proxy proxy-target-class="false" />
                <property name="executionContext" ref="executionContext" />
        </bean>
 
index dba01b962f5f6e3a60acab412ce22b5c45e6190e..4399b8d89fa36f6c1622da5d6955a4e7928eaaee 100644 (file)
@@ -21,7 +21,7 @@
 
        <bean id="executionStack" class="org.argeo.slc.core.execution.DefaultExecutionStack"
                scope="execution">
-               <aop:scoped-proxy />
+               <aop:scoped-proxy proxy-target-class="false" />
        </bean>
 
        <bean id="instantiationManager" class="org.argeo.slc.core.execution.InstantiationManager" />
diff --git a/runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/execution/simple.xml b/runtime/org.argeo.slc.core/src/main/resources/org/argeo/slc/core/execution/simple.xml
new file mode 100644 (file)
index 0000000..a6887e3
--- /dev/null
@@ -0,0 +1,31 @@
+<?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">
+
+       <description>Default Capabilities</description>
+
+       <import resource="runtime.xml" />
+
+       <bean id="executionContext" class="org.argeo.slc.core.execution.MapExecutionContext"
+               scope="execution">
+               <aop:scoped-proxy proxy-target-class="false" />
+       </bean>
+
+       <bean id="executionFlowDescriptorConverter"
+               class="org.argeo.slc.core.execution.DefaultExecutionFlowDescriptorConverter"></bean>
+
+       <bean
+               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
+               <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
+               <property name="ignoreUnresolvablePlaceholders" value="true" />
+       </bean>
+
+       <bean id="parameterRef" factory-bean="instantiationManager"
+               factory-method="createRef" abstract="true" />
+
+</beans>
\ No newline at end of file
index 3188e58fdc7ff9a6f428123ba974e65f269a701c..f17edcfebccaac2c9208130195fb01d0a0adb82e 100644 (file)
        <description>Default Capabilities</description>
 
        <import resource="runtime.xml" />
+       <import resource="simple.xml" />
+
        <import resource="specs.xml" />
        <import resource="templates.xml" />
        <import resource="defaults.xml" />
        <import resource="utils.xml" />
        <import resource="tasks/core.xml" />
 
-       <bean id="executionContext" class="org.argeo.slc.core.execution.MapExecutionContext"
-               scope="execution">
-               <aop:scoped-proxy />
-       </bean>
-
-       <bean id="executionFlowDescriptorConverter"
-               class="org.argeo.slc.core.execution.DefaultExecutionFlowDescriptorConverter"></bean>
-
-       <bean
-               class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
-               <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
-               <property name="ignoreUnresolvablePlaceholders" value="true" />
-       </bean>
-
-       <bean id="parameterRef" factory-bean="instantiationManager"
-               factory-method="createRef" abstract="true" />
-
 </beans>
\ No newline at end of file
diff --git a/runtime/org.argeo.slc.support.osgi/src/main/resources/org/argeo/slc/osgi/execution.xml b/runtime/org.argeo.slc.support.osgi/src/main/resources/org/argeo/slc/osgi/execution.xml
new file mode 100644 (file)
index 0000000..f64b0ab
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns:osgi="http://www.springframework.org/schema/osgi"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans"
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd
+       http://www.springframework.org/schema/beans   
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
+
+       <osgi:service interface="org.argeo.slc.execution.ExecutionContext"
+               ref="executionContext" />
+       <osgi:service interface="org.argeo.slc.execution.ExecutionFlowDescriptorConverter"
+               ref="executionFlowDescriptorConverter" />
+
+       <bean class="org.argeo.slc.osgi.MultipleServiceExporterPostProcessor">
+               <property name="interfaces">
+                       <list>
+                               <value>org.argeo.slc.execution.ExecutionFlow
+                               </value>
+                       </list>
+               </property>
+       </bean>
+</beans>
\ No newline at end of file
diff --git a/runtime/org.argeo.slc.support.osgi/src/main/resources/org/argeo/slc/osgi/execution/spring.xml b/runtime/org.argeo.slc.support.osgi/src/main/resources/org/argeo/slc/osgi/execution/spring.xml
deleted file mode 100644 (file)
index f64b0ab..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<beans xmlns:osgi="http://www.springframework.org/schema/osgi"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.springframework.org/schema/beans"
-       xsi:schemaLocation="http://www.springframework.org/schema/osgi  
-       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd
-       http://www.springframework.org/schema/beans   
-       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
-
-       <osgi:service interface="org.argeo.slc.execution.ExecutionContext"
-               ref="executionContext" />
-       <osgi:service interface="org.argeo.slc.execution.ExecutionFlowDescriptorConverter"
-               ref="executionFlowDescriptorConverter" />
-
-       <bean class="org.argeo.slc.osgi.MultipleServiceExporterPostProcessor">
-               <property name="interfaces">
-                       <list>
-                               <value>org.argeo.slc.execution.ExecutionFlow
-                               </value>
-                       </list>
-               </property>
-       </bean>
-</beans>
\ No newline at end of file