You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tr...@apache.org on 2005/06/20 14:58:38 UTC

svn commit: r191459 - in /directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server: authz/ interceptor/ jndi/ partition/ partition/store/ partition/store/impl/btree/jdbm/ schema/

Author: trustin
Date: Mon Jun 20 05:58:35 2005
New Revision: 191459

URL: http://svn.apache.org/viewcvs?rev=191459&view=rev
Log:
* Added PartitionStore.open()
* Moved initialization code in the constructor of JdbmPartitionStore to open() method.

Added:
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/SystemPartition.java
      - copied, changed from r191456, directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/SystemPartition.java
Removed:
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/SystemPartition.java
Modified:
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorContext.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/ContextFactoryConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryConfiguration.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/RootNexusProxy.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/AbstractContextPartition.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/BackingStore.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/RootNexus.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/PartitionStore.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmIndex.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmPartitionStore.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalAttributeTypeRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalComparatorRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitContentRuleRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitStructureRuleRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleUseRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNameFormRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNormalizerRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalObjectClassRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalRegistries.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxCheckerRegistry.java
    directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxRegistry.java

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/authz/AuthorizationService.java Mon Jun 20 05:58:35 2005
@@ -43,8 +43,8 @@
 import org.apache.ldap.server.invocation.MoveAndModifyRN;
 import org.apache.ldap.server.invocation.Search;
 import org.apache.ldap.server.jndi.ServerContext;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.partition.BackingStore;
-import org.apache.ldap.server.partition.SystemPartition;
 import org.apache.ldap.server.partition.store.ResultFilteringEnumeration;
 import org.apache.ldap.server.partition.store.SearchResultFilter;
 import org.apache.ldap.server.schema.AttributeTypeRegistry;

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorContext.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorContext.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorContext.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/interceptor/InterceptorContext.java Mon Jun 20 05:58:35 2005
@@ -2,8 +2,8 @@
 
 
 import org.apache.ldap.server.configuration.StartupConfiguration;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.partition.RootNexus;
-import org.apache.ldap.server.partition.SystemPartition;
 import org.apache.ldap.server.schema.GlobalRegistries;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/ContextFactoryConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/ContextFactoryConfiguration.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/ContextFactoryConfiguration.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/ContextFactoryConfiguration.java Mon Jun 20 05:58:35 2005
@@ -24,7 +24,6 @@
 import org.apache.ldap.server.configuration.StartupConfiguration;
 import org.apache.ldap.server.invocation.Invocation;
 import org.apache.ldap.server.partition.RootNexus;
-import org.apache.ldap.server.partition.SystemPartition;
 import org.apache.ldap.server.schema.GlobalRegistries;
 
 /** FIXME Rename to ContextFactoryContext */

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryConfiguration.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryConfiguration.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/DefaultContextFactoryConfiguration.java Mon Jun 20 05:58:35 2005
@@ -48,7 +48,6 @@
 import org.apache.ldap.server.partition.ContextPartition;
 import org.apache.ldap.server.partition.PartitionNexus;
 import org.apache.ldap.server.partition.RootNexus;
-import org.apache.ldap.server.partition.SystemPartition;
 import org.apache.ldap.server.partition.store.DefaultSearchEngine;
 import org.apache.ldap.server.partition.store.ExpressionEnumerator;
 import org.apache.ldap.server.partition.store.ExpressionEvaluator;

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/RootNexusProxy.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/RootNexusProxy.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/RootNexusProxy.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/RootNexusProxy.java Mon Jun 20 05:58:35 2005
@@ -140,7 +140,7 @@
         this.provider.shutdown();
     }
 
-    public boolean isClosed() {
-        return this.provider.getRootNexus().isClosed();
+    public boolean isOpen() {
+        return this.provider.getRootNexus().isOpen();
     }
 }

Copied: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/SystemPartition.java (from r191456, directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/SystemPartition.java)
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/SystemPartition.java?p2=directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/SystemPartition.java&p1=directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/SystemPartition.java&r1=191456&r2=191459&rev=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/SystemPartition.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/jndi/SystemPartition.java Mon Jun 20 05:58:35 2005
@@ -14,7 +14,7 @@
  *   limitations under the License.
  *
  */
-package org.apache.ldap.server.partition;
+package org.apache.ldap.server.jndi;
 
 import javax.naming.InvalidNameException;
 import javax.naming.Name;
@@ -26,6 +26,7 @@
 import org.apache.ldap.common.schema.AttributeType;
 import org.apache.ldap.common.util.DateUtils;
 import org.apache.ldap.common.util.NamespaceTools;
