+++ /dev/null
-<?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"/>
-</classpath>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.argeo.slc.execution</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.springframework.ide.eclipse.core.springbuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.springframework.ide.eclipse.core.springnature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<beansProjectDescription>
- <version>1</version>
- <pluginVersion><![CDATA[2.2.1.v200811281800]]></pluginVersion>
- <configSuffixes>
- <configSuffix><![CDATA[xml]]></configSuffix>
- </configSuffixes>
- <enableImports><![CDATA[true]]></enableImports>
- <configs>
- </configs>
- <configSets>
- </configSets>
-</beansProjectDescription>
+++ /dev/null
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <parent>
- <groupId>org.argeo.slc</groupId>
- <artifactId>argeo-slc</artifactId>
- <version>0.11.3-SNAPSHOT</version>
- <relativePath>../../org.argeo.slc</relativePath>
- </parent>
- <groupId>org.argeo.slc.runtime</groupId>
- <artifactId>org.argeo.slc.execution</artifactId>
- <name>SLC Execution</name>
- <packaging>jar</packaging>
- <properties></properties>
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-jar-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <version>${version.maven-bundle-plugin}</version>
- <configuration>
- <instructions>
- <Export-Package>
- org.argeo.slc.*
- </Export-Package>
- </instructions>
- </configuration>
- </plugin>
- </plugins>
- </build>
- <dependencies>
-
-
- <dependency>
- <groupId>org.argeo.slc.runtime</groupId>
- <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.codehaus.groovy</groupId>
- <artifactId>com.springsource.org.codehaus.groovy</artifactId>
- <version>1.5.7</version>
- </dependency>
- -->
- <dependency>
- <groupId>net.sourceforge.cglib</groupId>
- <artifactId>com.springsource.net.sf.cglib</artifactId>
- <version>2.1.3</version>
- </dependency>
- <dependency>
- <groupId>org.objectweb.asm</groupId>
- <artifactId>com.springsource.org.objectweb.asm.attrs</artifactId>
- <version>2.2.0</version>
- </dependency>
- </dependencies>
-</project>
+++ /dev/null
-package org.argeo.slc.equinox;
-
-import java.util.List;
-
-import org.argeo.slc.execution.ExecutionModule;
-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;
- }
-
-}
+++ /dev/null
-package org.argeo.slc.execution.old;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.core.execution.ConsoleContextDescriber;
-import org.argeo.slc.core.execution.ExecutionContext;
-import org.argeo.slc.core.execution.ExecutionFinishedEvent;
-import org.argeo.slc.core.execution.NewExecutionEvent;
-import org.argeo.slc.logging.Log4jUtils;
-import org.argeo.slc.process.SlcExecution;
-import org.springframework.beans.MutablePropertyValues;
-import org.springframework.beans.PropertyValue;
-import org.springframework.beans.factory.config.BeanDefinition;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionParser;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.ApplicationEvent;
-import org.springframework.context.ApplicationListener;
-import org.springframework.context.support.FileSystemXmlApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-
-public class EfLauncher implements ApplicationListener {
- private final Log log;
-
- private boolean running = false;
-
- public EfLauncher() {
- Properties userProperties = new Properties();
- FileInputStream in = null;
- try {
- in = new FileInputStream("src/slc/conf/slc.properties");
- userProperties.load(in);
- } catch (Exception e) {
- e.printStackTrace();
- } finally {
- IOUtils.closeQuietly(in);
- }
-
- // Set as System properties
- for (Object obj : userProperties.keySet()) {
- String key = obj.toString();
- System.setProperty(key, userProperties.getProperty(key));
- }
-
- // Logging
- System.setProperty("log4j.defaultInitOverride", "true");
-
- Log4jUtils.initLog4j(null);
- log = LogFactory.getLog(EfLauncher.class);
- }
-
- public void launch(String script) {
- // describe(script);
-
- GenericApplicationContext context = new GenericApplicationContext();
- XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
- reader.loadBeanDefinitions(script);
- // FileSystemXmlApplicationContext context = new
- // FileSystemXmlApplicationContext(
- // script);
- context.addApplicationListener(this);
- context.refresh();
- context.start();
- log.debug("Context initialized");
-
- SlcExecution slcExecution = new SlcExecution();
- slcExecution.getAttributes().put("slc.flows", "main");
-
- running = true;
- context.publishEvent(new NewExecutionEvent(this, slcExecution));
-
- synchronized (this) {
- while (running)
- try {
- wait();
- } catch (InterruptedException e) {
- // silent
- }
- }
- }
-
- public synchronized boolean isRunning() {
- return running;
- }
-
- public synchronized void setRunning(boolean running) {
- this.running = running;
- }
-
- public void onApplicationEvent(ApplicationEvent event) {
- if (event instanceof ExecutionFinishedEvent) {
- ExecutionContext executionContext = ((ExecutionFinishedEvent) event)
- .getExecutionContext();
- log.debug("Execution " + executionContext.getUuid()
- + " finished, stopping launcher...");
- synchronized (this) {
- running = false;
- notifyAll();
- }
- }
-
- }
-
- public static void main(String[] args) {
- String script = "file:src/slc/conf/main.xml";
- new EfLauncher().launch(script);
- }
-
- private static void describe(String script) {
- SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
- XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(registry);
- reader.loadBeanDefinitions(script);
- new ConsoleContextDescriber().describeContext(registry);
- }
-}
+++ /dev/null
-package org.argeo.slc.execution.old;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.argeo.slc.core.execution.SimpleExecutionFlow;
-import org.argeo.slc.execution.ExecutionFlow;
-import org.argeo.slc.process.Executable;
-
-public class ExecutionFlowFactory {
- private List<Executable> executables = new ArrayList<Executable>();
-
-
- public ExecutionFlow createExecutionFlow(Map<String, Object> attributes){
- SimpleExecutionFlow executionFlow = new SimpleExecutionFlow();
- executionFlow.setExecutables(executables);
- return executionFlow;
- }
-
-
- public void setExecutables(List<Executable> executables) {
- this.executables = executables;
- }
-
-
-}
+++ /dev/null
-package org.argeo.slc.execution.old;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.argeo.slc.execution.ExecutionFlow;
-import org.springframework.aop.TargetSource;
-
-public class ExecutionTargetSource implements TargetSource {
- private final static Log log = LogFactory
- .getLog(ExecutionTargetSource.class);
-
- private final String name;
- private final Class<?> targetClass;
- private final ExecutionFlow executionFlow;
-
- public ExecutionTargetSource(ExecutionFlow executionFlow,
- Class<?> targetClass, String name) {
- this.executionFlow = executionFlow;
- this.targetClass = targetClass;
- this.name = name;
- }
-
- public Object getTarget() throws Exception {
- if (log.isTraceEnabled())
- log.trace("Getting object " + name);
- Object obj = executionFlow.getParameter(name);
- if (log.isTraceEnabled())
- log.trace("Target object " + obj);
- return obj;
- }
-
- public Class getTargetClass() {
- return targetClass;
- }
-
- public boolean isStatic() {
- return false;
- }
-
- public void releaseTarget(Object target) throws Exception {
- // TODO Auto-generated method stub
-
- }
-
-}
+++ /dev/null
-package org.argeo.slc.execution.old;
-
-import org.argeo.slc.core.execution.NewExecutionEvent;
-import org.argeo.slc.process.SlcExecution;
-import org.springframework.beans.factory.annotation.Required;
-import org.springframework.context.ApplicationEventPublisher;
-import org.springframework.context.ApplicationEventPublisherAware;
-
-public class TestLaunch implements ApplicationEventPublisherAware {
- private ApplicationEventPublisher applicationEventPublisher;
-
- private String flowName;
-
- public void launch() {
- SlcExecution slcExecution = new SlcExecution();
- slcExecution.getAttributes().put("slc.flows", flowName);
- applicationEventPublisher.publishEvent(new NewExecutionEvent(this,
- slcExecution));
-
- }
-
- @Required
- public void setFlowName(String flowName) {
- this.flowName = flowName;
- }
-
- public void setApplicationEventPublisher(
- ApplicationEventPublisher applicationEventPublisher) {
- this.applicationEventPublisher = applicationEventPublisher;
- }
-
-}
+++ /dev/null
-package org.argeo.slc.osgi;
-
-import org.argeo.slc.core.execution.AbstractSpringExecutionModule;
-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;
- }
-
-}
+++ /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.equinox.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"?>
+<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"/>
+</classpath>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.argeo.slc.execution</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.springframework.ide.eclipse.core.springbuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.springframework.ide.eclipse.core.springnature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<beansProjectDescription>
+ <version>1</version>
+ <pluginVersion><![CDATA[2.2.1.v200811281800]]></pluginVersion>
+ <configSuffixes>
+ <configSuffix><![CDATA[xml]]></configSuffix>
+ </configSuffixes>
+ <enableImports><![CDATA[true]]></enableImports>
+ <configs>
+ </configs>
+ <configSets>
+ </configSets>
+</beansProjectDescription>
--- /dev/null
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.argeo.slc</groupId>
+ <artifactId>argeo-slc</artifactId>
+ <version>0.11.3-SNAPSHOT</version>
+ <relativePath>../../org.argeo.slc</relativePath>
+ </parent>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.execution</artifactId>
+ <name>SLC Execution</name>
+ <packaging>jar</packaging>
+ <properties></properties>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <version>${version.maven-bundle-plugin}</version>
+ <configuration>
+ <instructions>
+ <Export-Package>
+ org.argeo.slc.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ <dependencies>
+
+
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <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.codehaus.groovy</groupId>
+ <artifactId>com.springsource.org.codehaus.groovy</artifactId>
+ <version>1.5.7</version>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>net.sourceforge.cglib</groupId>
+ <artifactId>com.springsource.net.sf.cglib</artifactId>
+ <version>2.1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.objectweb.asm</groupId>
+ <artifactId>com.springsource.org.objectweb.asm.attrs</artifactId>
+ <version>2.2.0</version>
+ </dependency>
+ </dependencies>
+</project>
--- /dev/null
+package org.argeo.slc.equinox;
+
+import java.util.List;
+
+import org.argeo.slc.execution.ExecutionModule;
+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;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.execution.old;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.core.execution.ConsoleContextDescriber;
+import org.argeo.slc.core.execution.ExecutionContext;
+import org.argeo.slc.core.execution.ExecutionFinishedEvent;
+import org.argeo.slc.core.execution.NewExecutionEvent;
+import org.argeo.slc.logging.Log4jUtils;
+import org.argeo.slc.process.SlcExecution;
+import org.springframework.beans.MutablePropertyValues;
+import org.springframework.beans.PropertyValue;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionParser;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.ApplicationEvent;
+import org.springframework.context.ApplicationListener;
+import org.springframework.context.support.FileSystemXmlApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+
+public class EfLauncher implements ApplicationListener {
+ private final Log log;
+
+ private boolean running = false;
+
+ public EfLauncher() {
+ Properties userProperties = new Properties();
+ FileInputStream in = null;
+ try {
+ in = new FileInputStream("src/slc/conf/slc.properties");
+ userProperties.load(in);
+ } catch (Exception e) {
+ e.printStackTrace();
+ } finally {
+ IOUtils.closeQuietly(in);
+ }
+
+ // Set as System properties
+ for (Object obj : userProperties.keySet()) {
+ String key = obj.toString();
+ System.setProperty(key, userProperties.getProperty(key));
+ }
+
+ // Logging
+ System.setProperty("log4j.defaultInitOverride", "true");
+
+ Log4jUtils.initLog4j(null);
+ log = LogFactory.getLog(EfLauncher.class);
+ }
+
+ public void launch(String script) {
+ // describe(script);
+
+ GenericApplicationContext context = new GenericApplicationContext();
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
+ reader.loadBeanDefinitions(script);
+ // FileSystemXmlApplicationContext context = new
+ // FileSystemXmlApplicationContext(
+ // script);
+ context.addApplicationListener(this);
+ context.refresh();
+ context.start();
+ log.debug("Context initialized");
+
+ SlcExecution slcExecution = new SlcExecution();
+ slcExecution.getAttributes().put("slc.flows", "main");
+
+ running = true;
+ context.publishEvent(new NewExecutionEvent(this, slcExecution));
+
+ synchronized (this) {
+ while (running)
+ try {
+ wait();
+ } catch (InterruptedException e) {
+ // silent
+ }
+ }
+ }
+
+ public synchronized boolean isRunning() {
+ return running;
+ }
+
+ public synchronized void setRunning(boolean running) {
+ this.running = running;
+ }
+
+ public void onApplicationEvent(ApplicationEvent event) {
+ if (event instanceof ExecutionFinishedEvent) {
+ ExecutionContext executionContext = ((ExecutionFinishedEvent) event)
+ .getExecutionContext();
+ log.debug("Execution " + executionContext.getUuid()
+ + " finished, stopping launcher...");
+ synchronized (this) {
+ running = false;
+ notifyAll();
+ }
+ }
+
+ }
+
+ public static void main(String[] args) {
+ String script = "file:src/slc/conf/main.xml";
+ new EfLauncher().launch(script);
+ }
+
+ private static void describe(String script) {
+ SimpleBeanDefinitionRegistry registry = new SimpleBeanDefinitionRegistry();
+ XmlBeanDefinitionReader reader = new XmlBeanDefinitionReader(registry);
+ reader.loadBeanDefinitions(script);
+ new ConsoleContextDescriber().describeContext(registry);
+ }
+}
--- /dev/null
+package org.argeo.slc.execution.old;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.argeo.slc.core.execution.SimpleExecutionFlow;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.process.Executable;
+
+public class ExecutionFlowFactory {
+ private List<Executable> executables = new ArrayList<Executable>();
+
+
+ public ExecutionFlow createExecutionFlow(Map<String, Object> attributes){
+ SimpleExecutionFlow executionFlow = new SimpleExecutionFlow();
+ executionFlow.setExecutables(executables);
+ return executionFlow;
+ }
+
+
+ public void setExecutables(List<Executable> executables) {
+ this.executables = executables;
+ }
+
+
+}
--- /dev/null
+package org.argeo.slc.execution.old;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.springframework.aop.TargetSource;
+
+public class ExecutionTargetSource implements TargetSource {
+ private final static Log log = LogFactory
+ .getLog(ExecutionTargetSource.class);
+
+ private final String name;
+ private final Class<?> targetClass;
+ private final ExecutionFlow executionFlow;
+
+ public ExecutionTargetSource(ExecutionFlow executionFlow,
+ Class<?> targetClass, String name) {
+ this.executionFlow = executionFlow;
+ this.targetClass = targetClass;
+ this.name = name;
+ }
+
+ public Object getTarget() throws Exception {
+ if (log.isTraceEnabled())
+ log.trace("Getting object " + name);
+ Object obj = executionFlow.getParameter(name);
+ if (log.isTraceEnabled())
+ log.trace("Target object " + obj);
+ return obj;
+ }
+
+ public Class getTargetClass() {
+ return targetClass;
+ }
+
+ public boolean isStatic() {
+ return false;
+ }
+
+ public void releaseTarget(Object target) throws Exception {
+ // TODO Auto-generated method stub
+
+ }
+
+}
--- /dev/null
+package org.argeo.slc.execution.old;
+
+import org.argeo.slc.core.execution.NewExecutionEvent;
+import org.argeo.slc.process.SlcExecution;
+import org.springframework.beans.factory.annotation.Required;
+import org.springframework.context.ApplicationEventPublisher;
+import org.springframework.context.ApplicationEventPublisherAware;
+
+public class TestLaunch implements ApplicationEventPublisherAware {
+ private ApplicationEventPublisher applicationEventPublisher;
+
+ private String flowName;
+
+ public void launch() {
+ SlcExecution slcExecution = new SlcExecution();
+ slcExecution.getAttributes().put("slc.flows", flowName);
+ applicationEventPublisher.publishEvent(new NewExecutionEvent(this,
+ slcExecution));
+
+ }
+
+ @Required
+ public void setFlowName(String flowName) {
+ this.flowName = flowName;
+ }
+
+ public void setApplicationEventPublisher(
+ ApplicationEventPublisher applicationEventPublisher) {
+ this.applicationEventPublisher = applicationEventPublisher;
+ }
+
+}
--- /dev/null
+package org.argeo.slc.osgi;
+
+import org.argeo.slc.core.execution.AbstractSpringExecutionModule;
+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;
+ }
+
+}
--- /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.equinox.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