<packaging>pom</packaging>
<name>Argeo SLC</name>
<version>0.11.3-SNAPSHOT</version>
- <description>SLC Distribution</description>
<url>
http://www.argeo.org/projects/slc/${project.artifactId}/${project.version}
</url>
<artifactId>org.argeo.slc.server</artifactId>
<version>${project.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.argeo.slc.runtime</groupId>
+ <artifactId>org.argeo.slc.execution</artifactId>
+ <version>${project.version}</version>
+ </dependency>
<dependency>
<groupId>org.argeo.slc.runtime</groupId>
<artifactId>org.argeo.slc.support.ws.client</artifactId>
<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.execution.*
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
</plugins>
</build>
<dependencies>
<artifactId>com.springsource.org.codehaus.groovy</artifactId>
<version>1.5.7</version>
</dependency>
- <dependency>
- <groupId>org.beanshell</groupId>
- <artifactId>com.springsource.bsh</artifactId>
- <version>2.0.0.b4</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>
}
public void registerDestructionCallback(String name, Runnable callback) {
- throw new UnsupportedOperationException();
+ // TODO: implement it
+ //throw new UnsupportedOperationException();
}
public Object remove(String name) {
private List<Executable> executables = new ArrayList<Executable>();
private final String uuid = UUID.randomUUID().toString();
+
+ public SimpleExecutionFlow(){
+
+ }
+
+ public SimpleExecutionFlow(Map<String, Object> parameters){
+ this.parameters.putAll(parameters);
+ }
public void execute() {
for (Executable executable : executables) {
if (flow == null)
throw new SlcException("No flow is currently initializing."
+ " Declare flow refs as inner beans or prototypes.");
-
+/*
RefSpecAttribute refSpecAttribute = (RefSpecAttribute) attributes
.get(name);
Class<?> targetClass = refSpecAttribute.getTargetClass();
proxyFactory.setProxyTargetClass(true);
proxyFactory.setTargetSource(targetSource);
- return proxyFactory.getProxy();
+ return proxyFactory.getProxy();*/
+ return flow.getParameter(name);
}
public void setBeanName(String name) {
--- /dev/null
+package org.argeo.slc.execution;
+
+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;
+ }
+
+}
public class SlcMain {
public enum Mode {
- single, agent
+ single, agent, osgi
}
private static Log log = null;
applicationContext.start();
log.info("SLC Agent context started.");
}
+ // OSGi
+ else if (mode.equals(Mode.osgi)) {
+ final ConfigurableApplicationContext applicationContext;
+ if (runtimeStr == null) {
+ applicationContext = new ClassPathXmlApplicationContext(
+ DEFAULT_AGENT_CONTEXT);
+ } else {
+ applicationContext = new FileSystemXmlApplicationContext(
+ runtimeStr);
+ }
+ applicationContext.registerShutdownHook();
+ applicationContext.start();
+ log.info("SLC Agent context started.");
+ }
}
public static void printUsage() {
<configuration>
<instructions>
<Export-Package>
- org.argeo.slc.*
+ org.argeo.slc.*,org.argeo.slc.core.test.spring
</Export-Package>
<Import-Package>*,org.apache.commons.logging;version="1.1",
org.dbunit;resolution:="optional",