directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r556187 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Date Fri, 13 Jul 2007 23:39:55 GMT
Author: akarasulu
Date: Fri Jul 13 16:39:55 2007
New Revision: 556187

URL: http://svn.apache.org/viewvc?view=rev&rev=556187
Log:
further clarification on this partition lookup tree structure

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java?view=diff&rev=556187&r1=556186&r2=556187
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java
Fri Jul 13 16:39:55 2007
@@ -126,7 +126,7 @@
     private Map<String, Partition> partitions = new HashMap<String, Partition>();
     
     /** A structure to hold all the partitions */
-    private Node partitionList = new BranchNode();
+    private Node partitionLookupTree = new BranchNode();
     
     /** the read only rootDSE attributes */
     private final Attributes rootDSE;
@@ -398,11 +398,11 @@
             throw new ConfigurationException( "Duplicate partition suffix: " + key );
         }
         
-        synchronized ( partitionList )
+        synchronized ( partitionLookupTree )
         {
             partitions.put( key, system );
         
-            partitionList.buildNode( partitionList, system.getSuffix(), 0, system );
+            partitionLookupTree.buildNode( partitionLookupTree, system.getSuffix(), 0, system
);
 
             Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
             namingContexts.add( system.getUpSuffix().getUpName() );
@@ -576,11 +576,11 @@
             partition.init( factoryCfg, config );
         }
         
-        synchronized ( partitionList )
+        synchronized ( partitionLookupTree )
         {
             partitions.put( partition.getSuffix().toString(), partition );
             
-            partitionList.buildNode( partitionList, partition.getSuffix(), 0, partition );
+            partitionLookupTree.buildNode( partitionLookupTree, partition.getSuffix(), 0,
partition );
 
             Attribute namingContexts = rootDSE.get( NAMINGCTXS_ATTR );
             namingContexts.add( partition.getUpSuffix().getUpName() );
@@ -605,15 +605,15 @@
         // This is easier to create a new structure from scratch than to reorganize
         // the current structure. As this strcuture is not modified often
         // this is an acceptable solution.
-        synchronized (partitionList)
+        synchronized (partitionLookupTree)
         {
             partitions.remove( key );
         
-            partitionList = new BranchNode();
+            partitionLookupTree = new BranchNode();
             
             for ( Partition part:partitions.values() )
             {
-                partitionList.buildNode( partitionList, part.getSuffix(), 0, partition );
+                partitionLookupTree.buildNode( partitionLookupTree, part.getSuffix(), 0,
partition );
             }
     
             partition.sync();
@@ -1036,24 +1036,24 @@
     private Partition getBackend( LdapDN dn ) throws NamingException
     {
         Enumeration<String> rdns = dn.getAll();
-        Node currentPartition = partitionList;
+        Node currentNode = partitionLookupTree;
         
         // This is synchronized so that we can't read the
         // partitionList when it is modified.
-        synchronized ( partitionList )
+        synchronized ( partitionLookupTree )
         {
             // Iterate through all the RDN until we find the associated partition
             while ( rdns.hasMoreElements() )
             {
                 String rdn = rdns.nextElement();
                 
-                if ( currentPartition.contains( rdn ) )
+                if ( currentNode.contains( rdn ) )
                 {
-                    currentPartition = currentPartition.getChildOrThis( rdn );
+                    currentNode = currentNode.getChildOrThis( rdn );
     
-                    if ( currentPartition.isLeaf() )
+                    if ( currentNode.isLeaf() )
                     {
-                        return currentPartition.getPartition();
+                        return currentNode.getPartition();
                     }
                 }
                 else



Mime
View raw message