Author: [email protected]
Date: Wed Jun 13 13:50:30 2012
New Revision: 2487

Log:
[AMDATUCASSANDRA-206] Added locking support to ensure the Cassandra process is 
never launched twice

Added:
   
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraProcessLauncherServiceImpl.java
   
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/api/CassandraProcessLauncher.java
Modified:
   branches/amdatu-cassandra-0.2.5/cassandra-launcher/pom.xml
   
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/osgi/Activator.java
   
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraLauncherImpl.java
   
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraManagerImpl.java
   
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/ProcessLifecycleListenerImpl.java
   branches/amdatu-cassandra-0.2.5/release-demo/pom.xml
   
branches/amdatu-cassandra-0.2.5/test-integration/base/src/main/java/org/amdatu/cassandra/test/integration/base/CassandraFixture.java

Modified: branches/amdatu-cassandra-0.2.5/cassandra-launcher/pom.xml
==============================================================================
--- branches/amdatu-cassandra-0.2.5/cassandra-launcher/pom.xml  (original)
+++ branches/amdatu-cassandra-0.2.5/cassandra-launcher/pom.xml  Wed Jun 13 
13:50:30 2012
@@ -33,7 +33,7 @@
       <groupId>org.apache.ace</groupId>
       <artifactId>org.apache.ace.processlauncher</artifactId>
       <version>0.8.1-r1344593</version>
-      <scope>provided</scope>
+      <scope>compile</scope>
     </dependency>
     <dependency>
       <groupId>org.amdatu.core</groupId>
@@ -60,6 +60,12 @@
       <version>0.2.2-RC2</version>
       <scope>compile</scope>
     </dependency>
+     <dependency>
+      <groupId>com.jezhumble</groupId>
+      <artifactId>javasysmon</artifactId>
+      <version>0.3.3</version>
+      <scope>compile</scope>
+    </dependency>
   </dependencies>
 
   <build>

Modified: 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/osgi/Activator.java
==============================================================================
--- 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/osgi/Activator.java
  (original)
+++ 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/osgi/Activator.java
  Wed Jun 13 13:50:30 2012
@@ -21,19 +21,28 @@
 import org.amdatu.cassandra.launcher.service.CassandraInstallerImpl;
 import org.amdatu.cassandra.launcher.service.CassandraLauncherImpl;
 import org.amdatu.cassandra.launcher.service.CassandraManagerImpl;
+import 
org.amdatu.cassandra.launcher.service.CassandraProcessLauncherServiceImpl;
 import org.amdatu.cassandra.launcher.service.ProcessLifecycleListenerImpl;
 import org.amdatu.cassandra.launcher.service.ProcessStreamListenerImpl;
 import org.amdatu.cassandra.launcher.service.api.CassandraConfigurator;
 import org.amdatu.cassandra.launcher.service.api.CassandraInstaller;
 import org.amdatu.cassandra.launcher.service.api.CassandraLauncher;
 import org.amdatu.cassandra.launcher.service.api.CassandraManager;
+import org.amdatu.cassandra.launcher.service.api.CassandraProcessLauncher;
 import org.amdatu.core.config.templates.ConfigTemplateManager;
 
+import java.util.Properties;
+
+import org.apache.ace.processlauncher.ProcessLauncherService;
 import org.apache.ace.processlauncher.ProcessLifecycleListener;
 import org.apache.ace.processlauncher.ProcessStreamListener;
+import org.apache.ace.processlauncher.impl.ProcessLauncherServiceImpl;
+import org.apache.ace.processlauncher.impl.ProcessManager;
+import org.apache.ace.processlauncher.impl.ProcessManagerImpl;
 import org.apache.felix.dm.DependencyActivatorBase;
 import org.apache.felix.dm.DependencyManager;
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
 import org.osgi.service.cm.ConfigurationAdmin;
 import org.osgi.service.log.LogService;
 
@@ -67,8 +76,8 @@
                 .setImplementation(CassandraLauncherImpl.class)
                 .setInterface(CassandraLauncher.class.getName(), null)
                 
