geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1065795 - in /geronimo/server/trunk/framework: configs/karaf-framework/src/main/distribution/text/etc/ configs/karaf-framework/src/main/distribution/unix-shell/bin/ configs/karaf-framework/src/main/distribution/windows-text/bin/ modules/ge...
Date Mon, 31 Jan 2011 21:23:09 GMT
Author: gawor
Date: Mon Jan 31 21:23:08 2011
New Revision: 1065795

URL: http://svn.apache.org/viewvc?rev=1065795&view=rev
Log:
GERONIMO-5527: Improved server -clean option handling

Modified:
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo
    geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/AbstractCLI.java
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLParser.java
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/DeployerCLI.java
    geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/shutdown/ShutdownCLI.java
    geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
    geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties
(original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/text/etc/system.properties
Mon Jan 31 21:23:08 2011
@@ -67,3 +67,8 @@ jline.nobell=true
 
 ### Set OpenEJB LogFactory implementation
 openejb.log.factory=org.apache.openejb.util.PaxLogStreamFactory
+
+#
+# List of directories to remove when starting server with -clean option.
+#
+geronimo.cleanDirectoryList=${karaf.base}/var/catalina/work,${karaf.base}/var/catalina/resources

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo
(original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/unix-shell/bin/geronimo
Mon Jan 31 21:23:08 2011
@@ -293,24 +293,6 @@ if [ "$1" = "jpda" ] ; then
   shift
 fi
 
-processOptions() {
-    while [ "x$1" != "x" ]; do
-        case "$1" in
-            -c|--clean)
-              if [ -z "$OSGI_CACHE_CLEAN_ARGS" ]; then
-                OSGI_CACHE_CLEAN_ARGS="-Dorg.osgi.framework.storage.clean=onFirstInit"
-              fi
-              if [ -z "$CACHES_TO_CLEAN_STRING" ]; then
-                CACHES_TO_CLEAN_STRING="-Ddirectorys.to.remove.on.start=/var/catalina/work,/var/catalina/resources"
-              fi
-                ;;
-        esac
-        shift
-    done
-}
-
-processOptions "$@"
-
 if [ "$1" = "debug" ] ; then
   if $os400; then
     echo "Debug command not available on OS400"
@@ -331,8 +313,6 @@ if [ "$1" = "debug" ] ; then
       -Djava.endorsed.dirs="$ENDORSED_DIRS" \
       -Djava.ext.dirs="$EXT_DIRS" \
       -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-      $OSGI_CACHE_CLEAN_ARGS \
-      $CACHES_TO_CLEAN_STRING \
       -classpath "$CLASSPATH" \
        org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
   fi
@@ -350,8 +330,6 @@ elif [ "$1" = "run" ]; then
         -Djava.endorsed.dirs="$ENDORSED_DIRS" \
         -Djava.ext.dirs="$EXT_DIRS" \
         -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-        $OSGI_CACHE_CLEAN_ARGS \
-        $CACHES_TO_CLEAN_STRING \
         -classpath "$CLASSPATH" \
         org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
   else
@@ -364,8 +342,6 @@ elif [ "$1" = "run" ]; then
         -Djava.endorsed.dirs="$ENDORSED_DIRS" \
         -Djava.ext.dirs="$EXT_DIRS" \
         -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-        $OSGI_CACHE_CLEAN_ARGS \
-        $CACHES_TO_CLEAN_STRING \
         -classpath "$CLASSPATH" \
         org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
   fi
@@ -390,8 +366,6 @@ elif [ "$1" = "start" ] ; then
           -Djava.endorsed.dirs="$ENDORSED_DIRS" \
           -Djava.ext.dirs="$EXT_DIRS" \
           -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-          $OSGI_CACHE_CLEAN_ARGS \
-          $CACHES_TO_CLEAN_STRING \
           -classpath "$CLASSPATH" \
           org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
       else
@@ -404,8 +378,6 @@ elif [ "$1" = "start" ] ; then
           -Djava.endorsed.dirs="$ENDORSED_DIRS" \
           -Djava.ext.dirs="$EXT_DIRS" \
           -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-          $OSGI_CACHE_CLEAN_ARGS \
-          $CACHES_TO_CLEAN_STRING \
           -classpath "$CLASSPATH" \
           org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
       fi    
@@ -422,8 +394,6 @@ elif [ "$1" = "start" ] ; then
           -Djava.endorsed.dirs="$ENDORSED_DIRS" \
           -Djava.ext.dirs="$EXT_DIRS" \
           -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-          $OSGI_CACHE_CLEAN_ARGS \
-          $CACHES_TO_CLEAN_STRING \
           -classpath "$CLASSPATH" \
           org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@" \
           >> $GERONIMO_OUT 2>&1 &
@@ -442,8 +412,6 @@ elif [ "$1" = "start" ] ; then
           -Djava.endorsed.dirs="$ENDORSED_DIRS" \
           -Djava.ext.dirs="$EXT_DIRS" \
           -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-          $OSGI_CACHE_CLEAN_ARGS \
-          $CACHES_TO_CLEAN_STRING \
           -classpath "$CLASSPATH" \
           org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@" \
           >> $GERONIMO_OUT 2>&1 &
@@ -475,8 +443,6 @@ elif [ "$1" = "stop" ] ; then
     -Djava.endorsed.dirs="$ENDORSED_DIRS" \
     -Djava.ext.dirs="$EXT_DIRS" \
     -Djava.io.tmpdir="$GERONIMO_TMPDIR" \
-    $OSGI_CACHE_CLEAN_ARGS \
-    $CACHES_TO_CLEAN_STRING \
     -classpath "$CLASSPATH" \
     org.apache.geronimo.cli.shutdown.ShutdownCLI "$@"
 

Modified: geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat
(original)
+++ geronimo/server/trunk/framework/configs/karaf-framework/src/main/distribution/windows-text/bin/geronimo.bat
Mon Jan 31 21:23:08 2011
@@ -318,22 +318,9 @@ goto execCmd
 :execCmd
 @REM Get remaining unshifted command line arguments and save them in the
 set CMD_LINE_ARGS=
-
-
 :setArgs
-set OSGI_CACHE_CLEAN_ARGS =
-set CACHES_TO_CLEAN_STRING =
-
 if ""%1""=="""" goto doneSetArgs
 set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
-
-set clean=false
-if ""%1""==""-c"" set clean=true
-if ""%1""==""--clean"" set clean=true
-if "%clean%"=="true" (
-    set OSGI_CACHE_CLEAN_ARGS=-Dorg.osgi.framework.storage.clean=onFirstInit
-    set CACHES_TO_CLEAN_STRING=-Ddirectorys.to.remove.on.start="/var/catalina/work,/var/catalina/resources"
-) 
 shift
 goto setArgs
 :doneSetArgs
@@ -348,11 +335,11 @@ cmd /c exit /b 0
 
 @REM Execute Java with the applicable properties
 if not "%JDB%" == "" goto doJDB
-%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% %CONSOLE_OPTS%  -Dorg.apache.geronimo.home.dir="%GERONIMO_HOME%"
 -Dkaraf.home="%GERONIMO_HOME%" -Dkaraf.base="%GERONIMO_HOME%" -Djava.util.logging.config.file="%GERONIMO_HOME%\etc\java.util.logging.properties"
-Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib\ext"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%" %OSGI_CACHE_CLEAN_ARGS% %CACHES_TO_CLEAN_STRING% -classpath
"%CLASSPATH%" %MAINCLASS% %_LONG_OPT% %CMD_LINE_ARGS% 
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% %CONSOLE_OPTS% -Dorg.apache.geronimo.home.dir="%GERONIMO_HOME%"
 -Dkaraf.home="%GERONIMO_HOME%" -Dkaraf.base="%GERONIMO_HOME%" -Djava.util.logging.config.file="%GERONIMO_HOME%\etc\java.util.logging.properties"
-Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib\ext"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%" -classpath "%CLASSPATH%" %MAINCLASS% %_LONG_OPT% %CMD_LINE_ARGS%
 goto end
 
 :doJDB
-%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%" %CONSOLE_OPTS% -Dorg.apache.geronimo.home.dir="%GERONIMO_HOME%"
 -Dkaraf.home="%GERONIMO_HOME%" -Dkaraf.base="%GERONIMO_HOME%" -Djava.util.logging.config.file="%GERONIMO_HOME%\etc\java.util.logging.properties"
-Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib\ext"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%"  %OSGI_CACHE_CLEAN_ARGS% %CACHES_TO_CLEAN_STRING% -classpath
"%CLASSPATH%" %MAINCLASS% %CMD_LINE_ARGS%
+%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% -sourcepath "%JDB_SRCPATH%" %CONSOLE_OPTS% -Dorg.apache.geronimo.home.dir="%GERONIMO_HOME%"
 -Dkaraf.home="%GERONIMO_HOME%" -Dkaraf.base="%GERONIMO_HOME%" -Djava.util.logging.config.file="%GERONIMO_HOME%\etc\java.util.logging.properties"
-Djava.endorsed.dirs="%GERONIMO_HOME%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Djava.ext.dirs="%GERONIMO_HOME%\lib\ext;%JRE_HOME%\lib\ext"
-Djava.io.tmpdir="%GERONIMO_TMPDIR%" -classpath "%CLASSPATH%" %MAINCLASS% %CMD_LINE_ARGS%
 goto end
 
 :end

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/AbstractCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/AbstractCLI.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/AbstractCLI.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/AbstractCLI.java
Mon Jan 31 21:23:08 2011
@@ -61,11 +61,11 @@ public abstract class AbstractCLI {
         
         initializeLogging(parser);
         
-        Bootstrapper boot = createBootstrapper();
+        Bootstrapper boot = createBootstrapper(parser);
         return boot.execute(parser);
     }
 
-    protected Bootstrapper createBootstrapper() {
+    protected Bootstrapper createBootstrapper(CLParser parser) {
         return new Bootstrapper();
     }
     

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/client/ClientCLI.java
Mon Jan 31 21:23:08 2011
@@ -43,8 +43,8 @@ public class ClientCLI extends AbstractC
     }
     
     @Override
-    protected Bootstrapper createBootstrapper() {
-        Bootstrapper boot = super.createBootstrapper();
+    protected Bootstrapper createBootstrapper(CLParser parser) {
+        Bootstrapper boot = super.createBootstrapper(parser);
         boot.setWaitForStop(false);
         boot.setUniqueInstance(true);
         boot.setStartBundles(Arrays.asList("org.apache.geronimo.framework/client-system//car"));

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLI.java
Mon Jan 31 21:23:08 2011
@@ -43,11 +43,12 @@ public class DaemonCLI extends AbstractC
     }
 
     @Override
-    protected Bootstrapper createBootstrapper() {
-        Bootstrapper boot = super.createBootstrapper();
+    protected Bootstrapper createBootstrapper(CLParser parser) {
+        Bootstrapper boot = super.createBootstrapper(parser);
         boot.setWaitForStop(true);
         boot.setStartBundles(Arrays.asList("org.apache.geronimo.framework/j2ee-system//car"));
         boot.setLog4jConfigFile("var/log/server-log4j.properties");
+        boot.setCleanStorage( ((DaemonCLParser) parser).isCleanCache() );
         return boot;
     }
 }

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLParser.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLParser.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLParser.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/daemon/DaemonCLParser.java
Mon Jan 31 21:23:08 2011
@@ -59,6 +59,7 @@ public class DaemonCLParser extends Base
     public boolean isSecure() {
         return commandLine.hasOption(ARGUMENT_SECURE_SHORTFORM);
     }
+    
     public boolean isNoProgress() {
         return commandLine.hasOption(ARGUMENT_NO_PROGRESS_SHORTFORM);
     }
@@ -101,15 +102,12 @@ public class DaemonCLParser extends Base
     }
     
     protected void addCleanCache() {
-
         options.addOption(ARGUMENT_CLEAN_CACHE_SHORTFORM,
                 ARGUMENT_CLEAN_CACHE,
                 false,
                 "Delete cache folder. This is typically used when developer wants to pick
up artifacts modification in repository");
     }    
     
-
-
     protected void addProgressOptions() {
         OptionGroup optionGroup = new OptionGroup();
 

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/DeployerCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/DeployerCLI.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/DeployerCLI.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/deployer/DeployerCLI.java
Mon Jan 31 21:23:08 2011
@@ -53,8 +53,8 @@ public class DeployerCLI extends Abstrac
     }
     
     @Override
-    protected Bootstrapper createBootstrapper() {
-        Bootstrapper boot = super.createBootstrapper();
+    protected Bootstrapper createBootstrapper(CLParser parser) {
+        Bootstrapper boot = super.createBootstrapper(parser);
         boot.setWaitForStop(false);
         boot.setUniqueInstance(true);
         boot.setStartBundles(Arrays.asList("org.apache.geronimo.framework/online-deployer//car"));

Modified: geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/shutdown/ShutdownCLI.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/shutdown/ShutdownCLI.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/shutdown/ShutdownCLI.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-cli/src/main/java/org/apache/geronimo/cli/shutdown/ShutdownCLI.java
Mon Jan 31 21:23:08 2011
@@ -43,8 +43,8 @@ public class ShutdownCLI extends Abstrac
     }
     
     @Override
-    protected Bootstrapper createBootstrapper() {
-        Bootstrapper boot = super.createBootstrapper();
+    protected Bootstrapper createBootstrapper(CLParser parser) {
+        Bootstrapper boot = super.createBootstrapper(parser);
         boot.setWaitForStop(false);
         boot.setUniqueInstance(true);
         boot.setStartBundles(Arrays.asList(

Modified: geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-main/src/main/java/org/apache/geronimo/main/FrameworkLauncher.java
Mon Jan 31 21:23:08 2011
@@ -83,6 +83,7 @@ public class FrameworkLauncher {
     private boolean uniqueInstance = false;
     private String log4jFile;
     private String startupFile = STARTUP_PROPERTIES_FILE_NAME;
+    private boolean cleanStorage = false;
     
     private ServerInfo serverInfo;    
     private File geronimoHome;
@@ -105,6 +106,10 @@ public class FrameworkLauncher {
         this.uniqueInstance = uniqueInstance;
     }
     
+    public void setCleanStorage(boolean cleanStorage) {
+        this.cleanStorage = cleanStorage;
+    }
+    
     public void launch() throws Exception {
         geronimoHome = Utils.getGeronimoHome();
         geronimoBase = Utils.getGeronimoBase(geronimoHome);
@@ -132,6 +137,11 @@ public class FrameworkLauncher {
         processSecurityProperties(configProps);
 
         setFrameworkStorage(configProps);
+        
+        if (cleanStorage) {
+            configProps.setProperty(Constants.FRAMEWORK_STORAGE_CLEAN, 
+                                    Constants.FRAMEWORK_STORAGE_CLEAN_ONFIRSTINIT);
+        }
                 
         defaultStartLevel = Integer.parseInt(configProps.getProperty(Constants.FRAMEWORK_BEGINNING_STARTLEVEL));
 

Modified: geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java?rev=1065795&r1=1065794&r2=1065795&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-system/src/main/java/org/apache/geronimo/system/main/EmbeddedDaemon.java
Mon Jan 31 21:23:08 2011
@@ -62,19 +62,7 @@ public class EmbeddedDaemon implements M
     static String GERONIMO_HOME = "org.apache.geronimo.home.dir";
     static String DEFAULT_KEYSTORE_TRUSTSTORE_PASSWORD_FILE = System.getProperty(GERONIMO_HOME)
             + "/var/config/config-substitutions.properties";
-    static String[] CACHES_TO_CLEAN;
     
-    static {
-        
-        String CACHES_TO_CLEAN_STRING= System.getProperty("directorys.to.remove.on.start");
-        if (CACHES_TO_CLEAN_STRING != null) {
-            CACHES_TO_CLEAN = CACHES_TO_CLEAN_STRING.split(",");
-        }
-        else {
-            CACHES_TO_CLEAN = new String[0];
-        }
-    }
-
     public EmbeddedDaemon(Kernel kernel, Bundle bundle) {
         this.kernel = kernel;
         this.bundle = bundle;
@@ -145,11 +133,21 @@ public class EmbeddedDaemon implements M
         }
     }
     
+    private static String[] getCleanDirectoryList() {
+        String directoryList = System.getProperty("geronimo.cleanDirectoryList");
+        if (directoryList != null) {
+            return directoryList.split(",");
+        } else {
+            return new String[0];
+        }
+    }
+    
     protected void cleanCache(DaemonCLParser parser) {
         if (parser.isCleanCache()) {
-            for (String path:CACHES_TO_CLEAN){
-                File cacheFolder = new File(System.getProperty(GERONIMO_HOME) + path);
-                FileUtils.recursiveDelete(cacheFolder);
+            String [] dirList = getCleanDirectoryList();
+            for (String dir : dirList) {
+                File file = new File(dir);
+                FileUtils.recursiveDelete(file);
             }
         }
     }



Mime
View raw message