]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Rename packages
authorMathieu Baudier <mbaudier@argeo.org>
Sun, 28 Sep 2008 15:29:13 +0000 (15:29 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Sun, 28 Sep 2008 15:29:13 +0000 (15:29 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@1667 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

42 files changed:
org.argeo.slc.detached/pom.xml
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/AbstractDetachedActivator.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedClient.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedContext.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedContextImpl.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedDriver.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedException.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedExecutionServer.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedExecutionServerImpl.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStep.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStepAnswer.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStepRequest.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/SimpleDetachedActivator.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/SpringStaticRefProvider.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/StaticRefProvider.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/drivers/FileDriver.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiContext.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServer.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServerImpl.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiTask.java [deleted file]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/AbstractDetachedActivator.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/AutoUiActivator.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedClient.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContext.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContextImpl.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedDriver.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedException.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedExecutionServer.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedExecutionServerImpl.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStep.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStepAnswer.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStepRequest.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/SimpleDetachedActivator.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/SpringStaticRefProvider.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/StaticRefProvider.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiContext.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiServer.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiServerImpl.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiTask.java [new file with mode: 0644]
org.argeo.slc.detached/src/main/resources/META-INF/MANIFEST.MF

index e79655a39f22223c44a9845dd0930ebbc280c05a..c1dac5e6e37dc6d7e7df4eab5a33d5846071f8c8 100644 (file)
                                                        ${pom.artifactId}
                                                </Bundle-SymbolicName>
                                                <Bundle-Activator>
-                                                       org.argeo.slc.autoui.AutoUiActivator
+                                                       org.argeo.slc.detached.AutoUiActivator
                                                </Bundle-Activator>
                                                <Export-Package>
-                                                       org.argeo.slc.autoui.*
+                                                       org.argeo.slc.detached.*
                                                </Export-Package>
                                        </instructions>
                                </configuration>
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/AbstractDetachedActivator.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/AbstractDetachedActivator.java
deleted file mode 100644 (file)
index 877d8b6..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.argeo.slc.autoui;
-
-import java.net.URL;
-import java.util.Properties;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.springframework.beans.factory.support.BeanDefinitionRegistry;
-import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.context.support.GenericApplicationContext;
-import org.springframework.core.io.UrlResource;
-
-public class AbstractDetachedActivator implements BundleActivator {
-       private final Log log = LogFactory.getLog(getClass());
-
-       private SpringStaticRefProvider staticRefProvider;
-
-       public final void start(BundleContext context) throws Exception {
-
-               Bundle bundle = context.getBundle();
-
-               // Creates application context with this class class loader
-               ClassLoader classLoader = getClass().getClassLoader();
-               Thread cur = Thread.currentThread();
-               ClassLoader save = cur.getContextClassLoader();
-               cur.setContextClassLoader(classLoader);
-
-               try {
-                       AbstractApplicationContext applicationContext = new GenericApplicationContext();
-                       XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(
-                                       (BeanDefinitionRegistry) applicationContext);
-
-                       URL url = bundle
-                                       .getResource("META-INF/slc/conf/applicationContext.xml");
-                       if (url != null) {
-                               System.out.println("Loads application context from bundle "
-                                               + bundle.getSymbolicName() + " (url=" + url + ")");
-                               xmlReader.loadBeanDefinitions(new UrlResource(url));
-
-                               // Register static ref provider
-                               staticRefProvider = new SpringStaticRefProvider(
-                                               applicationContext);
-                               Properties properties = new Properties();
-                               properties.setProperty("slc.detached.bundle", bundle
-                                               .getSymbolicName());
-                               context.registerService(StaticRefProvider.class.getName(),
-                                               staticRefProvider, properties);
-
-                       }
-
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       throw new Exception("Could not initialize application context");
-               } finally {
-                       cur.setContextClassLoader(save);
-               }
-
-               startAutoBundle(context);
-
-               log.info("SLC Detached bundle " + bundle.getSymbolicName() + " ("
-                               + bundle.getBundleId() + ") started");
-       }
-
-       /** Does nothing by default. */
-       protected void startAutoBundle(BundleContext context) throws Exception {
-
-       }
-
-       public final void stop(BundleContext context) throws Exception {
-               stopAutoBundle(context);
-
-               if (staticRefProvider != null) {
-                       staticRefProvider.close();
-               }
-
-       }
-
-       /** Does nothing by default. */
-       protected void stopAutoBundle(BundleContext context) throws Exception {
-
-       }
-
-       protected StaticRefProvider getStaticRefProvider() {
-               return staticRefProvider;
-       }
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/AutoUiActivator.java
deleted file mode 100644 (file)
index 21c7d49..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.argeo.slc.autoui;
-
-
-public class AutoUiActivator extends AbstractDetachedActivator {
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedClient.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedClient.java
deleted file mode 100644 (file)
index 6afeca7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.argeo.slc.autoui;
-
-public interface DetachedClient {
-       public void sendRequest(DetachedStepRequest request) throws Exception;
-
-       /** Blocks until next answer. */
-       public DetachedStepAnswer receiveAnswer() throws Exception;
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedContext.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedContext.java
deleted file mode 100644 (file)
index 5c4b2a6..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.argeo.slc.autoui;
-
-import java.util.List;
-
-public interface DetachedContext {
-       public Object getDynamicRef(String ref);
-
-       public void setDynamicRef(String ref, Object obj);
-
-       public String getCurrentPath();
-
-       public List getExecutedPaths();
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedContextImpl.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedContextImpl.java
deleted file mode 100644 (file)
index 93676b4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.argeo.slc.autoui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.Vector;
-
-public class DetachedContextImpl implements DetachedContext {
-       private List executedPaths = new Vector();
-       private String currentPath;
-       private Map dynamicRefs = new TreeMap();
-
-       public String getCurrentPath() {
-               return currentPath;
-       }
-
-       public void setDynamicRef(String ref, Object obj) {
-               dynamicRefs.put(ref, obj);
-       }
-
-       public Object getDynamicRef(String ref) {
-               if (dynamicRefs.containsKey(ref))
-                       return dynamicRefs.get(ref);
-               else
-                       return null;
-       }
-
-       public List getExecutedPaths() {
-               return new ArrayList(executedPaths);
-       }
-
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedDriver.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedDriver.java
deleted file mode 100644 (file)
index b973610..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.argeo.slc.autoui;
-
-public interface DetachedDriver {
-       /** Blocks until it receives a request. */
-       public DetachedStepRequest receiveRequest() throws Exception;
-       public void sendAnswer(DetachedStepAnswer answer) throws Exception;
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedException.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedException.java
deleted file mode 100644 (file)
index f6ba5d1..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.argeo.slc.autoui;
-
-public class DetachedException extends RuntimeException {
-       private Exception cause;
-
-       public DetachedException(String message) {
-               super(message);
-       }
-
-       public DetachedException(String message, Exception cause) {
-               super(message);
-               this.cause = cause;
-       }
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedExecutionServer.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedExecutionServer.java
deleted file mode 100644 (file)
index 637eab8..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.argeo.slc.autoui;
-
-public interface DetachedExecutionServer {
-       public DetachedStepAnswer executeStep(DetachedStepRequest request);
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedExecutionServerImpl.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedExecutionServerImpl.java
deleted file mode 100644 (file)
index 5cd4419..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-package org.argeo.slc.autoui;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-public class DetachedExecutionServerImpl implements DetachedExecutionServer {
-       private final DetachedContextImpl detachedContext;
-
-       private BundleContext bundleContext;
-       private DetachedDriver driver;
-
-       private boolean active = false;
-
-       public void setDriver(DetachedDriver driver) {
-               this.driver = driver;
-       }
-
-       public DetachedExecutionServerImpl() {
-               detachedContext = new DetachedContextImpl();
-       }
-
-       public DetachedStepAnswer executeStep(DetachedStepRequest request) {
-               try {
-                       DetachedStep step = null;
-
-                       // Find step
-                       ServiceReference[] refs = bundleContext.getAllServiceReferences(
-                                       StaticRefProvider.class.getName(), null);
-                       for (int i = 0; i < refs.length; i++) {
-                               StaticRefProvider provider = (StaticRefProvider) bundleContext
-                                               .getService(refs[i]);
-                               Object obj = provider.getStaticRef(request.getStepRef());
-                               if (obj != null) {
-                                       step = (DetachedStep) obj;
-                                       break;
-                               }
-                       }
-
-                       if (step == null)
-                               throw new DetachedException("Could not find step with ref "
-                                               + request.getStepRef());
-
-                       return step.execute(detachedContext, request);
-               } catch (DetachedException e) {
-                       throw e;
-               } catch (Exception e) {
-                       e.printStackTrace();
-                       throw new DetachedException(
-                                       "Unexpected exception while executing request " + request,
-                                       e);
-               }
-       }
-
-       public void init(BundleContext bundleContext) {
-               this.bundleContext = bundleContext;
-               Thread driverThread = new Thread(new Runnable() {
-
-                       public void run() {
-                               while (active) {
-                                       try {
-                                               DetachedStepRequest request = driver.receiveRequest();
-                                               executeStep(request);
-                                       } catch (Exception e) {
-                                               if (e instanceof RuntimeException)
-                                                       throw (RuntimeException) e;
-                                               else
-                                                       e.printStackTrace();
-                                       }
-                               }
-
-                       }
-               }, "driverThread");
-
-               active = true;
-
-               driverThread.start();
-       }
-
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStep.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStep.java
deleted file mode 100644 (file)
index cd20bb3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.argeo.slc.autoui;
-
-
-public interface DetachedStep {
-       public DetachedStepAnswer execute(DetachedContext detachedContext,
-                       DetachedStepRequest detachedStepRequest);
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStepAnswer.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStepAnswer.java
deleted file mode 100644 (file)
index 9d3edd1..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.argeo.slc.autoui;
-
-import java.util.Properties;
-
-public class DetachedStepAnswer {
-       public static int PROCESSED = 0;
-       public static int ERROR = 1;
-       public static int SKIPPED = 2;
-
-       private Properties outputParameters;
-       private int outputStatus;
-       private String log;
-
-       public Properties getOutputParameters() {
-               return outputParameters;
-       }
-
-       public void setOutputParameters(Properties outputParameters) {
-               this.outputParameters = outputParameters;
-       }
-
-       public int getOutputStatus() {
-               return outputStatus;
-       }
-
-       public void setOutputStatus(int outputStatus) {
-               this.outputStatus = outputStatus;
-       }
-
-       public String getLog() {
-               return log;
-       }
-
-       public void setLog(String log) {
-               this.log = log;
-       }
-
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStepRequest.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/DetachedStepRequest.java
deleted file mode 100644 (file)
index 65fda88..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.argeo.slc.autoui;
-
-import java.io.Serializable;
-import java.util.Properties;
-
-public class DetachedStepRequest implements Serializable {
-       private String uuid;
-       private Properties inputParameters;
-       private String stepRef;
-       private String path;
-
-       public Properties getInputParameters() {
-               return inputParameters;
-       }
-
-       public void setInputParameters(Properties inputParameters) {
-               this.inputParameters = inputParameters;
-       }
-
-       public String getStepRef() {
-               return stepRef;
-       }
-
-       public void setStepRef(String stepRef) {
-               this.stepRef = stepRef;
-       }
-
-       public String getPath() {
-               return path;
-       }
-
-       public void setPath(String path) {
-               this.path = path;
-       }
-
-       public String getUuid() {
-               return uuid;
-       }
-
-       public void setUuid(String uuid) {
-               this.uuid = uuid;
-       }
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/SimpleDetachedActivator.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/SimpleDetachedActivator.java
deleted file mode 100644 (file)
index 5f6ae56..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.argeo.slc.autoui;
-
-import java.util.Properties;
-
-import org.osgi.framework.BundleContext;
-
-public class SimpleDetachedActivator extends AbstractDetachedActivator {
-       private DetachedExecutionServerImpl executionServer;
-
-       protected void startAutoBundle(BundleContext context) throws Exception {
-               Object obj = getStaticRefProvider().getStaticRef("executionServer");
-               if (obj != null)
-                       executionServer = (DetachedExecutionServerImpl) obj;
-               else
-                       throw new DetachedException("Could not find execution server.");
-
-               executionServer.init(context);
-
-               context.registerService(DetachedExecutionServer.class.getName(),
-                               executionServer, new Properties());
-       }
-
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/SpringStaticRefProvider.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/SpringStaticRefProvider.java
deleted file mode 100644 (file)
index 8fb757f..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.argeo.slc.autoui;
-
-import org.springframework.beans.factory.NoSuchBeanDefinitionException;
-import org.springframework.context.ConfigurableApplicationContext;
-
-public class SpringStaticRefProvider implements StaticRefProvider {
-       private final ConfigurableApplicationContext applicationContext;
-
-       public SpringStaticRefProvider(
-                       ConfigurableApplicationContext applicationContext) {
-               this.applicationContext = applicationContext;
-       }
-
-       public Object getStaticRef(String id) {
-               try {
-                       return applicationContext.getBean(id);
-               } catch (NoSuchBeanDefinitionException e) {
-                       // silent
-                       return null;
-               }
-       }
-
-       public void close(){
-               applicationContext.close();
-       }
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/StaticRefProvider.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/StaticRefProvider.java
deleted file mode 100644 (file)
index d0f2b07..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-package org.argeo.slc.autoui;
-
-public interface StaticRefProvider {
-       /** Returns null if no such ref. */
-       public Object getStaticRef(String id);
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/drivers/FileDriver.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/drivers/FileDriver.java
deleted file mode 100644 (file)
index 263f633..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-package org.argeo.slc.autoui.drivers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import org.argeo.slc.autoui.DetachedClient;
-import org.argeo.slc.autoui.DetachedDriver;
-import org.argeo.slc.autoui.DetachedException;
-import org.argeo.slc.autoui.DetachedStepAnswer;
-import org.argeo.slc.autoui.DetachedStepRequest;
-
-public class FileDriver implements DetachedDriver, DetachedClient {
-       private File requestDir;
-       private File answerDir;
-
-       public synchronized DetachedStepRequest receiveRequest() throws Exception {
-               if (!requestDir.exists())
-                       throw new DetachedException("Request dir "
-                                       + requestDir.getCanonicalPath() + " does not exist.");
-
-               File file = null;
-               while (file == null) {
-                       File[] files = requestDir.listFiles();
-                       if (files.length > 0)
-                               file = files[0];
-                       else
-                               Thread.sleep(1000);
-               }
-
-               ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
-               DetachedStepRequest request = (DetachedStepRequest) in.readObject();
-               in.close();
-
-               file.delete();// move it to a processed dir instead?
-               return request;
-       }
-
-       public void sendAnswer(DetachedStepAnswer answer) throws Exception {
-               // TODO Auto-generated method stub
-
-       }
-
-       public DetachedStepAnswer receiveAnswer() throws Exception {
-               // TODO Auto-generated method stub
-               return null;
-       }
-
-       public void sendRequest(DetachedStepRequest request) throws Exception {
-               File file = new File(requestDir.getPath() + File.separator
-                               + request.getUuid());
-               ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(
-                               file));
-               out.writeObject(request);
-               out.close();
-       }
-
-       public void setRequestDir(File requestDir) {
-               this.requestDir = requestDir;
-       }
-
-       public void setAnswerDir(File answerDir) {
-               this.answerDir = answerDir;
-       }
-
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiContext.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiContext.java
deleted file mode 100644 (file)
index 00c27ba..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.argeo.slc.autoui.rmi;
-
-public interface AutoUiContext {
-       public Object getLocalRef(String key);
-
-       public void setLocalRef(String key, Object ref);
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServer.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServer.java
deleted file mode 100644 (file)
index a776b40..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.argeo.slc.autoui.rmi;
-
-import java.rmi.Remote;
-import java.rmi.RemoteException;
-
-public interface AutoUiServer extends Remote {
-       public Object executeTask(AutoUiTask task) throws RemoteException;
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServerImpl.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiServerImpl.java
deleted file mode 100644 (file)
index a3a7e7a..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.argeo.slc.autoui.rmi;
-
-import java.rmi.Naming;
-import java.rmi.RemoteException;
-import java.rmi.server.UnicastRemoteObject;
-import java.util.Map;
-import java.util.TreeMap;
-
-public class AutoUiServerImpl extends UnicastRemoteObject implements
-               AutoUiServer, AutoUiContext {
-       private Map map = new TreeMap();
-
-       public AutoUiServerImpl() throws RemoteException {
-               super();
-       }
-
-       public Object executeTask(AutoUiTask task) throws RemoteException {
-               try {
-                       return task.execute(this);
-               } catch (Exception e) {
-                       throw new RemoteException("Coul not execute task.", e);
-               }
-       }
-
-       public Object getLocalRef(String key) {
-               return map.get(key);
-       }
-
-       public void setLocalRef(String key, Object ref) {
-               map.put(key, ref);
-       }
-
-       public static void main(String[] args) {
-               if (System.getSecurityManager() == null) {
-                       System.setSecurityManager(new SecurityManager());
-               }
-               try {
-                       String name = "AutoUiServer";
-                       AutoUiServer engine = new AutoUiServerImpl();
-                       // AutoUiServer stub = (AutoUiServer) UnicastRemoteObject
-                       // .exportObject(engine, 0);
-                       // Registry registry = LocateRegistry.getRegistry();
-                       // registry.rebind(name, stub);
-                       Naming.rebind(name, engine);
-                       System.out.println("AutoUiServer bound");
-
-               } catch (Exception e) {
-                       System.err.println("AutoUiServer exception:");
-                       e.printStackTrace();
-               }
-
-       }
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiTask.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/autoui/rmi/AutoUiTask.java
deleted file mode 100644 (file)
index 2e3d1da..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.argeo.slc.autoui.rmi;
-
-import java.io.Serializable;
-
-public interface AutoUiTask extends Serializable {
-       public Object execute(AutoUiContext context) throws Exception;
-}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/AbstractDetachedActivator.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/AbstractDetachedActivator.java
new file mode 100644 (file)
index 0000000..eed2346
--- /dev/null
@@ -0,0 +1,90 @@
+package org.argeo.slc.detached;
+
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.springframework.beans.factory.support.BeanDefinitionRegistry;
+import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
+import org.springframework.context.support.AbstractApplicationContext;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.UrlResource;
+
+public class AbstractDetachedActivator implements BundleActivator {
+       private final Log log = LogFactory.getLog(getClass());
+
+       private SpringStaticRefProvider staticRefProvider;
+
+       public final void start(BundleContext context) throws Exception {
+
+               Bundle bundle = context.getBundle();
+
+               // Creates application context with this class class loader
+               ClassLoader classLoader = getClass().getClassLoader();
+               Thread cur = Thread.currentThread();
+               ClassLoader save = cur.getContextClassLoader();
+               cur.setContextClassLoader(classLoader);
+
+               try {
+                       AbstractApplicationContext applicationContext = new GenericApplicationContext();
+                       XmlBeanDefinitionReader xmlReader = new XmlBeanDefinitionReader(
+                                       (BeanDefinitionRegistry) applicationContext);
+
+                       URL url = bundle
+                                       .getResource("META-INF/slc/conf/applicationContext.xml");
+                       if (url != null) {
+                               System.out.println("Loads application context from bundle "
+                                               + bundle.getSymbolicName() + " (url=" + url + ")");
+                               xmlReader.loadBeanDefinitions(new UrlResource(url));
+
+                               // Register static ref provider
+                               staticRefProvider = new SpringStaticRefProvider(
+                                               applicationContext);
+                               Properties properties = new Properties();
+                               properties.setProperty("slc.detached.bundle", bundle
+                                               .getSymbolicName());
+                               context.registerService(StaticRefProvider.class.getName(),
+                                               staticRefProvider, properties);
+
+                       }
+
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       throw new Exception("Could not initialize application context");
+               } finally {
+                       cur.setContextClassLoader(save);
+               }
+
+               startAutoBundle(context);
+
+               log.info("SLC Detached bundle " + bundle.getSymbolicName() + " ("
+                               + bundle.getBundleId() + ") started");
+       }
+
+       /** Does nothing by default. */
+       protected void startAutoBundle(BundleContext context) throws Exception {
+
+       }
+
+       public final void stop(BundleContext context) throws Exception {
+               stopAutoBundle(context);
+
+               if (staticRefProvider != null) {
+                       staticRefProvider.close();
+               }
+
+       }
+
+       /** Does nothing by default. */
+       protected void stopAutoBundle(BundleContext context) throws Exception {
+
+       }
+
+       protected StaticRefProvider getStaticRefProvider() {
+               return staticRefProvider;
+       }
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/AutoUiActivator.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/AutoUiActivator.java
new file mode 100644 (file)
index 0000000..dd5b1e0
--- /dev/null
@@ -0,0 +1,5 @@
+package org.argeo.slc.detached;
+
+
+public class AutoUiActivator extends AbstractDetachedActivator {
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedClient.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedClient.java
new file mode 100644 (file)
index 0000000..101d1ef
--- /dev/null
@@ -0,0 +1,8 @@
+package org.argeo.slc.detached;
+
+public interface DetachedClient {
+       public void sendRequest(DetachedStepRequest request) throws Exception;
+
+       /** Blocks until next answer. */
+       public DetachedStepAnswer receiveAnswer() throws Exception;
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContext.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContext.java
new file mode 100644 (file)
index 0000000..1ac3690
--- /dev/null
@@ -0,0 +1,13 @@
+package org.argeo.slc.detached;
+
+import java.util.List;
+
+public interface DetachedContext {
+       public Object getDynamicRef(String ref);
+
+       public void setDynamicRef(String ref, Object obj);
+
+       public String getCurrentPath();
+
+       public List getExecutedPaths();
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContextImpl.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedContextImpl.java
new file mode 100644 (file)
index 0000000..595b337
--- /dev/null
@@ -0,0 +1,33 @@
+package org.argeo.slc.detached;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.Vector;
+
+public class DetachedContextImpl implements DetachedContext {
+       private List executedPaths = new Vector();
+       private String currentPath;
+       private Map dynamicRefs = new TreeMap();
+
+       public String getCurrentPath() {
+               return currentPath;
+       }
+
+       public void setDynamicRef(String ref, Object obj) {
+               dynamicRefs.put(ref, obj);
+       }
+
+       public Object getDynamicRef(String ref) {
+               if (dynamicRefs.containsKey(ref))
+                       return dynamicRefs.get(ref);
+               else
+                       return null;
+       }
+
+       public List getExecutedPaths() {
+               return new ArrayList(executedPaths);
+       }
+
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedDriver.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedDriver.java
new file mode 100644 (file)
index 0000000..1e7f7bc
--- /dev/null
@@ -0,0 +1,7 @@
+package org.argeo.slc.detached;
+
+public interface DetachedDriver {
+       /** Blocks until it receives a request. */
+       public DetachedStepRequest receiveRequest() throws Exception;
+       public void sendAnswer(DetachedStepAnswer answer) throws Exception;
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedException.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedException.java
new file mode 100644 (file)
index 0000000..6755abd
--- /dev/null
@@ -0,0 +1,14 @@
+package org.argeo.slc.detached;
+
+public class DetachedException extends RuntimeException {
+       private Exception cause;
+
+       public DetachedException(String message) {
+               super(message);
+       }
+
+       public DetachedException(String message, Exception cause) {
+               super(message);
+               this.cause = cause;
+       }
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedExecutionServer.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedExecutionServer.java
new file mode 100644 (file)
index 0000000..37bb2c8
--- /dev/null
@@ -0,0 +1,5 @@
+package org.argeo.slc.detached;
+
+public interface DetachedExecutionServer {
+       public DetachedStepAnswer executeStep(DetachedStepRequest request);
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedExecutionServerImpl.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedExecutionServerImpl.java
new file mode 100644 (file)
index 0000000..d21ec2d
--- /dev/null
@@ -0,0 +1,79 @@
+package org.argeo.slc.detached;
+
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+
+public class DetachedExecutionServerImpl implements DetachedExecutionServer {
+       private final DetachedContextImpl detachedContext;
+
+       private BundleContext bundleContext;
+       private DetachedDriver driver;
+
+       private boolean active = false;
+
+       public void setDriver(DetachedDriver driver) {
+               this.driver = driver;
+       }
+
+       public DetachedExecutionServerImpl() {
+               detachedContext = new DetachedContextImpl();
+       }
+
+       public DetachedStepAnswer executeStep(DetachedStepRequest request) {
+               try {
+                       DetachedStep step = null;
+
+                       // Find step
+                       ServiceReference[] refs = bundleContext.getAllServiceReferences(
+                                       StaticRefProvider.class.getName(), null);
+                       for (int i = 0; i < refs.length; i++) {
+                               StaticRefProvider provider = (StaticRefProvider) bundleContext
+                                               .getService(refs[i]);
+                               Object obj = provider.getStaticRef(request.getStepRef());
+                               if (obj != null) {
+                                       step = (DetachedStep) obj;
+                                       break;
+                               }
+                       }
+
+                       if (step == null)
+                               throw new DetachedException("Could not find step with ref "
+                                               + request.getStepRef());
+
+                       return step.execute(detachedContext, request);
+               } catch (DetachedException e) {
+                       throw e;
+               } catch (Exception e) {
+                       e.printStackTrace();
+                       throw new DetachedException(
+                                       "Unexpected exception while executing request " + request,
+                                       e);
+               }
+       }
+
+       public void init(BundleContext bundleContext) {
+               this.bundleContext = bundleContext;
+               Thread driverThread = new Thread(new Runnable() {
+
+                       public void run() {
+                               while (active) {
+                                       try {
+                                               DetachedStepRequest request = driver.receiveRequest();
+                                               executeStep(request);
+                                       } catch (Exception e) {
+                                               if (e instanceof RuntimeException)
+                                                       throw (RuntimeException) e;
+                                               else
+                                                       e.printStackTrace();
+                                       }
+                               }
+
+                       }
+               }, "driverThread");
+
+               active = true;
+
+               driverThread.start();
+       }
+
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStep.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStep.java
new file mode 100644 (file)
index 0000000..fd25d52
--- /dev/null
@@ -0,0 +1,7 @@
+package org.argeo.slc.detached;
+
+
+public interface DetachedStep {
+       public DetachedStepAnswer execute(DetachedContext detachedContext,
+                       DetachedStepRequest detachedStepRequest);
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStepAnswer.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStepAnswer.java
new file mode 100644 (file)
index 0000000..ebc6fe6
--- /dev/null
@@ -0,0 +1,38 @@
+package org.argeo.slc.detached;
+
+import java.util.Properties;
+
+public class DetachedStepAnswer {
+       public static int PROCESSED = 0;
+       public static int ERROR = 1;
+       public static int SKIPPED = 2;
+
+       private Properties outputParameters;
+       private int outputStatus;
+       private String log;
+
+       public Properties getOutputParameters() {
+               return outputParameters;
+       }
+
+       public void setOutputParameters(Properties outputParameters) {
+               this.outputParameters = outputParameters;
+       }
+
+       public int getOutputStatus() {
+               return outputStatus;
+       }
+
+       public void setOutputStatus(int outputStatus) {
+               this.outputStatus = outputStatus;
+       }
+
+       public String getLog() {
+               return log;
+       }
+
+       public void setLog(String log) {
+               this.log = log;
+       }
+
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStepRequest.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/DetachedStepRequest.java
new file mode 100644 (file)
index 0000000..1c772ad
--- /dev/null
@@ -0,0 +1,43 @@
+package org.argeo.slc.detached;
+
+import java.io.Serializable;
+import java.util.Properties;
+
+public class DetachedStepRequest implements Serializable {
+       private String uuid;
+       private Properties inputParameters;
+       private String stepRef;
+       private String path;
+
+       public Properties getInputParameters() {
+               return inputParameters;
+       }
+
+       public void setInputParameters(Properties inputParameters) {
+               this.inputParameters = inputParameters;
+       }
+
+       public String getStepRef() {
+               return stepRef;
+       }
+
+       public void setStepRef(String stepRef) {
+               this.stepRef = stepRef;
+       }
+
+       public String getPath() {
+               return path;
+       }
+
+       public void setPath(String path) {
+               this.path = path;
+       }
+
+       public String getUuid() {
+               return uuid;
+       }
+
+       public void setUuid(String uuid) {
+               this.uuid = uuid;
+       }
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/SimpleDetachedActivator.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/SimpleDetachedActivator.java
new file mode 100644 (file)
index 0000000..5006eec
--- /dev/null
@@ -0,0 +1,23 @@
+package org.argeo.slc.detached;
+
+import java.util.Properties;
+
+import org.osgi.framework.BundleContext;
+
+public class SimpleDetachedActivator extends AbstractDetachedActivator {
+       private DetachedExecutionServerImpl executionServer;
+
+       protected void startAutoBundle(BundleContext context) throws Exception {
+               Object obj = getStaticRefProvider().getStaticRef("executionServer");
+               if (obj != null)
+                       executionServer = (DetachedExecutionServerImpl) obj;
+               else
+                       throw new DetachedException("Could not find execution server.");
+
+               executionServer.init(context);
+
+               context.registerService(DetachedExecutionServer.class.getName(),
+                               executionServer, new Properties());
+       }
+
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/SpringStaticRefProvider.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/SpringStaticRefProvider.java
new file mode 100644 (file)
index 0000000..b58601e
--- /dev/null
@@ -0,0 +1,26 @@
+package org.argeo.slc.detached;
+
+import org.springframework.beans.factory.NoSuchBeanDefinitionException;
+import org.springframework.context.ConfigurableApplicationContext;
+
+public class SpringStaticRefProvider implements StaticRefProvider {
+       private final ConfigurableApplicationContext applicationContext;
+
+       public SpringStaticRefProvider(
+                       ConfigurableApplicationContext applicationContext) {
+               this.applicationContext = applicationContext;
+       }
+
+       public Object getStaticRef(String id) {
+               try {
+                       return applicationContext.getBean(id);
+               } catch (NoSuchBeanDefinitionException e) {
+                       // silent
+                       return null;
+               }
+       }
+
+       public void close(){
+               applicationContext.close();
+       }
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/StaticRefProvider.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/StaticRefProvider.java
new file mode 100644 (file)
index 0000000..5e6d92d
--- /dev/null
@@ -0,0 +1,6 @@
+package org.argeo.slc.detached;
+
+public interface StaticRefProvider {
+       /** Returns null if no such ref. */
+       public Object getStaticRef(String id);
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/drivers/FileDriver.java
new file mode 100644 (file)
index 0000000..89522ed
--- /dev/null
@@ -0,0 +1,68 @@
+package org.argeo.slc.detached.drivers;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import org.argeo.slc.detached.DetachedClient;
+import org.argeo.slc.detached.DetachedDriver;
+import org.argeo.slc.detached.DetachedException;
+import org.argeo.slc.detached.DetachedStepAnswer;
+import org.argeo.slc.detached.DetachedStepRequest;
+
+public class FileDriver implements DetachedDriver, DetachedClient {
+       private File requestDir;
+       private File answerDir;
+
+       public synchronized DetachedStepRequest receiveRequest() throws Exception {
+               if (!requestDir.exists())
+                       throw new DetachedException("Request dir "
+                                       + requestDir.getCanonicalPath() + " does not exist.");
+
+               File file = null;
+               while (file == null) {
+                       File[] files = requestDir.listFiles();
+                       if (files.length > 0)
+                               file = files[0];
+                       else
+                               Thread.sleep(1000);
+               }
+
+               ObjectInputStream in = new ObjectInputStream(new FileInputStream(file));
+               DetachedStepRequest request = (DetachedStepRequest) in.readObject();
+               in.close();
+
+               file.delete();// move it to a processed dir instead?
+               return request;
+       }
+
+       public void sendAnswer(DetachedStepAnswer answer) throws Exception {
+               // TODO Auto-generated method stub
+
+       }
+
+       public DetachedStepAnswer receiveAnswer() throws Exception {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+       public void sendRequest(DetachedStepRequest request) throws Exception {
+               File file = new File(requestDir.getPath() + File.separator
+                               + request.getUuid());
+               ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(
+                               file));
+               out.writeObject(request);
+               out.close();
+       }
+
+       public void setRequestDir(File requestDir) {
+               this.requestDir = requestDir;
+       }
+
+       public void setAnswerDir(File answerDir) {
+               this.answerDir = answerDir;
+       }
+
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiContext.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiContext.java
new file mode 100644 (file)
index 0000000..01fdba0
--- /dev/null
@@ -0,0 +1,7 @@
+package org.argeo.slc.detached.rmi;
+
+public interface AutoUiContext {
+       public Object getLocalRef(String key);
+
+       public void setLocalRef(String key, Object ref);
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiServer.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiServer.java
new file mode 100644 (file)
index 0000000..e224eff
--- /dev/null
@@ -0,0 +1,8 @@
+package org.argeo.slc.detached.rmi;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+public interface AutoUiServer extends Remote {
+       public Object executeTask(AutoUiTask task) throws RemoteException;
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiServerImpl.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiServerImpl.java
new file mode 100644 (file)
index 0000000..fa102a2
--- /dev/null
@@ -0,0 +1,53 @@
+package org.argeo.slc.detached.rmi;
+
+import java.rmi.Naming;
+import java.rmi.RemoteException;
+import java.rmi.server.UnicastRemoteObject;
+import java.util.Map;
+import java.util.TreeMap;
+
+public class AutoUiServerImpl extends UnicastRemoteObject implements
+               AutoUiServer, AutoUiContext {
+       private Map map = new TreeMap();
+
+       public AutoUiServerImpl() throws RemoteException {
+               super();
+       }
+
+       public Object executeTask(AutoUiTask task) throws RemoteException {
+               try {
+                       return task.execute(this);
+               } catch (Exception e) {
+                       throw new RemoteException("Coul not execute task.", e);
+               }
+       }
+
+       public Object getLocalRef(String key) {
+               return map.get(key);
+       }
+
+       public void setLocalRef(String key, Object ref) {
+               map.put(key, ref);
+       }
+
+       public static void main(String[] args) {
+               if (System.getSecurityManager() == null) {
+                       System.setSecurityManager(new SecurityManager());
+               }
+               try {
+                       String name = "AutoUiServer";
+                       AutoUiServer engine = new AutoUiServerImpl();
+                       // AutoUiServer stub = (AutoUiServer) UnicastRemoteObject
+                       // .exportObject(engine, 0);
+                       // Registry registry = LocateRegistry.getRegistry();
+                       // registry.rebind(name, stub);
+                       Naming.rebind(name, engine);
+                       System.out.println("AutoUiServer bound");
+
+               } catch (Exception e) {
+                       System.err.println("AutoUiServer exception:");
+                       e.printStackTrace();
+               }
+
+       }
+}
diff --git a/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiTask.java b/org.argeo.slc.detached/src/main/java/org/argeo/slc/detached/rmi/AutoUiTask.java
new file mode 100644 (file)
index 0000000..20d68a3
--- /dev/null
@@ -0,0 +1,7 @@
+package org.argeo.slc.detached.rmi;
+
+import java.io.Serializable;
+
+public interface AutoUiTask extends Serializable {
+       public Object execute(AutoUiContext context) throws Exception;
+}
index eabba66de7ee5ef84a2aec41637676257ca3040f..ff1a465088d5b40ca91013455d1249ef314d8650 100644 (file)
@@ -1,10 +1,10 @@
 Manifest-Version: 1.0\r
-Export-Package: org.argeo.slc.autoui.rmi,org.argeo.slc.autoui;uses:="o\r
- rg.springframework.beans.factory.support,org.apache.commons.logging,o\r
- rg.springframework.context.support,org.springframework.core.io,org.os\r
- gi.framework,org.springframework.beans.factory.xml,org.springframewor\r
- k.context,org.springframework.beans.factory",org.argeo.slc.autoui.dri\r
vers;uses:="org.argeo.slc.autoui"\r
+Export-Package: org.argeo.slc.detached.rmi,org.argeo.slc.detached;uses\r
+ :="org.springframework.beans.factory.support,org.apache.commons.loggi\r
+ ng,org.springframework.context.support,org.springframework.core.io,or\r
+ g.osgi.framework,org.springframework.beans.factory.xml,org.springfram\r
+ ework.context,org.springframework.beans.factory",org.argeo.slc.detach\r
ed.drivers;uses:="org.argeo.slc.detached"\r
 Built-By: mbaudier\r
 Tool: Bnd-0.0.255\r
 Bundle-Name: Argeo SLC Detached\r
@@ -12,16 +12,16 @@ Created-By: Apache Maven Bundle Plugin
 Bundle-Vendor: Argeo\r
 Build-Jdk: 1.6.0\r
 Bundle-Version: 0.11.1.SNAPSHOT\r
-Bnd-LastModified: 1222612958407\r
+Bnd-LastModified: 1222615485731\r
 Bundle-ManifestVersion: 2\r
-Bundle-Activator: org.argeo.slc.autoui.AutoUiActivator\r
+Bundle-Activator: org.argeo.slc.detached.AutoUiActivator\r
 Bundle-License: http://www.apache.org/licenses/LICENSE-2.0.txt\r
-Import-Package: org.apache.commons.logging,org.argeo.slc.autoui,org.ar\r
- geo.slc.autoui.drivers,org.argeo.slc.autoui.rmi,org.osgi.framework;ve\r
- rsion="1.4",org.springframework.beans.factory,org.springframework.bea\r
- ns.factory.support,org.springframework.beans.factory.xml,org.springfr\r
- amework.context,org.springframework.context.support,org.springframewo\r
rk.core.io\r
+Import-Package: org.apache.commons.logging,org.argeo.slc.detached,org.\r
+ argeo.slc.detached.drivers,org.argeo.slc.detached.rmi,org.osgi.framew\r
+ ork,org.springframework.beans.factory,org.springframework.beans.facto\r
+ ry.support,org.springframework.beans.factory.xml,org.springframework.\r
+ context,org.springframework.context.support,org.springframework.core.\r
+ io\r
 Bundle-SymbolicName: org.argeo.slc.detached\r
 Bundle-DocURL: http://www.argeo.org\r
 Originally-Created-By: Apache Maven Bundle Plugin\r