.add(createServiceDependency().setService(LogService.class).setRequired(true))
-                
.add(createServiceDependency().setService(ConfigurationAdmin.class).setRequired(true))
                 
.add(createServiceDependency().setService(CassandraConfigurator.class).setRequired(true))
+                
.add(createServiceDependency().setService(CassandraProcessLauncher.class).setRequired(true))
                 
.add(createServiceDependency().setService(CassandraInstaller.class).setRequired(true)));
 
         // Register the Cassandra installer service
@@ -97,8 +106,9 @@
             createComponent()
                 .setImplementation(ProcessStreamListenerImpl.class)
                 .setInterface(
-                    new String[] { ProcessStreamListener.class.getName(),
-                        CassandraProcessStreamListener.class.getName() }, null)
+                    new String[] {ProcessStreamListener.class.getName(),
+                        CassandraProcessStreamListener.class.getName()}, null)
+                
.add(createServiceDependency().setService(CassandraManager.class).setRequired(true))
                 
.add(createServiceDependency().setService(LogService.class).setRequired(true)));
 
         // Register the Cassandra process lifecyle listener service
@@ -106,10 +116,34 @@
             createComponent()
                 .setImplementation(ProcessLifecycleListenerImpl.class)
                 .setInterface(
-                    new String[] { ProcessLifecycleListener.class.getName(),
-                        CassandraProcessLifecycleListener.class.getName() }, 
null)
+                    new String[] {ProcessLifecycleListener.class.getName(),
+                        CassandraProcessLifecycleListener.class.getName()}, 
null)
                 
.add(createServiceDependency().setService(LogService.class).setRequired(true)));
 
+        initAceProcessLauncher(manager);
+    }
+    
+    // We embed the process launcher since its configuration based mechanism 
is not suited
+    // for our case in which we must be 100% sure that Cassandra is not 
launched twice.
+    private void initAceProcessLauncher(final DependencyManager manager) {
+  
+        // In the future we might want to publish this as an external 
service...
+        ProcessManager processManager = new ProcessManagerImpl();
+        manager.add(createComponent().setImplementation(processManager).add(
+            
createServiceDependency().setService(LogService.class).setRequired(false)));
+
+        // We publish the service under multiple interfaces...
+        String[] interfaces = {CassandraProcessLauncher.class.getName() };
+
+        // Service properties
+        Properties props = new Properties();
+        props.put(Constants.SERVICE_PID, ProcessLauncherService.PID);
+
+        ProcessLauncherServiceImpl processLauncherService = new 
CassandraProcessLauncherServiceImpl();
+        processLauncherService.setProcessManager(processManager);
+
+        manager.add(createComponent().setInterface(interfaces, 
props).setImplementation(processLauncherService)
+            
.add(createServiceDependency().setService(LogService.class).setRequired(false)));
     }
 
     /**

Modified: 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraLauncherImpl.java
==============================================================================
--- 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraLauncherImpl.java
   (original)
+++ 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraLauncherImpl.java
   Wed Jun 13 13:50:30 2012
@@ -15,20 +15,18 @@
  */
 package org.amdatu.cassandra.launcher.service;
 
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Hashtable;
-
 import org.amdatu.cassandra.launcher.CassandraProcessLifecycleListener;
 import org.amdatu.cassandra.launcher.CassandraProcessStreamListener;
 import org.amdatu.cassandra.launcher.service.api.CassandraConfigurator;
 import org.amdatu.cassandra.launcher.service.api.CassandraInstaller;
 import org.amdatu.cassandra.launcher.service.api.CassandraLauncher;
