directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r811541 [1/2] - in /directory: apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/ apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/ apacheds/bra...
Date Fri, 04 Sep 2009 20:40:10 GMT
Author: akarasulu
Date: Fri Sep  4 20:40:08 2009
New Revision: 811541

URL: http://svn.apache.org/viewvc?rev=811541&view=rev
Log:
Refactored Partition and reworked Instance/Install Layouts

  o making init( DirectoryService ) into initialize()
  o added registry getter/setter pair
  o removed unnecessary Partition methods like get/setCacheSize()
  o cleaned up from changes
  o moved over the InstanceLayout into daemon
  o made InstanceLayout contain and leverage InstallLayout to find resources
  o cleaned up from changes


Added:
    directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallLayout.java
      - copied, changed from r811352, directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java
    directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstanceLayout.java
      - copied, changed from r811351, directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/InstanceLayout.java
Removed:
    directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/InstanceLayout.java
    directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java
Modified:
    directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
    directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
    directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
    directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
    directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
    directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
    directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java
    directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java
    directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/DaemonApplication.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/archive/ArchiveInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/rpm/RpmInstallerCommand.java
    directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/solarispkg/SolarisPkgInstallerCommand.java

Modified: directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/avl-partition/src/main/java/org/apache/directory/server/core/partition/avl/AvlPartition.java Fri Sep  4 20:40:08 2009
@@ -25,7 +25,6 @@
 import java.util.Set;
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -46,7 +45,6 @@
 import org.apache.directory.server.xdbm.search.impl.NoOpOptimizer;
 import org.apache.directory.shared.ldap.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 
 
 /**
@@ -77,17 +75,7 @@
     }
 
 
-    public void init( DirectoryService dirService ) throws Exception
-    {
-        initRegistries( dirService.getRegistries() );
-    }
-
-
-    /**
-     * @{inhertDoc}
-     */
-    @SuppressWarnings("unchecked")
-    public void initRegistries( Registries registries ) throws Exception
+    public void initialize( ) throws Exception
     {
         setRegistries( registries );
 
@@ -499,15 +487,6 @@
     }
 
 
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public void setRegistries( Registries registries ) throws Exception
-    {
-        initRegistries( registries );
-    }
-
-
     /*
      * TODO requires review 
      * 

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Fri Sep  4 20:40:08 2009
@@ -1414,7 +1414,7 @@
         }
 
         // triggers partition to load schema fully from schema partition
-        schemaService.getSchemaPartition().init( this );
+        schemaService.getSchemaPartition().initialize( );
 
         adminDn = new LdapDN( ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED );
         adminDn.normalize( getRegistries().getAttributeTypeRegistry().getNormalizerMapping() );
@@ -1422,7 +1422,7 @@
         
         // @TODO - NOTE: Need to find a way to instantiate without dependency on DPN
         partitionNexus = new PartitionNexus( new DefaultServerEntry( getRegistries(), LdapDN.EMPTY_LDAPDN ) );
-        partitionNexus.init( this );
+        partitionNexus.initialize( );
         partitionNexus.addContextPartition( new AddContextPartitionOperationContext( adminSession, schemaService.getSchemaPartition() ) );
 
         // --------------------------------------------------------------------

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/changelog/DefaultChangeLog.java Fri Sep  4 20:40:08 2009
@@ -312,7 +312,7 @@
                 tmp.createPartition( partitionSuffix, revContainerName, tagContainerName );
                 
                 Partition partition = tmp.getPartition();
-                partition.init( service );
+                partition.initialize( );
 
                 service.addPartition( partition );
             }

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java Fri Sep  4 20:40:08 2009
@@ -24,6 +24,7 @@
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.interceptor.context.EntryOperationContext;
 import org.apache.directory.server.core.interceptor.context.LookupOperationContext;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 
 import javax.naming.InvalidNameException;
 import javax.naming.NameNotFoundException;
@@ -39,11 +40,13 @@
  */
 public abstract class AbstractPartition implements Partition
 {
-    /** {@link DirectoryService} specified at {@link #init(DirectoryService)}. */
+    /** {@link DirectoryService} specified at {@link #initialize()}. */
     protected DirectoryService directoryService;
     /** <tt>true</tt> if and only if this partition is initialized. */
     protected boolean initialized;
 
+    protected Registries registries;
+    
 
     protected AbstractPartition()
     {
@@ -51,12 +54,30 @@
 
 
     /**
+     * {@inheritDoc}
+     */
+    public void setRegistries( Registries registries )
+    {
+        this.registries = registries;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Registries getRegistries()
+    {
+        return registries;
+    }
+    
+    
+    /**
      * Sets up (<tt>directoryService</tt> and calls {@link #doInit()} where you have to put your
      * initialization code in.  {@link #isInitialized()} will return <tt>true</tt> if
      * {@link #doInit()} returns without any errors.  {@link #destroy()} is called automatically
      * as a clean-up process if {@link #doInit()} throws an exception.
      */
-    public final void init( DirectoryService directoryService ) throws Exception
+    public final void initialize( ) throws Exception
     {
         if ( initialized )
         {
@@ -126,7 +147,7 @@
 
     /**
      * Returns {@link DirectoryService} that is provided from
-     * {@link #init(DirectoryService)}.
+     * {@link #initialize()}.
      * @return return the directory service core
      */
     public final DirectoryService getDirectoryService()

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/NullPartition.java Fri Sep  4 20:40:08 2009
@@ -43,6 +43,7 @@
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.cursor.ClosureMonitor;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 
 
 /**
@@ -91,15 +92,6 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.Partition#getCacheSize()
-     */
-    public int getCacheSize()
-    {
-        return 0;
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.Partition#getId()
      */
     public String getId()
@@ -302,14 +294,6 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.Partition#setCacheSize(int)
-     */
-    public void setCacheSize( int cacheSize )
-    {
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.Partition#setId(java.lang.String)
      */
     public void setId( String id )
@@ -335,8 +319,22 @@
     }
 
 
-    public String getSuffix() throws InvalidNameException
+    public String getSuffix()
     {
         return suffix.getUpName();
     }
+
+
+    public Registries getRegistries()
+    {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+
+    public void setRegistries( Registries registries )
+    {
+        // TODO Auto-generated method stub
+        
+    }
 }

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/Partition.java Fri Sep  4 20:40:08 2009
@@ -20,7 +20,6 @@
 package org.apache.directory.server.core.partition;
 
 
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerSearchResult;
 import org.apache.directory.server.core.filtering.EntryFilteringCursor;
@@ -37,18 +36,15 @@
 import org.apache.directory.server.core.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.interceptor.context.UnbindOperationContext;
 import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.registries.Registries;
 
-import javax.naming.Context;
 import javax.naming.InvalidNameException;
 
 
 /**
- * An interfaces that bridges between underlying JNDI entries and JNDI
- * {@link Context} API.  DIT (Directory Information Tree) consists one or
- * above {@link Partition}s whose parent is {@link PartitionNexus},
- * and all of them are mapped to different
- * base suffix.  Each partition contains entries whose name ends with that
- * base suffix.
+ * Interface for entry stores containing a part of the DIB (Directory 
+ * Information Base).  Partitions are associated with a specific suffix, and
+ * all entries contained in the them have the same DN suffix in common.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
@@ -58,6 +54,8 @@
     // -----------------------------------------------------------------------
     // C O N F I G U R A T I O N   M E T H O D S
     // -----------------------------------------------------------------------
+
+    
     /**
      * Gets the unique identifier for this partition.
      *
@@ -75,44 +73,34 @@
 
 
     /**
-     * Gets the suffix for this Partition.
-     *
-     * @return the suffix for this Partition.
-     */
-    LdapDN getSuffixDn();
-
-
-    /**
      * Gets the user provided suffix for this Partition as a String.
      */
-    String getSuffix()  throws InvalidNameException;
+    String getSuffix();
 
 
     /**
      * Sets the user provided suffix for this Partition as a String.
      *
      * @param suffix the suffix String for this Partition.
-     * @throws InvalidNameException If the suffix is not a valid DN
+     * @throws InvalidNameException if the suffix does not conform to LDAP DN syntax
      */
     void setSuffix( String suffix )  throws InvalidNameException;
-
-
+    
+    
     /**
-     * Used to specify the entry cache size for a Partition.  Various Partition
-     * implementations may interpret this value in different ways: i.e. total cache
-     * size limit verses the number of entries to cache.
+     * Gets the schema registries assigned to this Partition.
      *
-     * @param cacheSize the size of the cache
+     * @return the schema Registries
      */
-    void setCacheSize( int cacheSize );
-
-
+    Registries getRegistries();
+    
+    
     /**
-     * Gets the entry cache size for this partition.
+     * Sets the schema registries assigned to this Partition.
      *
-     * @return the size of the cache
+     * @param registries the registries to assign to this Partition.
      */
-    int getCacheSize();
+    void setRegistries( Registries registries );
 
 
     // -----------------------------------------------------------------------
@@ -123,14 +111,25 @@
     /**
      * Initializes this partition.
      *
-     * @param core the directory core for the server.
      * @throws Exception if initialization fails in any way
      */
-    void init( DirectoryService core ) throws Exception;
+    void initialize() throws Exception;
+
+
+    /**
+     * Gets the normalized suffix as an LdapDN for this Partition after it has 
+     * been initialized.  Attempts to get this LdapDN before initialization 
+     * throw an IllegalStateException.
+     *
+     * @return the suffix for this Partition.
+     * @throws IllegalStateException if the Partition has not been initialized
+     */
+    LdapDN getSuffixDn();
 
 
     /**
-     * Deinitialized this partition.
+     * Instructs this Partition to synchronize with it's persistent store, and
+     * destroy all held resources, in preparation for a shutdown event.
      */
     void destroy() throws Exception;
 
@@ -172,7 +171,7 @@
     /**
      * Modifies an entry by adding, removing or replacing a set of attributes.
      *
-     * @param opContext The contetx containin the modification operation 
+     * @param opContext The context containing the modification operation 
      * to perform on the entry which is one of constants specified by the 
      * DirContext interface:
      * <code>ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE</code>.
@@ -245,7 +244,7 @@
      * Modifies an entry by changing its relative name. Optionally attributes
      * associated with the old relative name can be removed from the entry.
      * This makes sense only in certain namespaces like LDAP and will be ignored
-     * if it is irrelavent.
+     * if it is irrelevant.
      *
      * @param opContext the modify DN context
      * @throws Exception if there are any problems

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java Fri Sep  4 20:40:08 2009
@@ -219,7 +219,7 @@
     /**
      * {@inheritDoc}
      */
-    public void init( DirectoryService directoryService ) throws Exception
+    public void initialize( ) throws Exception
     {
         // NOTE: We ignore ContextPartitionConfiguration parameter here.
         if ( initialized )
@@ -305,7 +305,7 @@
             system = override;
         }
 
-        system.init( directoryService );
+        system.initialize( );
         
         
         // Add root context entry for system partition
@@ -424,6 +424,24 @@
 
     
     /**
+     * {@inheritDoc}
+     */
+    public Registries getRegistries()
+    {
+        return this.registries;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public void setRegistries( Registries registries )
+    {
+        this.registries = registries;
+    }
+    
+    
+    /**
      * Always returns the empty String "".
      * @return the empty String ""
      */
@@ -459,26 +477,6 @@
 
 
     /**
-     * Not supported!
-     *
-     * @throws UnsupportedOperationException always
-     */
-    public int getCacheSize()
-    {
-        throw new UnsupportedOperationException( "There is no cache size associated with the nexus" );
-    }
-
-    
-    /**
-     * Not support!
-     */
-    public void setCacheSize( int cacheSize )
-    {
-        throw new UnsupportedOperationException( "You cannot set the cache size of the nexus" );
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public void sync() throws Exception
@@ -902,7 +900,7 @@
 
         if ( ! partition.isInitialized() )
         {
-            partition.init( directoryService );
+            partition.initialize( );
         }
         
         synchronized ( partitionLookupTree )

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java Fri Sep  4 20:40:08 2009
@@ -49,6 +49,8 @@
 
 import javax.naming.InvalidNameException;
 import javax.naming.directory.SearchControls;
+
+import java.io.File;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -90,6 +92,7 @@
     protected String id;
     protected int cacheSize = -1;
     protected LdapDN suffix;
+    private File partitionDir;
     
     /** The rootDSE context */
     protected ServerEntry contextEntry;
@@ -114,6 +117,46 @@
     // C O N F I G U R A T I O N   M E T H O D S
     // ------------------------------------------------------------------------
 
+
+    /**
+     * {@inheritDoc}
+     */
+    public void setRegistries( Registries registries )
+    {
+        this.registries = registries;
+    }
+    
+    
+    /**
+     * {@inheritDoc}
+     */
+    public Registries getRegistries()
+    {
+        return registries;
+    }
+    
+    
+    /**
+     * Gets the directory in which this Partition stores files.
+     *
+     * @return the directory in which this Partition stores files.
+     */
+    public File getPartitionDir()
+    {
+        return partitionDir;
+    }
+    
+    
+    /**
+     * Sets the directory in which this Partition stores files.
+     *
+     * @param partitionDir the directory in which this Partition stores files.
+     */
+    public void setPartitionDir( File partitionDir )
+    {
+        this.partitionDir = partitionDir;
+    }
+    
     
     public void setIndexedAttributes( Set<Index<?,ServerEntry>> indexedAttributes )
     {
@@ -178,19 +221,6 @@
     // -----------------------------------------------------------------------
 
 
-    /**
-     * Allows for schema entity registries to be swapped out during runtime.  This is 
-     * primarily here to facilitate the swap out of a temporary bootstrap registry.  
-     * Registry changes require swapping out the search engine used by a partition 
-     * since the registries are used by elements in the search engine.
-     * 
-     * @org.apache.xbean.Property hidden="true"
-     * @param registries the schema entity registries
-     * @throws Exception 
-     */
-    public abstract void setRegistries( Registries registries ) throws Exception;
-
-    
     // ------------------------------------------------------------------------
     // Public Accessors - not declared in any interfaces just for this class
     // ------------------------------------------------------------------------

Modified: directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/core/src/main/java/org/apache/directory/server/core/schema/SchemaPartition.java Fri Sep  4 20:40:08 2009
@@ -188,7 +188,7 @@
         
         try
         {
-            wrapped.init( getDirectoryService() );
+            wrapped.initialize( );
             PartitionSchemaLoader partitionLoader = new PartitionSchemaLoader( wrapped, registries );
             partitionLoader.loadAllEnabled( registries );
             loader = partitionLoader;
@@ -312,15 +312,6 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.Partition#getCacheSize()
-     */
-    public int getCacheSize()
-    {
-        return wrapped.getCacheSize();
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.Partition#getId()
      */
     public final String getId()
@@ -425,15 +416,6 @@
 
 
     /* (non-Javadoc)
-     * @see org.apache.directory.server.core.partition.Partition#setCacheSize(int)
-     */
-    public void setCacheSize( int cacheSize )
-    {
-        wrapped.setCacheSize( cacheSize );
-    }
-
-
-    /* (non-Javadoc)
      * @see org.apache.directory.server.core.partition.Partition#setId(java.lang.String)
      */
     public void setId( String id )

Modified: directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/jdbm-partition/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java Fri Sep  4 20:40:08 2009
@@ -21,7 +21,6 @@
 
 
 import org.apache.directory.server.constants.ApacheSchemaConstants;
-import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.server.core.entry.ClonedServerEntry;
 import org.apache.directory.server.core.entry.ServerEntry;
 import org.apache.directory.server.core.interceptor.context.AddOperationContext;
@@ -45,11 +44,9 @@
 import org.apache.directory.shared.ldap.exception.LdapAuthenticationNotSupportedException;
 import org.apache.directory.shared.ldap.message.ResultCodeEnum;
 import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.registries.Registries;
 
 import javax.naming.NamingException;
 
-import java.io.File;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -119,26 +116,10 @@
     // ------------------------------------------------------------------------
 
 
-    /**
-     * @org.apache.xbean.Property hidden="true"
-     */
-    public void setRegistries( Registries registries ) throws Exception
-    {
-        initRegistries( registries );
-    }
-
-
-    protected void initRegistries( Registries registries ) throws Exception
-    {
-        this.registries = registries;
-        store.initRegistries( registries );
-    }
-
-
     @SuppressWarnings("unchecked")
-    public final void init( DirectoryService directoryService ) throws Exception
+    public final void initialize( ) throws Exception
     {
-        initRegistries( directoryService.getRegistries() );
+        store.init( registries );
 
         EvaluatorBuilder evaluatorBuilder = new EvaluatorBuilder( store, registries );
         CursorBuilder cursorBuilder = new CursorBuilder( store, evaluatorBuilder );
@@ -162,7 +143,7 @@
         // Normalize the suffix
         suffix.normalize( registries.getAttributeTypeRegistry().getNormalizerMapping() );
         store.setSuffixDn( suffix.getNormName() );
-        store.setWorkingDirectory( new File( directoryService.getWorkingDirectory().getPath() + File.separator + id ) );
+        store.setWorkingDirectory( getPartitionDir() );
 
         Set<Index<?,ServerEntry>> userIndices = new HashSet<Index<?,ServerEntry>>();
         

Modified: directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java (original)
+++ directory/apacheds/branches/apacheds-schema/ldif-partition/src/main/java/org/apache/directory/server/core/partition/ldif/LdifPartition.java Fri Sep  4 20:40:08 2009
@@ -17,9 +17,9 @@
  *   under the License.
  *
  */
-
 package org.apache.directory.server.core.partition.ldif;
 
+
 import java.io.File;
 import java.io.FileFilter;
 import java.io.FileWriter;
@@ -51,6 +51,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+
 /**
  * TODO LdifPartition.
  * 
@@ -88,9 +89,9 @@
 
 
 
-    public void init( DirectoryService directoryService ) throws Exception
+    public void initialize( ) throws Exception
     {
-        wrappedPartition.init( directoryService );
+        wrappedPartition.initialize( );
 
         this.directoryService = directoryService;
         this.registries = directoryService.getRegistries();
@@ -549,8 +550,9 @@
 
 
     @Override
-    public void setRegistries( Registries registries ) throws Exception
+    public void setRegistries( Registries registries )
     {
+        super.setRegistries( registries );
         wrappedPartition.setRegistries( registries );
     }
 
@@ -602,14 +604,6 @@
 
 
     @Override
-    public int getCacheSize()
-    {
-        // TODO Auto-generated method stub
-        return super.getCacheSize();
-    }
-
-
-    @Override
     public String getId()
     {
         // TODO Auto-generated method stub
@@ -643,5 +637,4 @@
     {
         this.ldifScanInterval = ldifScanInterval;
     }
-    
 }
\ No newline at end of file

Modified: directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java (original)
+++ directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java Fri Sep  4 20:40:08 2009
@@ -25,6 +25,8 @@
 import java.util.Properties;
 
 import org.apache.commons.cli.CommandLine;
+import org.apache.directory.daemon.InstallLayout;
+import org.apache.directory.daemon.InstanceLayout;
 
 
 /**
@@ -92,17 +94,10 @@
         cmd.setDebugEnabled( cmdline.hasOption( 'd' ) );
         cmd.setVerboseEnabled( cmdline.hasOption( 'v' ) );
         cmd.setVersion( tools.getProductVersion() );
+        
         if ( cmdline.getOptionValue( 'i' ) != null )
         {
             cmd.setLayout( cmdline.getOptionValue( 'i' ) );
-//            if ( !cmd.isQuietEnabled() )
-//            {
-//                System.out.println( "loading settings from: " + cmd.getLayout().getConfigurationFile() );
-//            }
-//            ApplicationContext factory = null;
-//            URL configUrl = cmd.getLayout().getConfigurationFile().toURL();
-//            factory = new FileSystemXmlApplicationContext( configUrl.toString() );
-//            cmd.setApacheDS( ( ApacheDS ) factory.getBean( "apacheDS" ) );
         }
         else if ( cmdline.hasOption( 'c' ) )
         {
@@ -112,7 +107,7 @@
 
         if ( cmdline.getOptionValue( 'z' ) != null )
         {
-            cmd.setInstanceLayout( new InstanceLayout( new File( cmdline.getOptionValue( 'z' ) ) ) );
+            cmd.setInstanceLayout( new InstanceLayout( cmd.getLayout(), new File( cmdline.getOptionValue( 'z' ) ) ) );
         }
         
         cmd.execute( cmdline );

Modified: directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java (original)
+++ directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java Fri Sep  4 20:40:08 2009
@@ -124,7 +124,7 @@
         // --------------------------------------------------------------------
 
         // If not present then we need to abort 
-        File schemaDirectory = new File( getLayout().getPartitionsDirectory(), "schema" );
+        File schemaDirectory = new File( getInstanceLayout().getPartitionsDir(), "schema" );
 
         if ( !schemaDirectory.exists() )
         {
@@ -180,7 +180,7 @@
 
         for ( String partition:partitions )
         {
-            File partitionDirectory = new File( getLayout().getPartitionsDirectory(), partition );
+            File partitionDirectory = new File( getInstanceLayout().getPartitionsDir(), partition );
             out.println( "\n\n" );
             dump( partitionDirectory, out );
         }

Modified: directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java (original)
+++ directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/ToolCommand.java Fri Sep  4 20:40:08 2009
@@ -24,7 +24,8 @@
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Options;
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstallLayout;
+import org.apache.directory.daemon.InstanceLayout;
 import org.apache.directory.server.configuration.ApacheDS;
 
 
@@ -41,7 +42,7 @@
     private boolean verboseEnabled = false;
     private boolean quietEnabled = false;
     private String version;
-    private InstallationLayout layout;
+    private InstallLayout layout;
     private ApacheDS apacheDS;
 
     private InstanceLayout instanceLayout;
@@ -66,17 +67,17 @@
 
     public void setLayout( File installationDirectory )
     {
-        this.layout = new InstallationLayout( installationDirectory );
+        this.layout = new InstallLayout( installationDirectory );
     }
 
 
     public void setLayout( String installationPath )
     {
-        this.layout = new InstallationLayout( installationPath );
+        this.layout = new InstallLayout( new File( installationPath ) );
     }
 
 
-    public void setLayout( InstallationLayout layout )
+    public void setLayout( InstallLayout layout )
     {
         this.layout = layout;
     }
@@ -94,7 +95,7 @@
     }
 
 
-    public InstallationLayout getLayout()
+    public InstallLayout getLayout()
     {
         return layout;
     }

Modified: directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java (original)
+++ directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/Bootstrapper.java Fri Sep  4 20:40:08 2009
@@ -67,7 +67,7 @@
     /** Random number generator */
     private Random random;
 
-    private InstallationLayout layout;
+    private InstanceLayout layout;
     private ClassLoader application;
     private ClassLoader parent;
     private String startClassName;
@@ -80,11 +80,12 @@
     public void setInstallationLayout( String installationBase )
     {
         log.debug( "Setting layout in Bootstrapper using base: " + installationBase );
-        layout = new InstallationLayout( installationBase );
+        File instanceHome = new File( System.getProperty( "INSTANCE_HOME" ) );
+        layout = new InstanceLayout( new InstallLayout( new File( installationBase ) ), instanceHome );
 
         try
         {
-            layout.verifyInstallation();
+            layout.verifyLayout();
         }
         catch ( Throwable t )
         {
@@ -94,13 +95,13 @@
         try
         {
             Properties props = new Properties();
-            props.load( new FileInputStream( layout.getBootstrapperConfigurationFile() ) );
+            props.load( new FileInputStream( layout.getInstallLayout().getBootstrapperConfigurationFile() ) );
             startClassName = props.getProperty( START_CLASS_PROP );
             stopClassName = props.getProperty( STOP_CLASS_PROP );
         }
         catch ( Exception e )
         {
-            log.error( "Failed while loading: " + layout.getBootstrapperConfigurationFile(), e );
+            log.error( "Failed while loading: " + layout.getInstallLayout().getBootstrapperConfigurationFile(), e );
             System.exit( ExitCodes.PROPLOAD );
         }
     }
@@ -109,7 +110,7 @@
     public void setParentLoader( ClassLoader parentLoader )
     {
         this.parent = parentLoader;
-        URL[] jars = layout.getAllJars();
+        URL[] jars = layout.getInstallLayout().getAllJars();
         this.application = new URLClassLoader( jars, parentLoader );
 
         if ( log.isDebugEnabled() )
@@ -155,7 +156,7 @@
         }
         catch ( Exception e )
         {
-            log.error( "Failed on " + startClassName + ".init(InstallationLayout, String[])", e );
+            log.error( "Failed on " + startClassName + ".init(InstallLayout, String[])", e );
             System.exit( ExitCodes.INITIALIZATION );
         }
         Thread.currentThread().setContextClassLoader( parent );
@@ -232,7 +233,7 @@
 
         if ( shutdownPort == -1 )
         {
-            File shutdownPortFile = new File( layout.getRunDirectory(), SHUTDOWN_FILE );
+            File shutdownPortFile = new File( layout.getRunDir(), SHUTDOWN_FILE );
             if ( shutdownPortFile.exists() )
             {
                 BufferedReader in = new BufferedReader( new FileReader( shutdownPortFile ) );
@@ -279,7 +280,7 @@
         try
         {
             shutdownPort = AvailablePortFinder.getNextAvailable( 30003 );
-            File shutdownPortFile = new File( layout.getRunDirectory(), SHUTDOWN_FILE );
+            File shutdownPortFile = new File( layout.getRunDir(), SHUTDOWN_FILE );
             if ( shutdownPortFile.exists() )
             {
                 String msg = "Shutdown port file " + shutdownPortFile + " exists. ";
@@ -298,7 +299,7 @@
             {
                 public void run()
                 {
-                    File shutdownPortFile = new File( layout.getRunDirectory(), SHUTDOWN_FILE );
+                    File shutdownPortFile = new File( layout.getRunDir(), SHUTDOWN_FILE );
                     if ( shutdownPortFile.exists() )
                     {
                         shutdownPortFile.delete();
@@ -416,7 +417,7 @@
             log.debug( "Failed on socket close", e );
         }
 
-        File shutdownPortFile = new File( layout.getRunDirectory(), SHUTDOWN_FILE );
+        File shutdownPortFile = new File( layout.getRunDir(), SHUTDOWN_FILE );
         if ( shutdownPortFile.exists() )
         {
             shutdownPortFile.delete();

Modified: directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/DaemonApplication.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/DaemonApplication.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/DaemonApplication.java (original)
+++ directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/DaemonApplication.java Fri Sep  4 20:40:08 2009
@@ -35,7 +35,7 @@
      * @param args the shifted arguments after the installation home path and 
      * the command arguments are removed
      */
-    void init( InstallationLayout layout, String[] args ) throws Exception;
+    void init( InstanceLayout layout, String[] args ) throws Exception;
 
 
     /**

Copied: directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallLayout.java (from r811352, directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java)
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallLayout.java?p2=directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallLayout.java&p1=directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java&r1=811352&r2=811541&rev=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallationLayout.java (original)
+++ directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstallLayout.java Fri Sep  4 20:40:08 2009
@@ -36,13 +36,10 @@
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
-public class InstallationLayout
+public class InstallLayout
 {
-    private final static Logger log = LoggerFactory.getLogger( InstallationLayout.class );
+    private final static Logger log = LoggerFactory.getLogger( InstallLayout.class );
     private final static FileFilter JAR_FILTER;
-    public static final String VAR_DIR = "apacheds.var.dir";
-    public static final String LOG_DIR = "apacheds.log.dir";
-    public static final String RUN_DIR = "apacheds.run.dir";
 
     static
     {
@@ -55,7 +52,7 @@
         };
     }
 
-    protected final File baseDirectory;
+    protected final File installHomeDir;
     private transient File[] dirs;
     private transient File[] files;
     private transient URL[] allJars = null;
@@ -63,78 +60,27 @@
     private transient URL[] extensionJars = null;
 
 
-    public InstallationLayout( File baseDirectory )
+    public InstallLayout( File installHomeDir )
     {
-        this.baseDirectory = baseDirectory;
+        this.installHomeDir = installHomeDir;
     }
 
 
-    public InstallationLayout( String baseDirectoryPath )
+    public File getInstallHomeDir()
     {
-        this.baseDirectory = new File( baseDirectoryPath );
-    }
-
-
-    public File getBaseDirectory()
-    {
-        return baseDirectory;
+        return installHomeDir;
     }
 
 
     public File getBinDirectory()
     {
-        return new File( baseDirectory, "bin" );
+        return new File( installHomeDir, "bin" );
     }
 
 
     public File getLibDirectory()
     {
-        return new File( baseDirectory, "lib" );
-    }
-
-
-    public File getVarDirectory()
-    {
-        String varDir = System.getProperty( VAR_DIR );
-
-        if ( varDir != null )
-        {
-            return new File( varDir );
-        }
-        
-        return new File( baseDirectory, "var" );
-    }
-
-
-    public File getLogDirectory()
-    {
-        String logDir = System.getProperty( LOG_DIR );
-
-        if ( logDir != null)
-        {
-            return new File( logDir );
-        }
-
-        return new File( getVarDirectory(), "log" );
-    }
-
-
-    public File getRunDirectory()
-    {
-        String runDir = System.getProperty( RUN_DIR );
-
-        if ( runDir != null )
-        {
-            return new File( runDir );
-        }
-
-        return new File( getVarDirectory(), "run" );
-    }
-
-
-    public File getPidFile()
-    {
-        return new File( getRunDirectory(), "server.pid" );
+        return new File( installHomeDir, "lib" );
     }
 
 
@@ -174,15 +120,9 @@
     }
 
 
-    public File getPartitionsDirectory()
-    {
-        return new File( getVarDirectory(), "partitions" );
-    }
-
-
     public File getConfigurationDirectory()
     {
-        return new File( baseDirectory, "conf" );
+        return new File( installHomeDir, "conf" );
     }
 
 
@@ -198,18 +138,6 @@
     }
 
 
-    public File getLoggerConfigurationFile()
-    {
-        return getLoggerConfigurationFile( "log4j.properties" );
-    }
-
-
-    public File getLoggerConfigurationFile( String name )
-    {
-        return new File( getConfigurationDirectory(), name );
-    }
-
-
     public File getLogoIconFile()
     {
         return getLogoIconFile( "logo.ico" );
@@ -218,7 +146,7 @@
 
     public File getLogoIconFile( String name )
     {
-        return new File( getBaseDirectory(), name );
+        return new File( getInstallHomeDir(), name );
     }
 
 
@@ -230,7 +158,7 @@
 
     public File getLicenseFile( String name )
     {
-        return new File( getBaseDirectory(), name );
+        return new File( getInstallHomeDir(), name );
     }
 
 
@@ -242,7 +170,7 @@
 
     public File getReadmeFile( String name )
     {
-        return new File( getBaseDirectory(), name );
+        return new File( getInstallHomeDir(), name );
     }
 
 
@@ -252,21 +180,23 @@
     }
 
 
+    public File getLoggerConfigurationFile()
+    {
+        return new File( getConfigurationDirectory(), "log4j.properties" );
+    }
+
+
     public void init()
     {
         if ( dirs == null )
         {
             dirs = new File[]
                 { 
-                getBaseDirectory(), 
+                getInstallHomeDir(), 
                 getBinDirectory(), 
                 getLibDirectory(),
                 getExtensionsDirectory(), 
                 getConfigurationDirectory(), 
-                getVarDirectory(),
-                getLogDirectory(), 
-                getPartitionsDirectory(), 
-                getRunDirectory() 
                 };
         }
 

Copied: directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstanceLayout.java (from r811351, directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/InstanceLayout.java)
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstanceLayout.java?p2=directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstanceLayout.java&p1=directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/InstanceLayout.java&r1=811351&r2=811541&rev=811541&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-schema/server-tools/src/main/java/org/apache/directory/server/tools/InstanceLayout.java (original)
+++ directory/daemon/branches/daemon-schema/bootstrappers/src/main/java/org/apache/directory/daemon/InstanceLayout.java Fri Sep  4 20:40:08 2009
@@ -17,8 +17,7 @@
  *   under the License.
  *
  */
-
-package org.apache.directory.server.tools;
+package org.apache.directory.daemon;
 
 
 import java.io.File;
@@ -28,7 +27,18 @@
 
 
 /**
- * TODO InstanceLayout.
+ * ApacheDS allows the same installation to support multiple instances of the
+ * server.  This requires ApacheDS software installations to be kept separate
+ * from ApacheDS instance folders.  To follow OS conventions, sometimes the
+ * instances root is not kept under the installation home directory.  Even 
+ * worse sometimes the log, run and var directories of instances are 
+ * distributed across the file system without subordinating to the same 
+ * instance home directory.
+ * 
+ * This bean tracks the installation it's associated with using a contained
+ * InstallLayout bean, and leverages that along with additional information 
+ * from the how it is created and the system properties to determine what the
+ * instance's layout looks like.
  *
  *       ${ads-instance-name}
  *       |-- conf
@@ -45,9 +55,46 @@
  */
 public class InstanceLayout
 {
-    /** the installation instance's base directory */
-    private final File instanceRoot;
+    /** the name of the server process id file */
+    private static final String SERVER_PIDFILE = "server.pid";
+
+    /** system property for var directory override */
+    public static final String VAR_DIR_KEY = "apacheds.var.dir";
+    
+    /** system property for log directory override */
+    public static final String LOG_DIR_KEY = "apacheds.log.dir";
+    
+    /** system property for run directory override */
+    public static final String RUN_DIR_KEY = "apacheds.run.dir";
+ 
+    /** the name of the instances directory */
+    public static final String INSTANCES_DIRNAME = "instances";
+    
+    /** the name of the configuration directory */
+    public static final String CONF_DIRNAME = "conf";
+    
+    /** the name of the var directory */
+    public static final String VAR_DIRNAME = "var";
+    
+    /** the name of the var directory */
+    public static final String PARTITION_DIRNAME = "partitions";
+    
+    /** the name of the log directory */
+    public static final String LOG_DIRNAME = "log";
+    
+    /** the name of the run directory */
+    public static final String RUN_DIRNAME = "run";
+    
+    /** the name of the instance */
+    private final String name;
+    
+    /** the instance's home directory */
+    private final File instanceDir;
+    
+    /** the installation layout */
+    private final InstallLayout installLayout;
 
+    
     /** a file system directory filter */
     private FileFilter dirFilter = new FileFilter()
     {
@@ -55,37 +102,148 @@
         {
             return pathname.isDirectory();
         }
-
     };
 
 
-    public InstanceLayout( File location )
+    /**
+     * Creates a new instance of InstanceLayout which uses a specific instance 
+     * location which may or may not be under the installation home directory's 
+     * instances directory.  The name is explicitly set regardless of what the
+     * instanceDir name is.
+     * 
+     * @param name the name of the instance if different from last path name
+     * @param installLayout the installation layout
+     * @param instanceDir the location of the instance home directory
+     */
+    public InstanceLayout( String name, InstallLayout installLayout, File instanceDir )
     {
-        this.instanceRoot = location;
+        this.name = name;
+        this.instanceDir = instanceDir;
+        this.installLayout = installLayout;
     }
 
 
-    public InstanceLayout( String location )
+    /**
+     * Creates a new instance of InstanceLayout which uses a specific 
+     * instance location which may or may not be under the installation home 
+     * directory's instances directory.  The name of the instance is taken
+     * from the last path component of the instanceDir.
+     *
+     * @param installLayout the installation layout
+     * @param instanceDir the location of the instance home directory
+     */
+    public InstanceLayout( InstallLayout installLayout, File instanceDir )
     {
-        this.instanceRoot = new File( location );
+        this( instanceDir.getName(), installLayout, instanceDir );
     }
 
 
+    /**
+     * Creates a new instance of InstanceLayout which presumes the instances
+     * directory resides under the installation home directory and the 
+     * instance directory inside this instances directory is simply the name 
+     * of the instance.
+     * 
+     * @param name the name of the instance
+     * @param installLayout the installation layout
+     */
+    public InstanceLayout( String name, InstallLayout installLayout )
+    {
+        this.name = name;
+        this.installLayout = installLayout;
+        this.instanceDir = new File( installLayout.getInstallHomeDir(), INSTANCES_DIRNAME );
+    }
+
+    
+    /**
+     * Get's the name of the instance.
+     *
+     * @return the name of the instance
+     */
+    public String getName()
+    {
+        return name;
+    }
+    
+
+    /**
+     * Get's the partitions directory for this InstanceLayout.
+     *
+     * @return the partitions directory for this IntanceLayout
+     */
     public File getPartitionsDir()
     {
-        return new File( instanceRoot, "partitions" );
+        return new File( getVarDir(), PARTITION_DIRNAME );
+    }
+    
+    
+    /**
+     * Get's the var directory for this InstanceLayout.
+     *
+     * @return the var directory for this IntanceLayout
+     */
+    public File getVarDir()
+    {
+        if ( System.getProperty( VAR_DIR_KEY ) == null )
+        {
+            return new File( instanceDir, VAR_DIRNAME );
+        }
+        
+        return new File( System.getProperty( VAR_DIR_KEY ) );
     }
 
 
+    /**
+     * Get's the log directory for this InstanceLayout.
+     *
+     * @return the log directory for this IntanceLayout
+     */
     public File getLogDir()
     {
-        return new File( instanceRoot, "log" );
+        if ( System.getProperty( LOG_DIR_KEY ) == null )
+        {
+            return new File( instanceDir, LOG_DIRNAME );
+        }
+        
+        return new File( System.getProperty( LOG_DIR_KEY ) );
     }
 
 
+    /**
+     * Get's the conf directory for this InstanceLayout.
+     *
+     * @return the conf directory for this IntanceLayout
+     */
     public File getConfDir()
     {
-        return new File( instanceRoot, "conf" );
+        return new File( instanceDir, CONF_DIRNAME );
+    }
+
+
+    /**
+     * Get's the run directory for this InstanceLayout.
+     *
+     * @return the run directory for this IntanceLayout
+     */
+    public File getRunDir()
+    {
+        if ( System.getProperty( RUN_DIR_KEY ) == null )
+        {
+            return new File( instanceDir, RUN_DIRNAME );
+        }
+        
+        return new File( System.getProperty( RUN_DIR_KEY ) );
+    }
+    
+    
+    /**
+     * Gets the installation layout bean for this InstanceLayout.
+     *
+     * @return the {@link InstallLayout} for this InstanceLayout
+     */
+    public InstallLayout getInstallLayout()
+    {
+        return this.installLayout;
     }
 
 
@@ -93,7 +251,38 @@
      * returns a list of partition directories
      * @return list of partition directories
      */
-    public List<File> getPartitions()
+    public List<File> getAllPartitions()
+    {
+        List<File> partitions = new ArrayList<File>();
+
+        File[] dirs = getPartitionsDir().listFiles( dirFilter );
+
+        for ( File f : dirs )
+        {
+            partitions.add( f );
+        }
+
+        return partitions;
+    }
+
+
+    public File getPidFile()
+    {
+        return new File( getRunDir(), SERVER_PIDFILE );
+    }
+    
+    
+    public void verifyLayout()
+    {
+        installLayout.verifyInstallation();
+    }
+
+
+    /**
+     * returns a list of jdbm partition directories
+     * @return list of partition directories
+     */
+    public List<File> getJdbmPartitions()
     {
         List<File> partitions = new ArrayList<File>();
 

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java Fri Sep  4 20:40:08 2009
@@ -24,7 +24,7 @@
 import java.io.IOException;
 import java.util.Properties;
 
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstallLayout;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.codehaus.plexus.util.FileUtils;
@@ -40,7 +40,7 @@
 {
     private final Properties filterProperties = new Properties( System.getProperties() );
     private final Target target;
-    private InstallationLayout layout;
+    private InstallLayout layout;
 
 
     public CreateImageCommand( ServiceInstallersMojo mojo, Target target )
@@ -81,7 +81,7 @@
         // make the layout directories
         log.info( "Creating image ... " );
         File dir = new File( mymojo.getOutputDirectory(), target.getId() );
-        layout = new InstallationLayout( dir );
+        layout = new InstallLayout( dir );
         target.setLayout( layout );
         layout.mkdirs();
 
@@ -379,7 +379,7 @@
 
         if ( target.getSourcesDirectory() != null )
         {
-            File sourcesDirectory = new File( layout.getBaseDirectory(), target.getSourcesTargetPath() );
+            File sourcesDirectory = new File( layout.getInstallHomeDir(), target.getSourcesTargetPath() );
             try
             {
                 FileUtils.copyDirectoryStructure( target.getSourcesDirectory(), sourcesDirectory );
@@ -395,7 +395,7 @@
 
         if ( target.getDocsDirectory() != null )
         {
-            File docsDirectory = new File( layout.getBaseDirectory(), target.getDocsTargetPath() );
+            File docsDirectory = new File( layout.getInstallHomeDir(), target.getDocsTargetPath() );
             try
             {
                 FileUtils.copyDirectoryStructure( target.getDocsDirectory(), docsDirectory );
@@ -409,7 +409,7 @@
 
         // -- if present copy the NOTICE.txt file --
 
-        File noticeFileTarget = new File( layout.getBaseDirectory(), "NOTICE.txt" );
+        File noticeFileTarget = new File( layout.getInstallHomeDir(), "NOTICE.txt" );
         File noticeFile = new File( "NOTICE.txt" );
         if ( noticeFile.exists() )
         {

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoCommand.java Fri Sep  4 20:40:08 2009
@@ -135,7 +135,7 @@
                 
                 if ( packagedFiles[ii].isExpandable() )
                 {
-                    File dest = new File( target.getLayout().getBaseDirectory(), packagedFiles[ii].getDestinationPath() );
+                    File dest = new File( target.getLayout().getInstallHomeDir(), packagedFiles[ii].getDestinationPath() );
                     if ( ! dest.exists() )
                     {
                         dest.mkdirs();
@@ -165,7 +165,7 @@
                         + ". It does not have a jar, war or zip extension" );
                 }
                 
-                File dest = new File( target.getLayout().getBaseDirectory(), packagedFiles[ii].getDestinationPath() );
+                File dest = new File( target.getLayout().getInstallHomeDir(), packagedFiles[ii].getDestinationPath() );
                 
                 if ( packagedFiles[ii].isDirectory() )
                 {

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/MojoHelperUtils.java Fri Sep  4 20:40:08 2009
@@ -36,7 +36,7 @@
 import java.util.List;
 import java.util.Properties;
 
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstallLayout;
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.tools.ant.taskdefs.Execute;
@@ -128,7 +128,7 @@
     }
 
 
-    public static List copyDependencies( ServiceInstallersMojo mymojo, InstallationLayout layout )
+    public static List copyDependencies( ServiceInstallersMojo mymojo, InstallLayout layout )
         throws MojoFailureException
     {
         List<Artifact> libArtifacts = new ArrayList<Artifact>();

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/Target.java Fri Sep  4 20:40:08 2009
@@ -24,7 +24,7 @@
 import java.util.List;
 import java.util.Locale;
 
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstallLayout;
 
 
 /**
@@ -78,7 +78,7 @@
     private String docsTargetPath;
     private File scriptFile;
 
-    private InstallationLayout layout;
+    private InstallLayout layout;
     private List libArtifacts;
 
     private Application application;
@@ -210,13 +210,13 @@
     }
 
 
-    public void setLayout( InstallationLayout layout )
+    public void setLayout( InstallLayout layout )
     {
         this.layout = layout;
     }
 
 
-    public InstallationLayout getLayout()
+    public InstallLayout getLayout()
     {
         return layout;
     }

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/archive/ArchiveInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/archive/ArchiveInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/archive/ArchiveInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/archive/ArchiveInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -101,7 +101,7 @@
             return;
         }
 
-        File baseDirectory = target.getLayout().getBaseDirectory();
+        File baseDirectory = target.getLayout().getInstallHomeDir();
         File imagesDirectory = baseDirectory.getParentFile();
 
         log.info( "Creating Archive Installer..." );

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/bin/BinInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -98,7 +98,7 @@
             return;
         }
 
-        File baseDirectory = target.getLayout().getBaseDirectory();
+        File baseDirectory = target.getLayout().getInstallHomeDir();
         File imagesDirectory = baseDirectory.getParentFile();
 
         log.info( "Creating Bin Installer..." );
@@ -120,7 +120,7 @@
         catch ( IOException e )
         {
             log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getBaseDirectory()
+            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getInstallHomeDir()
                 + ") to the Bin directory (" + binRootFolderDirectory + ")" );
         }
 

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/deb/DebInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -98,7 +98,7 @@
             dpkgUtility = target.getDpkgUtility();
         }
 
-        File baseDirectory = target.getLayout().getBaseDirectory();
+        File baseDirectory = target.getLayout().getInstallHomeDir();
         File imagesDirectory = baseDirectory.getParentFile();
 
         log.info( "Creating Debian DEB Package..." );
@@ -123,7 +123,7 @@
         catch ( IOException e )
         {
             log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getBaseDirectory()
+            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getInstallHomeDir()
                 + ") to the DEB directory (" + debApacheDsHomeDirectory + ")" );
         }
 

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/inno/InnoInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -64,7 +64,7 @@
         super( mymojo );
         this.target = target;
         this.log = mymojo.getLog();
-        File imagesDir = target.getLayout().getBaseDirectory().getParentFile();
+        File imagesDir = target.getLayout().getInstallHomeDir().getParentFile();
         innoConfigurationFile = new File( imagesDir, target.getId() + ".iss" );
         initializeFiltering();
     }
@@ -247,7 +247,7 @@
             { innoCompiler.getAbsolutePath(), innoConfigurationFile.getAbsolutePath() };
         task.setCommandline( cmd );
         task.setSpawn( true );
-        task.setWorkingDirectory( target.getLayout().getBaseDirectory() );
+        task.setWorkingDirectory( target.getLayout().getInstallHomeDir() );
         try
         {
             task.execute();
@@ -326,9 +326,9 @@
         filterProperties.put( "app.readme.name", target.getLayout().getReadmeFile().getName() );
         filterProperties.put( "app.icon", target.getLayout().getLogoIconFile().getPath() );
         filterProperties.put( "app.icon.name", target.getLayout().getLogoIconFile().getName() );
-        filterProperties.put( "image.basedir", target.getLayout().getBaseDirectory().getPath() );
+        filterProperties.put( "image.basedir", target.getLayout().getInstallHomeDir().getPath() );
         filterProperties.put( "app.lib.jars", getApplicationLibraryJars() );
-        filterProperties.put( "installer.output.directory", target.getLayout().getBaseDirectory().getParent() );
+        filterProperties.put( "installer.output.directory", target.getLayout().getInstallHomeDir().getParent() );
 
         if ( target.getDocsDirectory() != null )
         {
@@ -348,7 +348,7 @@
             filterProperties.put( "sources.directive", "" );
         }
 
-        File noticeFile = new File( target.getLayout().getBaseDirectory(), "NOTICE.txt" );
+        File noticeFile = new File( target.getLayout().getInstallHomeDir(), "NOTICE.txt" );
         if ( noticeFile.exists() )
         {
             filterProperties.put( "notice.file", "Source: {#SourceBase}\\NOTICE.txt; DestDir: "

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/izpack/IzPackInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -24,7 +24,7 @@
 import java.io.IOException;
 import java.util.Properties;
 
-import org.apache.directory.daemon.InstallationLayout;
+import org.apache.directory.daemon.InstallLayout;
 import org.apache.directory.daemon.installers.MojoCommand;
 import org.apache.directory.daemon.installers.MojoHelperUtils;
 import org.apache.directory.daemon.installers.ServiceInstallersMojo;
@@ -53,7 +53,7 @@
 
     private final Properties filterProperties = new Properties( System.getProperties() );
     private final IzPackTarget target;
-    private final InstallationLayout layout;
+    private final InstallLayout layout;
 
     private File izPackInput;
     private File izPackUserInput;
@@ -69,7 +69,7 @@
         super( mymojo );
         this.target = target;
         this.layout = target.getLayout();
-        File imageDir = layout.getBaseDirectory().getParentFile();
+        File imageDir = layout.getInstallHomeDir().getParentFile();
         izPackBase = new File( imageDir, target.getId() );
 
         if ( target.getFinalName() != null )
@@ -451,7 +451,7 @@
             filterProperties.put( "unix.shortcuts", izPackUnixShortcuts.getPath() );
         }
         filterProperties.put( "user.input", izPackUserInput.getPath() );
-        filterProperties.put( "image.basedir", layout.getBaseDirectory().getPath() );
+        filterProperties.put( "image.basedir", layout.getInstallHomeDir().getPath() );
 
         if ( target.getOsFamily().equals( "mac" ) || target.getOsFamily().equals( "unix" ) )
         {

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -110,7 +110,7 @@
             return;
         }
 
-        File baseDirectory = target.getLayout().getBaseDirectory();
+        File baseDirectory = target.getLayout().getInstallHomeDir();
         File imagesDirectory = baseDirectory.getParentFile();
 
         log.info( "Creating Mac OS X PKG Installer..." );
@@ -185,7 +185,7 @@
         catch ( IOException e )
         {
             log.error( e.getMessage() );
-            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getBaseDirectory()
+            throw new MojoFailureException( "Failed to copy image (" + target.getLayout().getInstallHomeDir()
                 + ") to the PKG directory (" + pkgRootDirectory + ")" );
         }
 

Modified: directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java?rev=811541&r1=811540&r2=811541&view=diff
==============================================================================
--- directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java (original)
+++ directory/daemon/branches/daemon-schema/plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java Fri Sep  4 20:40:08 2009
@@ -59,7 +59,7 @@
         super( mymojo );
         this.target = target;
         this.log = mymojo.getLog();
-        File imagesDir = target.getLayout().getBaseDirectory().getParentFile();
+        File imagesDir = target.getLayout().getInstallHomeDir().getParentFile();
         nsisConfigurationFile = new File( imagesDir, target.getId() + ".nsi" );
         initializeFiltering();
     }
@@ -204,7 +204,7 @@
             { nsisCompiler.getAbsolutePath(), nsisConfigurationFile.getAbsolutePath() };
         task.setCommandline( cmd );
         task.setSpawn( true );
-        task.setWorkingDirectory( target.getLayout().getBaseDirectory() );
+        task.setWorkingDirectory( target.getLayout().getInstallHomeDir() );
         try
         {
             task.execute();
@@ -284,9 +284,9 @@
         filterProperties.put( "app.readme.name", target.getLayout().getReadmeFile().getName() );
         filterProperties.put( "app.icon", target.getLayout().getLogoIconFile().getPath() );
         filterProperties.put( "app.icon.name", target.getLayout().getLogoIconFile().getName() );
-        filterProperties.put( "image.basedir", target.getLayout().getBaseDirectory().getPath() );
+        filterProperties.put( "image.basedir", target.getLayout().getInstallHomeDir().getPath() );
         filterProperties.put( "app.lib.jars", getApplicationLibraryJars() );
-        filterProperties.put( "installer.output.directory", target.getLayout().getBaseDirectory().getParent() );
+        filterProperties.put( "installer.output.directory", target.getLayout().getInstallHomeDir().getParent() );
 
         if ( target.getDocsDirectory() != null )
         {
@@ -306,7 +306,7 @@
             filterProperties.put( "sources.directive", "" );
         }
 
-        File noticeFile = new File( target.getLayout().getBaseDirectory(), "NOTICE.txt" );
+        File noticeFile = new File( target.getLayout().getInstallHomeDir(), "NOTICE.txt" );
         if ( noticeFile.exists() )
         {
             filterProperties.put( "notice.file", "Source: {#SourceBase}\\NOTICE.txt; DestDir: "



Mime
View raw message