incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r1233322 - /sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/serversetup/StartRunnableJarPhase.java
Date Thu, 19 Jan 2012 12:42:31 GMT
Author: bdelacretaz
Date: Thu Jan 19 12:42:31 2012
New Revision: 1233322

URL: http://svn.apache.org/viewvc?rev=1233322&view=rev
Log:
SLING-2368 - run the shutdown task in all cases if a runnable jar was started

Modified:
    sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/serversetup/StartRunnableJarPhase.java

Modified: sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/serversetup/StartRunnableJarPhase.java
URL: http://svn.apache.org/viewvc/sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/serversetup/StartRunnableJarPhase.java?rev=1233322&r1=1233321&r2=1233322&view=diff
==============================================================================
--- sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/serversetup/StartRunnableJarPhase.java
(original)
+++ sling/trunk/testing/tools/src/main/java/org/apache/sling/testing/tools/serversetup/StartRunnableJarPhase.java
Thu Jan 19 12:42:31 2012
@@ -2,8 +2,6 @@ package org.apache.sling.testing.tools.s
 
 import java.util.Properties;
 
-import org.apache.commons.exec.ProcessDestroyer;
-import org.apache.commons.exec.ShutdownHookProcessDestroyer;
 import org.apache.sling.testing.tools.jarexec.JarExecutor;
 import org.apache.sling.testing.tools.jarexec.JarExecutor.ExecutorException;
 import org.slf4j.Logger;
@@ -25,35 +23,7 @@ public class StartRunnableJarPhase imple
     public StartRunnableJarPhase(final ServerSetup owner, String id, String description,
Properties config) throws ExecutorException {
         this.id = id;
         this.description = description;
-        
-        /** Our JarExecutor uses a ProcessDestroyer which does noting
-         *  if our ServerSetup owner would not run
-         *  a shutdown task with our name + SHUTDOWN_ID_SUFFIX
-         */
-        final String shutdownId = id + ServerSetup.SHUTDOWN_ID_SUFFIX;
-        final ProcessDestroyer destroyer = new ShutdownHookProcessDestroyer() {
-            @Override
-            public void run() {
-                if(owner.getPhasesToRun().contains(shutdownId)) {
-                    log.info(
-                            "{}: {} allows {} phase to run, shutting down runnable jar",

-                            new Object[] { this, owner, shutdownId } );
-                    super.run();
-                } else {
-                    log.info(
-                            "{}: {} does not allow {} phase to run, doing nothing", 
-                            new Object[] { this, owner, shutdownId } );
-                }
-            }
-            
-        };
-        
-        executor = new JarExecutor(config) {
-            @Override
-            protected ProcessDestroyer getProcessDestroyer() {
-                return destroyer;
-            }
-        };
+        executor = new JarExecutor(config);
 
         String hostname = config.getProperty(TEST_SERVER_HOSTNAME);
         if(hostname == null) {



Mime
View raw message