-import org.apache.ace.processlauncher.ProcessLauncherService;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
+import org.amdatu.cassandra.launcher.service.api.CassandraProcessLauncher;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.Dictionary;
+import java.util.Hashtable;
+
 import org.osgi.service.log.LogService;
 
 /**
@@ -40,9 +38,9 @@
 @SuppressWarnings("unchecked")
 public class CassandraLauncherImpl implements CassandraLauncher {
     private volatile LogService m_logService;
-    private volatile ConfigurationAdmin m_configAdmin;
     private volatile CassandraConfigurator m_configurator;
     private volatile CassandraInstaller m_installer;
+    private CassandraProcessLauncher m_processLauncher;
 
     private String m_configPid = null;
 
@@ -71,10 +69,10 @@
 
         String streamFilter = "(objectClass=" + 
CassandraProcessStreamListener.class.getCanonicalName() + ")";
         properties.put("executable.processStreamListener", streamFilter);
-        
+
         String lifecycleFilter = "(objectClass=" + 
CassandraProcessLifecycleListener.class.getCanonicalName() + ")";
         properties.put("executable.processLifecycleListener", lifecycleFilter);
-        
+
         properties.put("executable.args", "");
 
         // Step 2b. Deploy the config to Config Admin
@@ -82,12 +80,12 @@
             m_logService.log(LogService.LOG_INFO, "Launching Cassandra...");
             m_logService.log(LogService.LOG_DEBUG, "Executable command:");
             m_logService.log(LogService.LOG_DEBUG, exe);
-            Configuration config = 
m_configAdmin.createFactoryConfiguration(ProcessLauncherService.PID, null);
-            config.update(properties);
-            m_configPid = config.getPid();
+
+            m_configPid = m_processLauncher.startProcess(properties);
+
             return true;
         }
-        catch (IOException e) {
+        catch (Exception e) {
             m_logService.log(LogService.LOG_ERROR,
                 "Unable to deploy configuration to ace process launcher. 
Cassandra could not be launched.", e);
             return false;
@@ -98,15 +96,10 @@
         m_logService.log(LogService.LOG_INFO, "Stopping Cassandra 
instance...");
         if (m_configPid != null) {
             try {
-                Configuration config = 
m_configAdmin.getConfiguration(m_configPid, null);
-                if (config != null) {
-                    // Upon stopping this bundle, delete the config file. The 
ACE process launcher
-                    // will notify this deletion and stop the external 
Cassandra process.
-                    config.delete();
-                }
+                m_processLauncher.stopProcess(m_configPid);
                 m_configPid = null;
             }
-            catch (IOException e) {
+            catch (Exception e) {
                 m_logService.log(LogService.LOG_ERROR, "An error occured while 
stopping Cassandra", e);
             }
         }

Modified: 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraManagerImpl.java
==============================================================================
--- 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraManagerImpl.java
    (original)
+++ 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraManagerImpl.java
    Wed Jun 13 13:50:30 2012
@@ -15,16 +15,23 @@
  */
 package org.amdatu.cassandra.launcher.service;
 
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.List;
-
 import org.amdatu.cassandra.launcher.CassandraProcessLifecycleListener;
 import org.amdatu.cassandra.launcher.service.api.CassandraConfigurator;
 import org.amdatu.cassandra.launcher.service.api.CassandraLauncher;
 import org.amdatu.cassandra.launcher.service.api.CassandraManager;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.util.Dictionary;
+
+import org.apache.commons.io.FileUtils;
 import org.osgi.service.cm.ConfigurationException;
 import org.osgi.service.cm.ManagedService;
