From: Mathieu Baudier Date: Wed, 25 Feb 2009 14:12:44 +0000 (+0000) Subject: Rename to support equinox X-Git-Tag: argeo-slc-2.1.7~2124 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;ds=inline;h=1f0b304d0a789fff4fec7005a59dedaa40a0b61d;p=gpl%2Fargeo-slc.git Rename to support equinox git-svn-id: https://svn.argeo.org/slc/trunk@2175 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/runtime/org.argeo.slc.execution/.classpath b/runtime/org.argeo.slc.execution/.classpath deleted file mode 100644 index 30baf1326..000000000 --- a/runtime/org.argeo.slc.execution/.classpath +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/runtime/org.argeo.slc.execution/.project b/runtime/org.argeo.slc.execution/.project deleted file mode 100644 index 63788ab3e..000000000 --- a/runtime/org.argeo.slc.execution/.project +++ /dev/null @@ -1,29 +0,0 @@ - - - org.argeo.slc.execution - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.maven.ide.eclipse.maven2Builder - - - - - org.springframework.ide.eclipse.core.springbuilder - - - - - - org.springframework.ide.eclipse.core.springnature - org.maven.ide.eclipse.maven2Nature - org.eclipse.jdt.core.javanature - - diff --git a/runtime/org.argeo.slc.execution/.springBeans b/runtime/org.argeo.slc.execution/.springBeans deleted file mode 100644 index c11d81486..000000000 --- a/runtime/org.argeo.slc.execution/.springBeans +++ /dev/null @@ -1,13 +0,0 @@ - - - 1 - - - - - - - - - - diff --git a/runtime/org.argeo.slc.execution/pom.xml b/runtime/org.argeo.slc.execution/pom.xml deleted file mode 100644 index 8844d3a17..000000000 --- a/runtime/org.argeo.slc.execution/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - 4.0.0 - - org.argeo.slc - argeo-slc - 0.11.3-SNAPSHOT - ../../org.argeo.slc - - org.argeo.slc.runtime - org.argeo.slc.execution - SLC Execution - jar - - - - - maven-jar-plugin - - - org.apache.felix - maven-bundle-plugin - ${version.maven-bundle-plugin} - - - - org.argeo.slc.* - - - - - - - - - - - org.argeo.slc.runtime - org.argeo.slc.support.simple - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.springframework.osgi - org.springframework.osgi.core - - - - - net.sourceforge.cglib - com.springsource.net.sf.cglib - 2.1.3 - - - org.objectweb.asm - com.springsource.org.objectweb.asm.attrs - 2.2.0 - - - diff --git a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java b/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java deleted file mode 100644 index ca49e8fdc..000000000 --- a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java +++ /dev/null @@ -1,47 +0,0 @@ -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 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 executionModules) { - this.executionModules = executionModules; - } - -} diff --git a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/EfLauncher.java b/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/EfLauncher.java deleted file mode 100644 index b3937b78d..000000000 --- a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/EfLauncher.java +++ /dev/null @@ -1,124 +0,0 @@ -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); - } -} diff --git a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/ExecutionFlowFactory.java b/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/ExecutionFlowFactory.java deleted file mode 100644 index c8da41a90..000000000 --- a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/ExecutionFlowFactory.java +++ /dev/null @@ -1,27 +0,0 @@ -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 executables = new ArrayList(); - - - public ExecutionFlow createExecutionFlow(Map attributes){ - SimpleExecutionFlow executionFlow = new SimpleExecutionFlow(); - executionFlow.setExecutables(executables); - return executionFlow; - } - - - public void setExecutables(List executables) { - this.executables = executables; - } - - -} diff --git a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/ExecutionTargetSource.java b/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/ExecutionTargetSource.java deleted file mode 100644 index 063da14b2..000000000 --- a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/ExecutionTargetSource.java +++ /dev/null @@ -1,45 +0,0 @@ -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 - - } - -} diff --git a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/TestLaunch.java b/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/TestLaunch.java deleted file mode 100644 index 91e8d93a9..000000000 --- a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/execution/old/TestLaunch.java +++ /dev/null @@ -1,32 +0,0 @@ -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; - } - -} diff --git a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/osgi/OsgiExecutionModule.java b/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/osgi/OsgiExecutionModule.java deleted file mode 100644 index 1708240e9..000000000 --- a/runtime/org.argeo.slc.execution/src/main/java/org/argeo/slc/osgi/OsgiExecutionModule.java +++ /dev/null @@ -1,24 +0,0 @@ -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; - } - -} diff --git a/runtime/org.argeo.slc.execution/src/main/resources/META-INF/spring/osgi.xml b/runtime/org.argeo.slc.execution/src/main/resources/META-INF/spring/osgi.xml deleted file mode 100644 index 84312c535..000000000 --- a/runtime/org.argeo.slc.execution/src/main/resources/META-INF/spring/osgi.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/runtime/org.argeo.slc.support.equinox/.classpath b/runtime/org.argeo.slc.support.equinox/.classpath new file mode 100644 index 000000000..30baf1326 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/runtime/org.argeo.slc.support.equinox/.project b/runtime/org.argeo.slc.support.equinox/.project new file mode 100644 index 000000000..63788ab3e --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/.project @@ -0,0 +1,29 @@ + + + org.argeo.slc.execution + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + org.springframework.ide.eclipse.core.springbuilder + + + + + + org.springframework.ide.eclipse.core.springnature + org.maven.ide.eclipse.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/runtime/org.argeo.slc.support.equinox/.springBeans b/runtime/org.argeo.slc.support.equinox/.springBeans new file mode 100644 index 000000000..c11d81486 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/.springBeans @@ -0,0 +1,13 @@ + + + 1 + + + + + + + + + + diff --git a/runtime/org.argeo.slc.support.equinox/pom.xml b/runtime/org.argeo.slc.support.equinox/pom.xml new file mode 100644 index 000000000..8844d3a17 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/pom.xml @@ -0,0 +1,69 @@ + + 4.0.0 + + org.argeo.slc + argeo-slc + 0.11.3-SNAPSHOT + ../../org.argeo.slc + + org.argeo.slc.runtime + org.argeo.slc.execution + SLC Execution + jar + + + + + maven-jar-plugin + + + org.apache.felix + maven-bundle-plugin + ${version.maven-bundle-plugin} + + + + org.argeo.slc.* + + + + + + + + + + + org.argeo.slc.runtime + org.argeo.slc.support.simple + + + + org.eclipse.osgi + org.eclipse.osgi + + + org.springframework.osgi + org.springframework.osgi.core + + + + + net.sourceforge.cglib + com.springsource.net.sf.cglib + 2.1.3 + + + org.objectweb.asm + com.springsource.org.objectweb.asm.attrs + 2.2.0 + + + diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java new file mode 100644 index 000000000..ca49e8fdc --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/equinox/ExecutionCommandProvider.java @@ -0,0 +1,47 @@ +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 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 executionModules) { + this.executionModules = executionModules; + } + +} diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/EfLauncher.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/EfLauncher.java new file mode 100644 index 000000000..b3937b78d --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/EfLauncher.java @@ -0,0 +1,124 @@ +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); + } +} diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/ExecutionFlowFactory.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/ExecutionFlowFactory.java new file mode 100644 index 000000000..c8da41a90 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/ExecutionFlowFactory.java @@ -0,0 +1,27 @@ +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 executables = new ArrayList(); + + + public ExecutionFlow createExecutionFlow(Map attributes){ + SimpleExecutionFlow executionFlow = new SimpleExecutionFlow(); + executionFlow.setExecutables(executables); + return executionFlow; + } + + + public void setExecutables(List executables) { + this.executables = executables; + } + + +} diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/ExecutionTargetSource.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/ExecutionTargetSource.java new file mode 100644 index 000000000..063da14b2 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/ExecutionTargetSource.java @@ -0,0 +1,45 @@ +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 + + } + +} diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/TestLaunch.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/TestLaunch.java new file mode 100644 index 000000000..91e8d93a9 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/execution/old/TestLaunch.java @@ -0,0 +1,32 @@ +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; + } + +} diff --git a/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/osgi/OsgiExecutionModule.java b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/osgi/OsgiExecutionModule.java new file mode 100644 index 000000000..1708240e9 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/java/org/argeo/slc/osgi/OsgiExecutionModule.java @@ -0,0 +1,24 @@ +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; + } + +} diff --git a/runtime/org.argeo.slc.support.equinox/src/main/resources/META-INF/spring/osgi.xml b/runtime/org.argeo.slc.support.equinox/src/main/resources/META-INF/spring/osgi.xml new file mode 100644 index 000000000..84312c535 --- /dev/null +++ b/runtime/org.argeo.slc.support.equinox/src/main/resources/META-INF/spring/osgi.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file