directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r373279 - 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/plugin/src/main/java/org/a...
Date Sun, 29 Jan 2006 03:18:06 GMT
Author: akarasulu
Date: Sat Jan 28 19:17:55 2006
New Revision: 373279

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

 o refactored plugin to use an Application bean 
 o Application bean holds defaults for targets
 o add Installation and Application to targets after setting the Application
   bean defaults since @parameter tags don't work in nested configuration beans
   just yet
 o fixed the jsvc bootstrapper to use the shutdown port without blocking on
   it and to exit the service when called
 o removed wait parameter on jsvc startup script template


Modified:
    directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Application.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/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/izpack/IzPackInstallerCommand.java
    directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
    directory/trunks/apacheds/standalone/installers/test/pom.xml

Modified: directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java?rev=373279&r1=373278&r2=373279&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
(original)
+++ directory/trunks/apacheds/standalone/daemon/src/main/java/org/apache/directory/server/standalone/daemon/JsvcBootstrapper.java
Sat Jan 28 19:17:55 2006
@@ -30,6 +30,9 @@
 public class JsvcBootstrapper extends Bootstrapper
 {
     private final static Logger log = LoggerFactory.getLogger( JsvcBootstrapper.class );
+    private boolean isListenerShuttingDown = false;
+    private boolean isDaemonShuttingDown = false;
+    private Thread thread;
 
     
     public void init( String[] args )
@@ -48,6 +51,7 @@
         setInstallationLayout( args[0] );
         setParentLoader( Thread.currentThread().getContextClassLoader() );
         callInit( shift( args, 1 ) );
+        thread = new Thread( new ShutdownListener(), "ShutdownListenerThread" );
     }
     
     
@@ -55,13 +59,28 @@
     {
         log.debug( "start() called" );
         callStart();
+        thread.start();
     }
 
 
     public void stop() throws Exception
     {
-        log.debug( "stop() called" );
-        callStop( EMPTY_STRARRAY );
+        log.debug( "stop() called using regular shutdown with signals" );
+        
+        // Bad construct here since there is no synchronization but there is
+        // no really good way to do this with the way threads are setup.  So
+        // both the listener thread and the daemon thread may try to shutdown
+        // the server.  It's possible that both will try at the same time in
+        // which case there may be issues.  However the chances of this are 
+        // very small.  For all practical purposes this will work just fine.
+        // And so what if they try to shutdown at the same time.  One thread
+        // will just get an exception due to a DeadContext.
+        
+        if ( ! isListenerShuttingDown )
+        {
+            isDaemonShuttingDown = true;
+            callStop( EMPTY_STRARRAY );
+        }
     }
 
 
