geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r479899 - /geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
Date Tue, 28 Nov 2006 04:49:56 GMT
Author: jdillon
Date: Mon Nov 27 20:49:55 2006
New Revision: 479899

URL: http://svn.apache.org/viewvc?view=rev&rev=479899
Log:
Using enum for install types

Modified:
    geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java

Modified: geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java?view=diff&rev=479899&r1=479898&r2=479899
==============================================================================
--- geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
(original)
+++ geronimo/server/trunk/maven-plugins/geronimo-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/geronimo/server/InstallerMojoSupport.java
Mon Nov 27 20:49:55 2006
@@ -103,14 +103,14 @@
      * @parameter expression="${geronimoHome}"
      */
     protected File geronimoHome;
-
-    protected static final int INSTALL_FROM_ARTIFACT = 0;
-
-    protected static final int INSTALL_FROM_FILE = 1;
-
-    protected static final int INSTALL_ALREADY_EXISTS = 2;
-
-    protected int installType;
+    
+    protected static enum InstallType {
+        FROM_ARTIFACT,
+        FROM_FILE,
+        ALREADY_EXISTS
+    }
+    
+    protected InstallType installType;
 
     private File discoverGeronimoHome(final File archive) throws MojoExecutionException {
         log.debug("Attempting to discover geronimoHome...");
@@ -155,13 +155,13 @@
             }
             log.info("Using pre-installed assembly: " + geronimoHome);
 
-            installType = INSTALL_ALREADY_EXISTS;
+            installType = InstallType.ALREADY_EXISTS;
         }
         else {
             if (assemblyArchive != null) {
                 log.info("Using non-artifact based assembly archive: " + assemblyArchive);
 
-                installType = INSTALL_FROM_FILE;
+                installType = InstallType.FROM_FILE;
             }
             else {
                 Artifact artifact = getAssemblyArtifact();
@@ -174,7 +174,7 @@
 
                 assemblyArchive = artifact.getFile();
 
-                installType = INSTALL_FROM_ARTIFACT;
+                installType = InstallType.FROM_ARTIFACT;
             }
 
             geronimoHome = discoverGeronimoHome(assemblyArchive);
@@ -247,7 +247,7 @@
      * @throws Exception
      */
     protected void installAssembly() throws Exception {
-        if (installType == INSTALL_ALREADY_EXISTS) {
+        if (installType == InstallType.ALREADY_EXISTS) {
             log.info("Installation type is pre-existing; skipping installation");
             return;
         }



Mime
View raw message