directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r373285 - in /directory/trunks/apacheds/standalone: daemon/src/main/java/org/apache/directory/server/standalone/daemon/ installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ installers/test/
Date Sun, 29 Jan 2006 04:13:30 GMT
Author: akarasulu
Date: Sat Jan 28 20:13:25 2006
New Revision: 373285

URL: http://svn.apache.org/viewcvs?rev=373285&view=rev
Log:
changes ...

 o cleaned up Target configuration bean in installer plugin
 o added solaris i386 build logic and installer config to plugin test
 o cleaned up the bootstrapper and exposed constants for use by plugin
 o made it so boostrapper.properties is built on the fly if missing in
   src/main/installers/

Modified:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/Bootstrapper.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java
    directory/trunks/apacheds/standalone/installers/test/pom.xml

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/Bootstrapper.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/Bootstrapper.java?rev=373285&r1=373284&r2=373285&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/Bootstrapper.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/Bootstrapper.java
Sat Jan 28 20:13:25 2006
@@ -25,6 +25,7 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.io.PrintWriter;
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -46,11 +47,11 @@
  */
 public class Bootstrapper
 {
-    public static final String[] EMPTY_STRARRAY = new String[0];
+    static final String[] EMPTY_STRARRAY = new String[0];
+    public static final String START_CLASS_PROP = "bootstrap.start.class";
+    public static final String STOP_CLASS_PROP = "bootstrap.stop.class";
     
     private static final Logger log = LoggerFactory.getLogger( Bootstrapper.class );
-    private static final String START_CLASS_PROP = "bootstrap.start.class";
-    private static final String STOP_CLASS_PROP = "bootstrap.stop.class";
 
     /** Shutdown command to use for await() */
     private static final String SHUTDOWN = "SHUTDOWN";
@@ -302,14 +303,13 @@
             if ( shutdownPortFile.exists() )
             {
                 String msg = "Shutdown port file " + shutdownPortFile + " exists. ";
-                msg += "\nEither the server is already running or a previous run existed
abruptly.";
-                msg += "\nIf the server is not running remove this file and try again.";
-                log.error( msg );
-                throw new IllegalStateException( msg );
+                msg += "\nEither an instance is already running or a previous run existed
abruptly.";
+                log.warn( msg );
             }
-            FileWriter writer = new FileWriter( shutdownPortFile );
-            writer.write( shutdownPort + "\n" );
-            writer.close();
+            PrintWriter out = new PrintWriter( new FileWriter( shutdownPortFile ) );
+            out.println( shutdownPort );
+            out.flush();
+            out.close();
         }
         catch ( IOException e )
         {

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java?rev=373285&r1=373284&r2=373285&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/CreateImageCommand.java
Sat Jan 28 20:13:25 2006
@@ -18,9 +18,12 @@
 
 
 import java.io.File;
+import java.io.FileWriter;
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.util.Properties;
 
+import org.apache.directory.server.standalone.daemon.Bootstrapper;
 import org.apache.directory.server.standalone.daemon.InstallationLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
@@ -181,16 +184,37 @@
                 + " into position " + layout.getDaemon() );
         }
         
-        // copy over the REQUIRED bootstrapper configuration file
-        try
+        // copy over the optional bootstrapper configuration file
+        if ( target.getBootstrapperConfiguraitonFile() == null || ! target.getBootstrapperConfiguraitonFile().exists()
)
         {
-            FileUtils.copyFile( target.getBootstrapperConfiguraitonFile(), layout.getBootstrapperConfigurationFile()
);
+            File dest = target.getBootstrapperConfiguraitonFile();
+            try
+            {
+                PrintWriter out = new PrintWriter( new FileWriter( dest ) );
+                out.println( Bootstrapper.START_CLASS_PROP + "=" + mymojo.getApplicationClass()
);
+                out.println( Bootstrapper.STOP_CLASS_PROP + "=" + mymojo.getApplicationClass()
);
+                out.flush();
+                out.close();
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy project bootstrapper configuration
file "  
+                    + target.getBootstrapperConfiguraitonFile() 
+                    + " into position " + layout.getBootstrapperConfigurationFile() );
+            }
         }
-        catch ( IOException e )
+        else
         {
-            throw new MojoFailureException( "Failed to copy bootstrapper configuration file
"  
-                + target.getBootstrapperConfiguraitonFile() 
-                + " into position " + layout.getBootstrapperConfigurationFile() );
+            try
+            {
+                FileUtils.copyFile( target.getBootstrapperConfiguraitonFile(), layout.getBootstrapperConfigurationFile()
);
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy project bootstrapper configuration
file "  
+                    + target.getBootstrapperConfiguraitonFile() 
+                    + " into position " + layout.getBootstrapperConfigurationFile() );
+            }
         }
         
         // copy over the optional logging configuration file