@@ -69,5 +88,25 @@
     {
         log.debug( "destroy() called" );
         callDestroy();
+    }
+    
+    
+    class ShutdownListener implements Runnable
+    {
+        public void run()
+        {
+            waitForShutdown();
+            log.debug( "ShutdownListener came out of waitForShutdown" );
+            if ( ! isDaemonShuttingDown )
+            {
+                isListenerShuttingDown = true;
+                log.debug( "ShutdownListener will invoke callStop(String[])." );
+                callStop( EMPTY_STRARRAY );
+                log.debug( "ShutdownListener will invoke callDestroy()." );
+                callDestroy();
+                log.debug( "ShutdownListener will exit the system." );
+                System.exit( 0 );
+            }
+        }
     }
 }

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Application.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Application.java?rev=373279&r1=373278&r2=373279&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Application.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/Application.java
Sat Jan 28 19:17:55 2006
@@ -8,69 +8,21 @@
 
 public class Application
 {
-    /**
-     * @parameter 
-     * @required
-     */
     private String name;
-    
-    /** 
-     * @parameter
-     */
     private String description;
-
-    /** 
-     * @parameter
-     */
     private String company;
-
-    /** 
-     * @parameter
-     */
     private String email;
-
-    /**
-     * @parameter expression="${project.url}"
-     */
     private String url;
-    
-    /**
-     * @parameter expression="${project.version}"
-     */
     private String version;
-
-    /** 
-     * @parameter
-     */
     private String minimumJavaVersion;
-
-    /** 
-     * @parameter
-     */
     private String copyrightYear;
-
-    /** 
-     * @parameter
-     */
     private List authors;
-    
-    /**
-     * @parameter expression="src/main/installers/logo.ico"
-     */
     private File icon;
-
-    /**
-     * @parameter expression="README.txt"
-     */
     private File readme;
-    
-    /**
-     * @parameter expression="LICENSE.txt"
-     */
     private File license;
     
 
-    Application()
+    public Application()
     {
         Calendar cal = Calendar.getInstance();
         cal.setTimeInMillis( System.currentTimeMillis() );

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=373279&r1=373278&r2=373279&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 19:17:55 2006
@@ -52,18 +52,18 @@
     private void initializeFiltering() 
     {
         filterProperties.putAll( mymojo.getProject().getProperties() );
-        filterProperties.put( "app" , mymojo.getApplicationName() );
-        filterProperties.put( "app.caps" , mymojo.getApplicationName().toUpperCase() );
+        filterProperties.put( "app" , target.getApplication().getName() );
+        filterProperties.put( "app.caps" , target.getApplication().getName().toUpperCase()
);
         filterProperties.put( "app.server.class", mymojo.getApplicationClass() );
 
-        if ( mymojo.getApplicationVersion() != null )
+        if ( target.getApplication().getVersion() != null )
         {
-            filterProperties.put( "app.version", mymojo.getApplicationVersion() );
+            filterProperties.put( "app.version", target.getApplication().getVersion() );
         }
         
-        if ( mymojo.getApplicationDescription() != null )
+        if ( target.getApplication().getDescription() != null )
         {
-            filterProperties.put( "app.init.message", mymojo.getApplicationDescription()
);
+            filterProperties.put( "app.init.message", target.getApplication().getDescription()
);
         }
     }
 
@@ -78,31 +78,31 @@
 
 
         // copy over the read me file if present otherwise use the bundled copy
-        if ( mymojo.getReadmeFile().exists() )
+        if ( target.getApplication().getReadme() != null && target.getApplication().getReadme().exists()
)
         {
-            File readmeTarget = layout.getReadmeFile( mymojo.getReadmeFile().getName() );
+            File readmeTarget = layout.getReadmeFile( target.getApplication().getReadme().getName()
);
             try
             {
-                FileUtils.copyFile( mymojo.getReadmeFile(), readmeTarget );
+                FileUtils.copyFile( target.getApplication().getReadme(), readmeTarget );
             }
             catch ( IOException e )
             {
-                throw new MojoFailureException( "Failed to copy read me file " + mymojo.getReadmeFile()
+                throw new MojoFailureException( "Failed to copy read me file " + target.getApplication().getReadme()
                     + " into position " + readmeTarget );
             }
         }
         
         // copy over the license file if present otherwise use the bundled copy
-        File licenseTarget = layout.getLicenseFile( mymojo.getLicenseFile().getName() );
-        if ( mymojo.getLicenseFile().exists() )
+        File licenseTarget = layout.getLicenseFile( target.getApplication().getLicense().getName()
);
+        if ( target.getApplication().getLicense().exists() )
         {
             try
             {
-                FileUtils.copyFile( mymojo.getLicenseFile(), licenseTarget );
+                FileUtils.copyFile( target.getApplication().getLicense(), licenseTarget );
             }
             catch ( IOException e )
             {
-                throw new MojoFailureException( "Failed to copy license file " + mymojo.getLicenseFile()
+                throw new MojoFailureException( "Failed to copy license file " + target.getApplication().getLicense()
                     + " into position " + licenseTarget );
             }
         }
@@ -122,16 +122,16 @@
         }
         
         // copy over the icon if present otherwise use the bundled copy
-        File iconTarget = layout.getLogoIconFile( mymojo.getApplicationIcon().getName() );
-        if ( mymojo.getApplicationIcon().exists() )
+        File iconTarget = layout.getLogoIconFile( target.getApplication().getIcon().getName()
);
+        if ( target.getApplication().getIcon().exists() )
         {
             try
             {
-                FileUtils.copyFile( mymojo.getApplicationIcon(), iconTarget );
+                FileUtils.copyFile( target.getApplication().getIcon(), iconTarget );
             }
             catch ( IOException e )
             {
-                throw new MojoFailureException( "Failed to copy icon file " + mymojo.getApplicationIcon()
+                throw new MojoFailureException( "Failed to copy icon file " + target.getApplication().getIcon()
                     + " into position " + iconTarget );
             }
         }
@@ -233,7 +233,7 @@
         if ( target.getOsName().equals( "linux" ) && 
              target.getOsArch().equals( "i386" ) )
         {
-            File executable = new File ( layout.getBinDirectory(), mymojo.getApplicationName()
);
+            File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
);
             try
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "jsvc_linux_i386"
), executable );
@@ -250,7 +250,7 @@
         if ( target.getOsName().equals( "sunos" ) && 
              target.getOsArch().equals( "sparc" ) )
         {
-            File executable = new File ( layout.getBinDirectory(), mymojo.getApplicationName()
);
+            File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
);
             try
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "jsvc_solaris_sparc"
), executable );
@@ -266,7 +266,7 @@
         // now copy over the jsvc executable renaming it to the mymojo.getApplicationName()

         if ( target.getOsName().equals( "macosx" ) && target.getOsArch().equals(
"ppc" ) )
         {
-            File executable = new File ( layout.getBinDirectory(), mymojo.getApplicationName()
);
+            File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
);
             try
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "jsvc_macosx_ppc"
), executable );
@@ -282,7 +282,7 @@
         // now copy over the Prunsrv and Prunmgr executables renaming them to the mymojo.getApplicationName()