+import org.apache.ldap.server.partition.AbstractContextPartition;
 import org.apache.ldap.server.partition.store.PartitionStore;
 import org.apache.ldap.server.partition.store.SearchEngine;
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/AbstractContextPartition.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/AbstractContextPartition.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/AbstractContextPartition.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/AbstractContextPartition.java Mon Jun 20 05:58:35 2005
@@ -391,9 +391,9 @@
     }
 
 
-    public boolean isClosed()
+    public boolean isOpen()
     {
-        return db.isClosed();
+        return db.isOpen();
     }
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/BackingStore.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/BackingStore.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/BackingStore.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/BackingStore.java Mon Jun 20 05:58:35 2005
@@ -230,12 +230,9 @@
     void close() throws NamingException;
 
     /**
-     * Checks to see if this BackingStore has been closed or shut down.
-     * Operations against closed BackingStores will fail.
-     *
-     * @return true if shut down, false otherwise
+     * Checks to see if this store is open or closed.
      */
-    boolean isClosed();
+    boolean isOpen();
 }
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/RootNexus.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/RootNexus.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/RootNexus.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/RootNexus.java Mon Jun 20 05:58:35 2005
@@ -42,6 +42,7 @@
 import org.apache.ldap.common.message.LockableAttributes;
 import org.apache.ldap.common.message.LockableAttributesImpl;
 import org.apache.ldap.common.util.SingletonEnumeration;
+import org.apache.ldap.server.jndi.SystemPartition;
 
                                 
 /**
@@ -63,7 +64,7 @@
     private static final String NAMINGCTXS_ATTR = "namingContexts";
 
     /** the closed state of this partition */
-    private boolean closed = false;
+    private boolean open = true;
 
     /** the system backend */
     private SystemPartition system;
@@ -492,12 +493,9 @@
     }
 
 
-    /**
-     * @see ContextPartition#isClosed()
-     */
-    public boolean isClosed()
+    public boolean isOpen()
     {
-        return closed;
+        return open;
     }
 
 
@@ -506,7 +504,7 @@
      */
     public synchronized void close() throws NamingException
     {
-        if ( closed )
+        if ( !open )
         {
             return;
         }
@@ -540,7 +538,7 @@
             }
         }
 