@@ -248,21 +272,37 @@
         
         // now copy over the jsvc executable renaming it to the mymojo.getApplicationName()

         if ( target.getOsName().equals( "sunos" ) && 
-             target.getOsArch().equals( "sparc" ) )
-        {
-            File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
);
-            try
-            {
-                MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "jsvc_solaris_sparc"
), executable );
-            }
-            catch ( IOException e )
-            {
-                throw new MojoFailureException( "Failed to copy jsvc executable file "  
-                    + getClass().getResource( "jsvc_solaris_sparc" )
-                    + " into position " + executable.getAbsolutePath() );
-            }
-        }
-        
+            target.getOsArch().equals( "sparc" ) )
+       {
+           File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
);
+           try
+           {
+               MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "jsvc_solaris_sparc"
), executable );
+           }
+           catch ( IOException e )
+           {
+               throw new MojoFailureException( "Failed to copy jsvc executable file "  
+                   + getClass().getResource( "jsvc_solaris_sparc" )
+                   + " into position " + executable.getAbsolutePath() );
+           }
+       }
+       
+        if ( target.getOsName().equals( "sunos" ) && 
+            target.getOsArch().equals( "i386" ) )
+       {
+           File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
);
+           try
+           {
+               MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "jsvc_solaris_i386"
), executable );
+           }
+           catch ( IOException e )
+           {
+               throw new MojoFailureException( "Failed to copy jsvc executable file "  
+                   + getClass().getResource( "jsvc_solaris_i386" )
+                   + " into position " + executable.getAbsolutePath() );
+           }
+       }
+       
         // now copy over the jsvc executable renaming it to the mymojo.getApplicationName()

         if ( target.getOsName().equals( "macosx" ) && target.getOsArch().equals(
"ppc" ) )
         {

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java?rev=373285&r1=373284&r2=373285&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/ServiceInstallersMojo.java
Sat Jan 28 20:13:25 2006
@@ -346,22 +346,6 @@
             {
                 target.setOsVersion( "*" );
             }
-            if ( target.getApplicationAuthors() == null )
-            {
-                target.setApplicationAuthors( application.getAuthors() );
-            }
-            if ( target.getApplicationEmail() == null )
-            {
-                target.setApplicationEmail( application.getEmail() );
-            }
-            if ( target.getApplicationJavaVersion() == null )
-            {
-                target.setApplicationJavaVersion( application.getMinimumJavaVersion() );
-            }
-            if ( target.getApplicationUrl() == null )
-            {
-                target.setApplicationUrl( application.getUrl() );
-            }
         }
     }
     

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java?rev=373285&r1=373284&r2=373285&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Target.java
Sat Jan 28 20:13:25 2006
@@ -58,17 +58,8 @@
     private String osName;
     private String osArch;
     private String osFamily;
-    private String daemonFramework;
-    
-    // optional stuff
-    private List applicationAuthors;
-    private String applicationUrl;
-    private String applicationJavaVersion;
-    private String applicationEmail;
-    
-    private String minVersion;
-    private String maxVersion;
     private String osVersion;
+    private String daemonFramework;
     private File loggerConfigurationFile;
     private File serverConfigurationFile;
     private File bootstrapperConfiguraitonFile;
@@ -128,30 +119,6 @@
     }
 
 
-    public void setMaxVersion(String maxVersion)
-    {
-        this.maxVersion = maxVersion.toLowerCase( Locale.US );
-    }
-
-
-    public String getMaxVersion()
-    {
-        return maxVersion;
-    }
-
-
-    public void setMinVersion(String minVersion)
-    {
-        this.minVersion = minVersion.toLowerCase( Locale.US );
-    }
-
-
-    public String getMinVersion()
-    {
-        return minVersion.toLowerCase( Locale.US );
-    }
-
-
     public void setOsVersion(String osVersion)
     {
         this.osVersion = osVersion.toLowerCase( Locale.US );
@@ -227,55 +194,7 @@
         return osFamily;
     }
 
-
-    public void setApplicationAuthors(List authors)
-    {
-        this.applicationAuthors = authors;
-    }
-
-
-    public List getApplicationAuthors()
-    {
-        return applicationAuthors;
-    }
-
-
-    public void setApplicationUrl(String url)
-    {
-        this.applicationUrl = url;
-    }
-
-
-    public String getApplicationUrl()
-    {
-        return applicationUrl;
-    }
-
-
-    public void setApplicationJavaVersion(String javaVersion)
-    {
-        this.applicationJavaVersion = javaVersion;
-    }
-
-
-    public String getApplicationJavaVersion()
-    {
-        return applicationJavaVersion;
-    }
-
-
-    public void setApplicationEmail(String email)
-    {
-        this.applicationEmail = email;
-    }
-
-
-    public String getApplicationEmail()
-    {
-        return applicationEmail;
-    }
-
-
+    
     public void setLayout(InstallationLayout layout)
     {
         this.layout = layout;

Modified: directory/trunks/apacheds/standalone/installers/test/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/pom.xml?rev=373285&r1=373284&r2=373285&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/pom.xml (original)
+++ directory/trunks/apacheds/standalone/installers/test/pom.xml Sat Jan 28 20:13:25 2006
@@ -119,6 +119,13 @@
               <osArch>i386</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
+            <izPackTarget>
+              <id>solaris-jsvc</id>
+              <osName>Solaris</osName>
+              <osFamily>unix</osFamily>
+              <osArch>i386</osArch>
+              <daemonFramework>jsvc</daemonFramework>
+            </izPackTarget>
 <!--
             <izPackTarget>
               <id>macosx-jsvc</id>



Mime
View raw message