directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r537363 - /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Date Sat, 12 May 2007 09:02:58 GMT
Author: elecharny
Date: Sat May 12 02:02:57 2007
New Revision: 537363

URL: http://svn.apache.org/viewvc?view=rev&rev=537363
Log:
To avoid a very expensive call to the lookup() method when the DN
is empty (rootDSE), call the faster method getRootDSE() instead

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java?view=diff&rev=537363&r1=537362&r2=537363
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java
Sat May 12 02:02:57 2007
@@ -594,7 +594,16 @@
         Object obj;
         LdapDN target = buildTarget( name );
         
-        Attributes attributes = nexusProxy.lookup( new LookupOperationContext( target ) );
+        Attributes attributes = null;
+        
+        if ( name.size() == 0 )
+        {
+        	attributes = nexusProxy.getRootDSE( new LookupOperationContext( target ) );
+        }
+        else
+        {
+        	attributes = nexusProxy.lookup( new LookupOperationContext( target ) );
+        }
 
         try
         {



Mime
View raw message