-        closed = true;
+        open = false;
 
         if ( error != null )
         {

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/PartitionStore.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/PartitionStore.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/PartitionStore.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/PartitionStore.java Mon Jun 20 05:58:35 2005
@@ -40,6 +40,7 @@
     // @todo do these alias constants need to go elsewhere?
     /** The objectClass name for aliases: 'alias' */
     String ALIAS_OBJECT = "alias";
+
     /** 
      * The aliased Dn attribute name: aliasedObjectName for LDAP and
      * aliasedEntryName or X.500.
@@ -48,6 +49,36 @@
 
 
     // ------------------------------------------------------------------------
+    // Open / Close / Sync 
+    // ------------------------------------------------------------------------
+
+    /**
+     * Opens this store.
+     * 
+     * @throws NamingException
+     */
+    void open( Name userProvidedSuffix, Name normalizedSuffix ) throws NamingException;
+
+    /**
+     * TODO Document me!
+     *
+     * @throws NamingException TODO
+     */
+    void sync() throws NamingException;
+
+    /**
+     * TODO Document me!
+     *
+     * @throws NamingException TODO
+     */
+    void close() throws NamingException;
+
+    /**
+     * Checks to see if this store is open or closed.
+     */
+    boolean isOpen();
+    
+    // ------------------------------------------------------------------------
     // Index Operations 
     // ------------------------------------------------------------------------
 
@@ -318,28 +349,6 @@
      * @throws NamingException TODO
      */
     Attributes getSuffixEntry() throws NamingException;
-
-    /**
-     * TODO Document me!
-     *
-     * @throws NamingException TODO
-     */
-    void sync() throws NamingException;
-
-    /**
-     * TODO Document me!
-     *
-     * @throws NamingException TODO
-     */
-    void close() throws NamingException;
-
-    /**
-     * Checks to see if this BackingStore has been closed or shut down.
-     * Operations against closed BackingStores will fail.
-     *
-     * @return true if shut down, false otherwise
-     */
-    boolean isClosed();
 
     /**
      * TODO Document me!

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmIndex.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmIndex.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmIndex.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmIndex.java Mon Jun 20 05:58:35 2005
@@ -99,10 +99,10 @@
      * @param wkDirPath TODO
      * @throws NamingException TODO
      */
-    public JdbmIndex( AttributeType attribute, String wkDirPath )
+    public JdbmIndex( AttributeType attribute, File wkDirPath )
         throws NamingException
     {
-        File file = new File( wkDirPath + File.separator 
+        File file = new File( wkDirPath.getPath() + File.separator 
             + attribute.getName() );
         this.attribute = attribute;
         keyCache = new LRUMap( 1000 );

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmPartitionStore.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmPartitionStore.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmPartitionStore.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/partition/store/impl/btree/jdbm/JdbmPartitionStore.java Mon Jun 20 05:58:35 2005
@@ -64,22 +64,22 @@
 public class JdbmPartitionStore implements PartitionStore
 {
     /** the JDBM record manager used by this database */
-    private final RecordManager recMan;
+    private RecordManager recMan;
     /** the user provided suffix of this backend database */
-    private final Name upSuffix;
+    private Name upSuffix;
     /** the normalized suffix of this backend database */
-    private final Name normSuffix;
+    private Name normSuffix;
     /** the working directory to use for files */
-    private final String wkdir;
+    private File wkdir;
     /** the master table storing entries by primary key */
-    private final JdbmMasterTable master;
+    private JdbmMasterTable master;
     /** a map of attribute names to user indices */
-    private final Map indices;
+    private Map indices;
     /** a map of index names to system indices */
-    private final Map sysIndices;
+    private Map sysIndices;
 
-    /** the closed state of this Database */
-    private boolean closed = false;
+    /** true if open */
+    private boolean open;
 
     /** the normalized distinguished name index */
     private Index ndnIdx;
@@ -103,23 +103,30 @@
 
 
     /**
-     * Creates a Databased based on JDBM B+Trees.
-     *
-     * @param upSuffix the user provided suffix name
-     * @param normSuffix the normalized suffix name
-     * @param wkdirPath the path to the working directory where the db resides
-     * @throws NamingException if db cannot be created
-     */
-    public JdbmPartitionStore ( final Name upSuffix, final Name normSuffix, final String wkdirPath )
-        throws NamingException
-    {
-        this.upSuffix = upSuffix;
-        this.normSuffix = normSuffix;
-        this.wkdir = wkdirPath;
+     * Creates a store based on JDBM B+Trees.
+     */
+    public JdbmPartitionStore ()
+    {
+    }
+
+    public File getWorkingDirectory()
+    {
+        return wkdir;
+    }
+    
+    public void setWorkingDirectory( File workingDirectory )
+    {
+        this.wkdir = workingDirectory;
+    }
+    
+    public synchronized void open( Name userProviderSuffix, Name normalizedSuffix ) throws NamingException
+    {
+        this.upSuffix = userProviderSuffix;
+        this.normSuffix = normalizedSuffix;
 
         try 
         {
-            String path = wkdirPath + File.separator + "master";
+            String path = this.wkdir.getPath() + File.separator + "master";
             BaseRecordManager base = new BaseRecordManager( path );
             base.disableTransactions();
             recMan = new CacheRecordManager( base, new MRU( 1000 ) );
@@ -135,6 +142,180 @@
         master = new JdbmMasterTable( recMan );
         indices = new HashMap();
         sysIndices = new HashMap();
+        open = true;
+    }
+    
+    
+    public synchronized void close() throws NamingException
+    {
+        if ( !open )
+        {
+            return;
+        }
+
+        ArrayList array = new ArrayList();
+        array.addAll( indices.values() );
+        
+        if ( null != ndnIdx )
+        {
+            array.add( ndnIdx );
+        }
+        
+        if ( null != updnIdx )
+        {
+            array.add( updnIdx );
+        }
+
+        if ( null != aliasIdx )
+        {
+            array.add( aliasIdx );
+        }
+
+        if ( null != oneAliasIdx )
+        {
+            array.add( oneAliasIdx );
+        }
+
+        if ( null != subAliasIdx )
+        {
+            array.add( subAliasIdx );
+        }
+
+        if ( null != hierarchyIdx )
+        {
+            array.add( hierarchyIdx );
+        }
+
+        if ( null != existanceIdx )
+        {
+            array.add( existanceIdx );
+        }
+        
+        Iterator list = array.iterator();
+        MultiException rootCause = null;
+        
+        while ( list.hasNext() ) 
+        {
+            Index index = ( Index ) list.next();
+
+            try 
+            {
+               index.close();
+            } 
+            catch ( Throwable t ) 
+            {
+                if ( null == rootCause ) 
+                {
+                    rootCause = new MultiException();
+                }
+                
+                rootCause.addThrowable( t );
+            }
+        }
+
+        try 
+        {
+            master.close();
+        } 
+        catch ( Throwable t ) 
+        {
+            if ( null == rootCause ) 
+            {
+                rootCause = new MultiException();
+            }
+                
+            rootCause.addThrowable( t );
+        }
+
+        try 
+        {
+            recMan.close();
+        } 
+        catch ( Throwable t ) 
+        {
+            if ( null == rootCause ) 
+            {
+                rootCause = new MultiException();
+            }
+                
+            rootCause.addThrowable( t );
+        }
+
+        open = false;
+
+        if ( null != rootCause )
+        {
+            NamingException ne = new NamingException( "Failed to close all" );
+            ne.setRootCause( rootCause );
+            throw ne;
+        }        
+    }
+
+
+    public boolean isOpen()
+    {
+        return open;
+    }
+
+
+    public void sync() throws NamingException
+    {
+        ArrayList array = new ArrayList();
+        array.addAll( indices.values() );
+        array.add( ndnIdx );
+        array.add( updnIdx );
+        array.add( aliasIdx );
+        array.add( oneAliasIdx );
+        array.add( subAliasIdx );
+        array.add( hierarchyIdx );
+        array.add( existanceIdx );
+        
+        Iterator list = array.iterator();
+        MultiException rootCause = null;
+
+        // Sync all user defined indices
+        while ( list.hasNext() ) 
+        {
+            Index idx = ( Index ) list.next();
+
+            try 
+            {
+                idx.sync();
+            } 
+            catch ( Throwable t ) 
+            {
+                t.printStackTrace();
+                if ( null == rootCause ) 
+                {
+                    rootCause = new MultiException();
+                }
+                
+                rootCause.addThrowable( t );
+            }
+        }
+        
+        try 
+        {
+            master.sync();
+            recMan.commit();
+        }
+        catch ( Throwable t ) 
+        {
+            t.printStackTrace();
+            if ( null == rootCause ) 
+            {
+                rootCause = new MultiException();
+            }
+                
+            rootCause.addThrowable( t );
+        }
+
+        if ( null != rootCause )
+        {
+            NamingException ne = new NamingException( "Failed to sync all" );
+            ne.setRootCause( rootCause );
+            throw ne;
+        }        
     }
 
 
@@ -839,188 +1020,6 @@
         }
 
         return lookup( id );
-    }
-
-
-    /**
-     * @see org.apache.ldap.server.partition.store.PartitionStore#sync()
-     */
-    public void sync() throws NamingException
-    {
-        ArrayList array = new ArrayList();
-        array.addAll( indices.values() );
-        array.add( ndnIdx );
-        array.add( updnIdx );
-        array.add( aliasIdx );
-        array.add( oneAliasIdx );
-        array.add( subAliasIdx );
-        array.add( hierarchyIdx );
-        array.add( existanceIdx );
-        
-        Iterator list = array.iterator();
-        MultiException rootCause = null;
-
-        // Sync all user defined indices
-        while ( list.hasNext() ) 
-        {
-            Index idx = ( Index ) list.next();
-
-            try 
-            {
-                idx.sync();
-            } 
-            catch ( Throwable t ) 
-            {
-                t.printStackTrace();
-                if ( null == rootCause ) 
-                {
-                    rootCause = new MultiException();
-                }
-                
-                rootCause.addThrowable( t );
-            }
-        }
-        
-        try 
-        {
-            master.sync();
-            recMan.commit();
-        }
-        catch ( Throwable t ) 
-        {
-            t.printStackTrace();
-            if ( null == rootCause ) 
-            {
-                rootCause = new MultiException();
-            }
-                
-            rootCause.addThrowable( t );
-        }
-
-        if ( null != rootCause )
-        {
-            NamingException ne = new NamingException( "Failed to sync all" );
-            ne.setRootCause( rootCause );
-            throw ne;
-        }        
-    }
-
-
-    /**
-     * @see org.apache.ldap.server.partition.store.PartitionStore#close()
-     */
-    public synchronized void close() throws NamingException
-    {
-        if ( closed )
-        {
-            return;
-        }
-
-        ArrayList array = new ArrayList();
-        array.addAll( indices.values() );
-        
-        if ( null != ndnIdx )
-        {
-            array.add( ndnIdx );
-        }
-        
-        if ( null != updnIdx )
-        {
-            array.add( updnIdx );
-        }
-
-        if ( null != aliasIdx )
-        {
-            array.add( aliasIdx );
-        }
-
-        if ( null != oneAliasIdx )
-        {
-            array.add( oneAliasIdx );
-        }
-
-        if ( null != subAliasIdx )
-        {
-            array.add( subAliasIdx );
-        }
-
-        if ( null != hierarchyIdx )
-        {
-            array.add( hierarchyIdx );
-        }
-
-        if ( null != existanceIdx )
-        {
-            array.add( existanceIdx );
-        }
-        
-        Iterator list = array.iterator();
-        MultiException rootCause = null;
-        
-        while ( list.hasNext() ) 
-        {
-            Index index = ( Index ) list.next();
-
-            try 
-            {
-               index.close();
-            } 
-            catch ( Throwable t ) 
-            {
-                if ( null == rootCause ) 
-                {
-                    rootCause = new MultiException();
-                }
-                
-                rootCause.addThrowable( t );
-            }
-        }
-
-        try 
-        {
-            master.close();
-        } 
-        catch ( Throwable t ) 
-        {
-            if ( null == rootCause ) 
-            {
-                rootCause = new MultiException();
-            }
-                
-            rootCause.addThrowable( t );
-        }
-
-        try 
-        {
-            recMan.close();
-        } 
-        catch ( Throwable t ) 
-        {
-            if ( null == rootCause ) 
-            {
-                rootCause = new MultiException();
-            }
-                
-            rootCause.addThrowable( t );
-        }
-
-        closed = true;
-
-        if ( null != rootCause )
-        {
-            NamingException ne = new NamingException( "Failed to close all" );
-            ne.setRootCause( rootCause );
-            throw ne;
-        }        
-    }
-
-
-    /**
-     * @see org.apache.ldap.server.partition.store.PartitionStore#isClosed()
-     */
-    public boolean isClosed()
-    {
-        return closed;
     }
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalAttributeTypeRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalAttributeTypeRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalAttributeTypeRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalAttributeTypeRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.AttributeType;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapAttributeTypeRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalComparatorRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalComparatorRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalComparatorRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalComparatorRegistry.java Mon Jun 20 05:58:35 2005
@@ -23,7 +23,7 @@
 
 import javax.naming.NamingException;
 
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapComparatorRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitContentRuleRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitContentRuleRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitContentRuleRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitContentRuleRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.DITContentRule;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapDitContentRuleRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitStructureRuleRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitStructureRuleRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitStructureRuleRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalDitStructureRuleRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.DITStructureRule;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapDitStructureRuleRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.MatchingRule;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapMatchingRuleRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleUseRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleUseRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleUseRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalMatchingRuleUseRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.MatchingRuleUse;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapMatchingRuleUseRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNameFormRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNameFormRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNameFormRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNameFormRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.NameForm;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapNameFormRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNormalizerRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNormalizerRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNormalizerRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalNormalizerRegistry.java Mon Jun 20 05:58:35 2005
@@ -23,7 +23,7 @@
 import javax.naming.NamingException;
 
 import org.apache.ldap.common.schema.Normalizer;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapNormalizerRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalObjectClassRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalObjectClassRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalObjectClassRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalObjectClassRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.ObjectClass;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapObjectClassRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import javax.naming.NamingException;
 
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapOidRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalRegistries.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalRegistries.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalRegistries.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalRegistries.java Mon Jun 20 05:58:35 2005
@@ -27,7 +27,7 @@
 import org.apache.ldap.common.schema.MatchingRule;
 import org.apache.ldap.common.schema.ObjectClass;
 import org.apache.ldap.common.schema.Syntax;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapAttributeTypeRegistry;
 import org.apache.ldap.server.schema.bootstrap.BootstrapComparatorRegistry;
 import org.apache.ldap.server.schema.bootstrap.BootstrapDitContentRuleRegistry;

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxCheckerRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxCheckerRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxCheckerRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxCheckerRegistry.java Mon Jun 20 05:58:35 2005
@@ -23,7 +23,7 @@
 import javax.naming.NamingException;
 
 import org.apache.ldap.common.schema.SyntaxChecker;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapSyntaxCheckerRegistry;
 
 

Modified: directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxRegistry.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxRegistry.java?rev=191459&r1=191458&r2=191459&view=diff
==============================================================================
--- directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxRegistry.java (original)
+++ directory/apacheds/branches/db_refactor/core/src/main/java/org/apache/ldap/server/schema/GlobalSyntaxRegistry.java Mon Jun 20 05:58:35 2005
@@ -25,7 +25,7 @@
 
 import org.apache.ldap.common.schema.Syntax;
 import org.apache.ldap.common.util.JoinIterator;
-import org.apache.ldap.server.partition.SystemPartition;
+import org.apache.ldap.server.jndi.SystemPartition;
 import org.apache.ldap.server.schema.bootstrap.BootstrapSyntaxRegistry;