+import org.osgi.service.log.LogService;
+
+import com.jezhumble.javasysmon.JavaSysMon;
+import com.jezhumble.javasysmon.ProcessInfo;
 
 /**
  * This class provides utility methods to prepare Cassandra configuration 
(cassandra.yaml) before starting it.
@@ -40,76 +47,135 @@
     private volatile CassandraConfigurator m_configurator;
     private volatile CassandraLauncher m_launcher;
     private volatile CassandraProcessLifecycleListener m_processListener;
+    private volatile LogService m_logService;
 
-    private QueueHandlerThread m_queueHandler;
-
-    private List<Dictionary> m_queue = new ArrayList<Dictionary>();
+    private Dictionary m_properties = null;
 
     public synchronized void start() {
-        // Now start the inspect thread
-        m_queueHandler = new QueueHandlerThread();
-        m_queueHandler.start();
+        try {
+            launchCassandra();
+        }
+        catch (IOException e) {
+            m_logService.log(LogService.LOG_ERROR, "An error occurred while 
launching Cassandra.", e);
+        }
     }
 
     public synchronized void stop() throws InterruptedException {
-        m_queueHandler.interrupt();
-        m_queueHandler.join();
+        // Stop Cassandra if it is still running
+        if (m_processListener.isRunning()) {
+            m_launcher.stopCassandra();
+        }
     }
 
     public synchronized void updated(final Dictionary dictionary) throws 
ConfigurationException {
         if (dictionary != null) {
-            synchronized (m_queue) {
-                m_queue.add(dictionary);
+            m_properties = dictionary;
+            if (m_launcher != null) {
+                try {
+                    launchCassandra();
+                }
+                catch (IOException e) {
+                    m_logService.log(LogService.LOG_ERROR, "An error occurred 
while launching Cassandra.", e);
+                }
             }
         }
     }
 
-    class QueueHandlerThread extends Thread {
-        // Interruption parameter
-        private boolean m_interrupted = false;
-
-        public void run() {
-            while (!m_interrupted) {
-                try {
-                    Thread.sleep(INTERVAL);
+    private void launchCassandra() throws IOException {
+        // First check if a Cassandra process is currently running. If so, stop
+        // it and wait for it to end.
+        if (m_processListener.isRunning()) {
+            // NB: the method returns after the process has been terminated
+            m_launcher.stopCassandra();
+        }
 
-                    // Check the queue
-                    if (!m_queue.isEmpty()) {
-                        // First check if a Cassandra process is currently 
running. If so, stop
-                        // it and wait for it to end.
-                        if (m_processListener.isRunning()) {
-                            m_launcher.stopCassandra();
-                            while (!m_interrupted && 
m_processListener.isRunning()) {
-                                Thread.sleep(INTERVAL);
-                            }
-                        }
+        // Update the configurator with the configuration
+        m_configurator.updateConfiguration(m_properties);
 
-                        // Get the next config from the queue
-                        Dictionary properties;
-                        synchronized (m_queue) {
-                            properties =  m_queue.get(0);
-                            m_queue.remove(0);
+        // Check if there is a Cassandra lock
+        if (!isLocked()) {
+            try {
+                // Start Cassandra
+                if (m_launcher.startCassandra()) {
+                    // Wait for the process to be launched
+                    while (!m_processListener.isRunning()) {
+                        try {
+                            Thread.sleep(INTERVAL);
                         }
-                        
-                        // Update the configurator with the config
-                        m_configurator.updateConfiguration(properties);
-
-                        // Start Cassandra
-                        if (m_launcher.startCassandra()) {
-                            // Wait for the process to be launched
-                            while (!m_interrupted && 
!m_processListener.isRunning()) {
-                                Thread.sleep(INTERVAL);
-                            }
+                        catch (InterruptedException e) {
                         }
                     }
                 }
-                catch (InterruptedException e) {
+            }
+            finally {
+                // Create a <pid>.lock file for each Cassandra process launched
+                // from this manager
+                lockProcess();
+            }
+        }
+    }
+
+    // This method verifies if there are any <pid>.lock files present in the 
work directory.
+    // If so, the manager will not launch another cassandra process but log an 
error that this
+    // process should be killed first.
+    private boolean isLocked() {
+        File workDir = m_configurator.getWorkDirectory();
+        File[] locks = workDir.listFiles(new FilenameFilter() {
+            public boolean accept(File dir, String name) {
+                return name.endsWith(".lock");
+            }
+        });
+        if (locks == null || locks.length == 0) {
+            return false;
+        }
+        else {
+            // Verify that the process with that ID is still running
+            boolean locked = false;
+            for (File lock : locks) {
+                int pid = Integer.parseInt(lock.getName().substring(0, 
lock.getName().indexOf(".")));
+                if (findProcess(pid) != null) {
+                    String msg = "Cassandra cannot be launched. The process 
with PID "
+                        + pid + " is holding the lock. New Cassandra processes 
will not "
+                        + "be launched until this process is killed.";
+                    m_logService.log(LogService.LOG_ERROR, msg);
+                    locked = true;
+                }
+                else {
+                    // Remove the lock file, the process is killed.
+                    lock.delete();
                 }
             }
+
+            return locked;
+        }
+    }
+
+    private ProcessInfo findProcess(int pid) {
+        JavaSysMon monitor = new JavaSysMon();
+        ProcessInfo[] processes = monitor.processTable();
+        for (ProcessInfo process : processes) {
+            if (pid == process.getPid()) {
+                return process;
+            }
         }
+        return null;
+    }
 
-        public void interrupt() {
-            m_interrupted = true;
+    // This method determines the PID of the Cassandra processes launched from 
this manager
+    // and creates a <pid>.lock file for each of them.
+    private void lockProcess() throws IOException {
+        JavaSysMon monitor = new JavaSysMon();
+        int currentPid = monitor.currentPid();
+        ProcessInfo[] processes = monitor.processTable();
+        for (ProcessInfo process : processes) {
+            int parentPid = process.getParentPid();
+            if (parentPid == currentPid && 
"java.exe".equals(process.getName())) {
+                // This is a process launched by us
+                File lock = new File(m_configurator.getWorkDirectory(), 
process.getPid() + ".lock");
+                if (!lock.exists()) {
+                    FileUtils.writeStringToFile(lock, "");
+                }
+            }
         }
     }
 }
\ No newline at end of file

Added: 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraProcessLauncherServiceImpl.java
==============================================================================
--- (empty file)
+++ 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/CassandraProcessLauncherServiceImpl.java
     Wed Jun 13 13:50:30 2012
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2010-2012 The Amdatu Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.amdatu.cassandra.launcher.service;
+
+import org.amdatu.cassandra.launcher.service.api.CassandraProcessLauncher;
+
+import java.util.Dictionary;
+import java.util.UUID;
+
+import org.apache.ace.processlauncher.ProcessLauncherService;
+import org.apache.ace.processlauncher.impl.ProcessLauncherServiceImpl;
+import org.osgi.service.cm.ConfigurationException;
+
+/**
+ * Custom process launcher which can be invoked directly without the need of 
adding/deleting
+ * configuration files which causes a lot of synchronization issues.
+ * 
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+@SuppressWarnings("rawtypes")
+public class CassandraProcessLauncherServiceImpl extends 
ProcessLauncherServiceImpl
+    implements CassandraProcessLauncher {
+
+    // Start the process
+    public String startProcess(Dictionary config) throws 
ConfigurationException {
+        String pid = ProcessLauncherService.PID + "-" + UUID.randomUUID();
+        updated(pid, config);
+        return pid;
+    }
+
+    // Stop the process. The thread is blocked until the process has 
terminated.
+    public void stopProcess(String pid) {
+        deleted(pid);
+    }
+}

Modified: 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/ProcessLifecycleListenerImpl.java
==============================================================================
--- 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/ProcessLifecycleListenerImpl.java
    (original)
+++ 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/ProcessLifecycleListenerImpl.java
    Wed Jun 13 13:50:30 2012
@@ -15,9 +15,10 @@
  */
 package org.amdatu.cassandra.launcher.service;
 