+ w for mgr
         if ( target.getOsFamily().equals( "windows" ) &&  target.getOsArch().equals(
"x86" ) )
         {
-            File executable = new File ( layout.getBinDirectory(), mymojo.getApplicationName()
+ ".exe" );
+            File executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
+ ".exe" );
             try
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "prunsrv.exe"
), executable );
@@ -294,7 +294,7 @@
                     + " into position " + executable.getAbsolutePath() );
             }
 
-            executable = new File ( layout.getBinDirectory(), mymojo.getApplicationName()
+ "w.exe" );
+            executable = new File ( layout.getBinDirectory(), target.getApplication().getName()
+ "w.exe" );
             try
             {
                 MojoHelperUtils.copyBinaryFile( getClass().getResourceAsStream( "prunmgr.exe"
), executable );

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=373279&r1=373278&r2=373279&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 19:17:55 2006
@@ -27,11 +27,15 @@
 import org.apache.directory.server.standalone.installers.inno.InnoTarget;
 import org.apache.directory.server.standalone.installers.izpack.IzPackInstallerCommand;
 import org.apache.directory.server.standalone.installers.izpack.IzPackTarget;
+
 import org.apache.maven.artifact.Artifact;
+import org.apache.maven.model.Developer;
+import org.apache.maven.model.MailingList;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
+import org.apache.tools.ant.util.JavaEnvUtils;
 
 
 /**
@@ -103,7 +107,7 @@
      * @parameter 
      * @required
      */
-    private String applicationName;
+    private Application application;
     
     /**
      * @parameter 
@@ -112,41 +116,6 @@
     private String applicationClass;
 
     /**
-     * @parameter expression="${project.version}"
-     */
-    private String applicationVersion;
-
-    /**
-     * @parameter expression="${project.description}"
-     */
-    private String applicationDescription;
-    
-    /**
-     * @parameter 
-     */
-    private String applicationEmail = "general@apache.org";
-
-    /**
-     * @parameter expression="1.4"
-     */
-    private String applicationJavaVersion;
-
-    /**
-     * @parameter 
-     */
-    private String applicationAuthor = "Apache Software Foundation";
-
-    /**
-     * @parameter expression="${project.url}"
-     */
-    private String applicationUrl = "http://www.apache.org";
-
-    /**
-     * @parameter expression="src/main/installers/logo.ico"
-     */
-    private File applicationIcon;
-
-    /**
      * @parameter
      */
     private String encoding;
@@ -156,16 +125,6 @@
      */
     private Set excludes;
 
-    /**
-     * @parameter expression="LICENSE.txt"
-     */
-    private File licenseFile;
-
-    /**
-     * @parameter expression="README.txt"
-     */
-    private File readmeFile;
-
     /** daemon bootstrapper */
     private Artifact bootstrapper;
     /** logging API need by bootstraper */
@@ -250,16 +209,126 @@
     }
     
     
-    private void setDefaults()
+    private void setDefaults() throws MojoFailureException
     {
         if ( allTargets == null )
         {
             return;
         }
+
+        if ( application.getName() == null )
+        {
+            throw new MojoFailureException( "Installed application name cannot be null."
);
+        }
+        
+        if ( application.getCompany() == null )
+        {
+            if ( project.getOrganization() != null )
+            {
+                application.setCompany( project.getOrganization().getName() );
+            }
+            else
+            {
+                application.setCompany( "Apache Software Foundation" );
+            }
+        }
+        
+        if ( application.getDescription() == null )
+        {
+            if ( project.getDescription() != null )
+            {
+                application.setDescription( project.getDescription() );
+            }
+            else
+            {
+                application.setDescription( "No description of this application is available."
);
+            }
+        }
+        
+        if ( project.getInceptionYear() != null )
+        {
+            application.setCopyrightYear( project.getInceptionYear() );
+        }
+        
+        if ( application.getUrl() == null )
+        {
+            if ( project.getUrl() != null )
+            {
+                application.setUrl( project.getUrl() );
+            }
+            else if ( project.getOrganization() != null )
+            {
+                application.setUrl( project.getOrganization().getUrl() );
+            }
+            else
+            {
+                application.setUrl( "http://www.apache.org" );
+            }
+        }
+        
+        if ( application.getVersion() == null )
+        {
+            application.setVersion( project.getVersion() );
+        }
+        
+        if ( application.getMinimumJavaVersion() == null )
+        {
+            application.setMinimumJavaVersion( JavaEnvUtils.getJavaVersion() );
+        }
+        
+        if ( application.getAuthors() == null )
+        {
+            List authors = new ArrayList();
+            List developers = project.getDevelopers();
+            for ( int ii = 0; ii < developers.size(); ii++ )
+            {
+                Developer developer = ( Developer ) developers.get( ii );
+                if ( developer.getEmail() != null )
+                {
+                    authors.add( developer.getEmail() );
+                }
+                else 
+                {
+                    authors.add( developer.getName() );
+                }
+            }
+            
+            application.setAuthors( authors );
+        }
+        
+        if ( application.getEmail() == null )
+        {
+            if ( ! project.getMailingLists().isEmpty() )
+            {
+                application.setEmail( ( ( MailingList ) project.getMailingLists().get( 0
) ).getPost() );
+            }
+            
+            application.setEmail( "general@apache.org" );
+        }
+        
+        if ( application.getIcon() == null )
+        {
+            application.setIcon( new File( "src/main/installers/logo.ico" ) );
+        }
+        
+        if ( application.getReadme() == null )
+        {
+            application.setReadme( new File( "README.txt" ) );
+        }
+        
+        if ( application.getLicense() == null )
+        {
+            application.setLicense( new File( "LICENSE.txt" ) );
+        }
         
         for ( int ii = 0; ii < allTargets.size(); ii++ )
         {
             Target target = ( Target ) allTargets.get( ii );
+            
+            if ( target.getApplication() == null)
+            {
+                target.setApplication( this.application );
+            }
 
             if ( target.getLoggerConfigurationFile() == null )
             {
@@ -277,21 +346,21 @@
             {
                 target.setOsVersion( "*" );
             }
-            if ( target.getApplicationAuthor() == null )
+            if ( target.getApplicationAuthors() == null )
             {
-                target.setApplicationAuthor( applicationAuthor );
+                target.setApplicationAuthors( application.getAuthors() );
             }
             if ( target.getApplicationEmail() == null )
             {
-                target.setApplicationEmail( applicationEmail );
+                target.setApplicationEmail( application.getEmail() );
             }
             if ( target.getApplicationJavaVersion() == null )
             {
-                target.setApplicationJavaVersion( applicationJavaVersion );
+                target.setApplicationJavaVersion( application.getMinimumJavaVersion() );
             }
             if ( target.getApplicationUrl() == null )
             {
-                target.setApplicationUrl( applicationUrl );
+                target.setApplicationUrl( application.getUrl() );
             }
         }
     }
@@ -343,7 +412,7 @@
     {
         getLog().info( "==================================================================="
);
         getLog().info( "[installers:create]" );
-        getLog().info( "applicationName = " + applicationName );
+        getLog().info( "applicationName = " + application.getName() );
         getLog().info( "sourceDirectory = " + sourceDirectory );
         getLog().info( "outputDirectory = " + outputDirectory );
         getLog().info( "----------------------------- allTargets -----------------------------"
);
@@ -398,13 +467,6 @@
         return logger;
     }
 
-
-    public String getApplicationName()
-    {
-        return applicationName;
-    }
-
-
     public String getEncoding()
     {
         return this.encoding;
@@ -423,42 +485,12 @@
     }
 
 
-    public String getApplicationVersion()
-    {
-        return this.applicationVersion;
-    }
-
-
     public String getApplicationClass()
     {
         return this.applicationClass;
     }
 
 
-    public String getApplicationDescription()
-    {
-        return this.applicationDescription;
-    }
-    
-    
-    public File getApplicationIcon()
-    {
-        return this.applicationIcon;
-    }
-    
-    
-    public File getReadmeFile()
-    {
-        return this.readmeFile;
-    }
-    
-    
-    public File getLicenseFile()
-    {
-        return this.licenseFile;
-    }
-    
-    
     public File getSourceDirectory()
     {
         return this.sourceDirectory;

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=373279&r1=373278&r2=373279&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 19:17:55 2006
@@ -61,7 +61,7 @@
     private String daemonFramework;
     
     // optional stuff
-    private String applicationAuthor;
+    private List applicationAuthors;
     private String applicationUrl;
     private String applicationJavaVersion;
     private String applicationEmail;
@@ -76,6 +76,22 @@
     private InstallationLayout layout;
     private List libArtifacts;
     
+    
+    private Application application;
+    
+    
+    public void setApplication( Application application )
+    {
+        this.application = application;
+    }
+    
+    
+    public Application getApplication()
+    {
+        return application;
+    }
+    
+    
     public void setOsName( String osName )
     {
         this.osName = osName.toLowerCase( Locale.US );
@@ -212,15 +228,15 @@
     }
 
 
-    public void setApplicationAuthor(String author)
+    public void setApplicationAuthors(List authors)
     {
-        this.applicationAuthor = author;
+        this.applicationAuthors = authors;
     }
 
 
-    public String getApplicationAuthor()
+    public List getApplicationAuthors()
     {
-        return applicationAuthor;
+        return applicationAuthors;
     }
 
 

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java?rev=373279&r1=373278&r2=373279&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/inno/InnoInstallerCommand.java
Sat Jan 28 19:17:55 2006
@@ -185,15 +185,15 @@
     private void initializeFiltering() throws MojoFailureException 
     {
         filterProperties.putAll( mymojo.getProject().getProperties() );
-        filterProperties.put( "app" , mymojo.getApplicationName() );
+        filterProperties.put( "app" , target.getApplication().getName() );
         
-        char firstChar = mymojo.getApplicationName().charAt( 0 );
+        char firstChar = target.getApplication().getName().charAt( 0 );
         firstChar = Character.toUpperCase( firstChar );
-        filterProperties.put( "app.displayname", firstChar + mymojo.getApplicationName().substring(
1 ) );
+        filterProperties.put( "app.displayname", firstChar + target.getApplication().getName().substring(
1 ) );
 
-        if ( mymojo.getApplicationVersion() != null )
+        if ( target.getApplication().getVersion() != null )
         {
-            filterProperties.put( "app.version", mymojo.getApplicationVersion() );
+            filterProperties.put( "app.version", target.getApplication().getVersion() );
         }
         else
         {
@@ -203,15 +203,24 @@
         // -------------------------------------------------------------------
         // WARNING: hard code values just to for testing
         // -------------------------------------------------------------------
+
+        // @todo use the list of committers and add multiple authors to inno
+        if ( target.getApplication().getAuthors().isEmpty() )
+        {
+            filterProperties.put( "app.author" , "Apache Software Foundation" );
+        }
+        else
+        {
+            filterProperties.put( "app.author", target.getApplication().getAuthors().get(
0 ) );
+        }
         
-        filterProperties.put( "app.author" , target.getApplicationAuthor() );
-        filterProperties.put( "app.email" , target.getApplicationEmail() );
-        filterProperties.put( "app.url" , target.getApplicationUrl() );
-        filterProperties.put( "app.java.version" , target.getApplicationJavaVersion() );
+        filterProperties.put( "app.email" , target.getApplication().getEmail() );
+        filterProperties.put( "app.url" , target.getApplication().getUrl() );
+        filterProperties.put( "app.java.version" , target.getApplication().getMinimumJavaVersion()
);
         filterProperties.put( "app.license" , target.getLayout().getLicenseFile().getPath()
);
         filterProperties.put( "app.license.name" , target.getLayout().getLicenseFile().getName()
);
         filterProperties.put( "app.company.name" , target.getCompanyName() );
-        filterProperties.put( "app.description" , mymojo.getApplicationDescription() ); 
+        filterProperties.put( "app.description" , target.getApplication().getDescription()
); 
         filterProperties.put( "app.copyright.year", target.getCopyrightYear() );
 
         if ( ! target.getLayout().getReadmeFile().exists() )

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/izpack/IzPackInstallerCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/izpack/IzPackInstallerCommand.java?rev=373279&r1=373278&r2=373279&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/izpack/IzPackInstallerCommand.java
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/java/org/apache/directory/server/standalone/installers/izpack/IzPackInstallerCommand.java
Sat Jan 28 19:17:55 2006
@@ -69,7 +69,7 @@
         this.mymojo = mymojo;
         File imageDir = layout.getBaseDirectory().getParentFile();
         izPackBase = new File( imageDir, target.getId() );
-        izPackOutput = new File( imageDir, target.getId() + "_izpack_installer.jar" );
+        izPackOutput = new File( imageDir, target.getId() + "-" + target.getOsArch() + "_izpack_installer.jar"
);
         izPackInput = new File( imageDir, target.getId() + "_izpack_install.xml" );
         izPackUserInput = new File( imageDir, target.getId() + "_izpack_install_user_input.xml"
);
         izPackWindowsShortcuts = new File( imageDir, target.getId() + "_izpack_windows_shortcuts.xml"
);
@@ -342,18 +342,18 @@
     private void initializeFiltering() 
     {
         filterProperties.putAll( mymojo.getProject().getProperties() );
-        filterProperties.put( "app" , mymojo.getApplicationName() );
-        filterProperties.put( "app.caps" , mymojo.getApplicationName().toUpperCase() );
+        filterProperties.put( "app" , target.getApplication().getName() );
+        filterProperties.put( "app.caps" , target.getApplication().getName().toUpperCase()
);
         filterProperties.put( "app.server.class", mymojo.getApplicationClass() );
 
-        if ( mymojo.getApplicationVersion() != null )
+        if ( target.getApplication().getVersion() != null )
         {
-            filterProperties.put( "app.version", mymojo.getApplicationVersion() );
+            filterProperties.put( "app.version", target.getApplication().getVersion() );
         }
         
-        if ( mymojo.getApplicationDescription() != null )
+        if ( target.getApplication().getDescription() != null )
         {
-            filterProperties.put( "app.init.message", mymojo.getApplicationDescription()
);
+            filterProperties.put( "app.init.message", target.getApplication().getDescription()
);
         }
 
         // -------------------------------------------------------------------
@@ -361,10 +361,21 @@
         // -------------------------------------------------------------------
         
         // optional properties from mojo but should default:
-        filterProperties.put( "app.author" , target.getApplicationAuthor() );
-        filterProperties.put( "app.email" , target.getApplicationEmail() );
-        filterProperties.put( "app.url" , target.getApplicationUrl() );
-        filterProperties.put( "app.java.version" , target.getApplicationJavaVersion() );
+
+        // @todo use the list of committers and add all of them by adding 
+        // additional izpack author tags
+        if ( target.getApplication().getAuthors().isEmpty() )
+        {
+            filterProperties.put( "app.author" , "Apache Software Foundation" );
+        }
+        else
+        {
+            filterProperties.put( "app.author" , target.getApplication().getAuthors().get(
0 ) );
+        }
+        
+        filterProperties.put( "app.email" , target.getApplication().getEmail() );
+        filterProperties.put( "app.url" , target.getApplication().getUrl() );
+        filterProperties.put( "app.java.version" , target.getApplication().getMinimumJavaVersion()
);
         
         // izpack compiler will barf if these files are not present
         // files which are user specified also from mojo

Modified: directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init?rev=373279&r1=373278&r2=373279&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
(original)
+++ directory/trunks/apacheds/standalone/installers/plugin/src/main/resources/org/apache/directory/server/standalone/installers/template.init
Sat Jan 28 19:17:55 2006
@@ -137,13 +137,12 @@
     -home $JAVA_HOME \
     -Djava.io.tmpdir=$TMP_DIR \
     -Dlog4j.configuration=file://$SERVER_HOME/conf/log4j.properties\
-    -wait 10 \
     -pidfile $PID_FILE \
     -outfile $SERVER_HOME/var/log/${app}-stdout.log \
     -errfile $SERVER_HOME/var/log/${app}-stderr.log \
     -cp $CLASSPATH \
     org.apache.directory.server.standalone.daemon.JsvcBootstrapper \
-    $_${app.caps}_HOME
+    $_${app.caps}_HOME start
 
     if [ `uname` = "Darwin" ] ; then
         [ "$RETVAL" -eq 0 ] && echo successful ${app} server startup || \

Modified: directory/trunks/apacheds/standalone/installers/test/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/standalone/installers/test/pom.xml?rev=373279&r1=373278&r2=373279&view=diff
==============================================================================
--- directory/trunks/apacheds/standalone/installers/test/pom.xml (original)
+++ directory/trunks/apacheds/standalone/installers/test/pom.xml Sat Jan 28 19:17:55 2006
@@ -93,9 +93,14 @@
             <exclude>asm:asm-util</exclude>
             <exclude>jasperreports:jasperreports</exclude>
           </excludes>
-          <applicationName>test</applicationName>
+          <application>
+            <name>test</name>
+            <version>${pom.version}</version>
+            <authors>
+              <author>akarasulu@apache.org</author>
+            </authors>
+          </application>
           <applicationClass>org.apache.ldap.server.DirectoryServer</applicationClass>
-          <applicationVersion>${pom.version}</applicationVersion>
           <innoTargets>
             <innoTarget>
               <id>windows-xp-procrun</id>
@@ -106,7 +111,6 @@
               <daemonFramework>procrun</daemonFramework>
             </innoTarget>
           </innoTargets>
-<!--
           <izPackTargets>
             <izPackTarget>
               <id>linux-jsvc</id>
@@ -115,6 +119,7 @@
               <osArch>i386</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
+<!--
             <izPackTarget>
               <id>macosx-jsvc</id>
               <osName>macosx</osName>
@@ -122,6 +127,7 @@
               <osArch>ppc</osArch>
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
+-->
             <izPackTarget>
               <id>solaris-jsvc</id>
               <osName>sunos</osName>
@@ -131,7 +137,6 @@
               <daemonFramework>jsvc</daemonFramework>
             </izPackTarget>
           </izPackTargets>
--->
         </configuration>
         <executions>
           <execution>



Mime
View raw message