+import org.amdatu.cassandra.launcher.CassandraProcessLifecycleListener;
+
 import java.util.Properties;
 
-import org.amdatu.cassandra.launcher.CassandraProcessLifecycleListener;
 import org.apache.ace.processlauncher.LaunchConfiguration;
 import org.osgi.service.log.LogService;
 

Added: 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/api/CassandraProcessLauncher.java
==============================================================================
--- (empty file)
+++ 
branches/amdatu-cassandra-0.2.5/cassandra-launcher/src/main/java/org/amdatu/cassandra/launcher/service/api/CassandraProcessLauncher.java
    Wed Jun 13 13:50:30 2012
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2010-2012 The Amdatu Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.amdatu.cassandra.launcher.service.api;
+
+import java.util.Dictionary;
+
+import org.apache.ace.processlauncher.ProcessLauncherService;
+import org.osgi.service.cm.ConfigurationException;
+
+/**
+ * Interface of the custom process launcher which provides methods to start 
and stop the
+ * external process directly, without the need of adding/deleting 
configuration files. The
+ * problem with the configuration approach is that we do not have control over 
the configuration
+ * files being processed. Especially when the process was killed unexpectedly 
and the
+ * configuration of the old cassandra process was not yet deleted, the 
launcher will launch
+ * it again upon startup and there is no way we can prevent that. 
+ * For that reason we use a different approach in which we call start and stop 
on the 
+ * launcher directly.
+ * 
+ * @author <a href="mailto:[email protected]";>Amdatu Project 
Team</a>
+ */
+@SuppressWarnings("rawtypes")
+public interface CassandraProcessLauncher extends ProcessLauncherService {
+    /**
+     * Start the process with the specified configuration.
+     * @param config the configuration of the process to start
+     * @return The PID of the process that was started.
+     */
+    String startProcess(Dictionary config) throws ConfigurationException;
+
+    /**
+     * Stop the process with the specified PID.
+     * @param pid the pid of the process to stop.
+     */
+    void stopProcess(String pid);
+}

Modified: branches/amdatu-cassandra-0.2.5/release-demo/pom.xml
==============================================================================
--- branches/amdatu-cassandra-0.2.5/release-demo/pom.xml        (original)
+++ branches/amdatu-cassandra-0.2.5/release-demo/pom.xml        Wed Jun 13 
13:50:30 2012
@@ -32,7 +32,6 @@
     <amdatu.https.port>8045</amdatu.https.port>
     <amdatu.log.level>INFO</amdatu.log.level>
 
-    
<org.apache.ace.processlauncher.version>0.8.1-r1344593</org.apache.ace.processlauncher.version>
     <org.amdatu.core.version>0.2.1</org.amdatu.core.version>
     <org.amdatu.web.version>0.2.1</org.amdatu.web.version>
     <org.amdatu.lib.version>0.2.1</org.amdatu.lib.version>
@@ -94,13 +93,6 @@
 
   <dependencies>
     <dependency>
-      <groupId>org.apache.ace</groupId>
-      <artifactId>org.apache.ace.processlauncher</artifactId>
-      <version>${org.apache.ace.processlauncher.version}</version>
-      <scope>compile</scope>
-    </dependency>
-
-    <dependency>
       <groupId>org.amdatu.core</groupId>
       <artifactId>org.amdatu.core.config.templates</artifactId>
       <version>${org.amdatu.core.version}</version>

Modified: 
branches/amdatu-cassandra-0.2.5/test-integration/base/src/main/java/org/amdatu/cassandra/test/integration/base/CassandraFixture.java
==============================================================================
--- 
branches/amdatu-cassandra-0.2.5/test-integration/base/src/main/java/org/amdatu/cassandra/test/integration/base/CassandraFixture.java
        (original)
+++ 
branches/amdatu-cassandra-0.2.5/test-integration/base/src/main/java/org/amdatu/cassandra/test/integration/base/CassandraFixture.java
        Wed Jun 13 13:50:30 2012
@@ -90,9 +90,6 @@
             
mavenBundle().groupId("org.amdatu.auth").artifactId("org.amdatu.auth.tokenprovider").versionAsInProject(),
             
mavenBundle().groupId("org.amdatu.auth").artifactId("org.amdatu.auth.login.service").versionAsInProject(),
 
-            // Provision ace bundles
-            
mavenBundle().groupId("org.apache.ace").artifactId("org.apache.ace.processlauncher").versionAsInProject(),
-
             // Wrap libraries we depend on as OSGi bundles and provision those
             
wrappedBundle(mavenBundle().groupId("commons-httpclient").artifactId("commons-httpclient")
                 .versionAsInProject()),
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits

Reply via email to