directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r424717 - /directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/
Date Sun, 23 Jul 2006 11:31:43 GMT
Author: elecharny
Date: Sun Jul 23 04:31:42 2006
New Revision: 424717

URL: http://svn.apache.org/viewvc?rev=424717&view=rev
Log:
Replaced the direct call to isDebugEnabled() by a check on a 
static boolean IS_DEBUG, because it's faster.

Modified:
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AbandonHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
    directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AbandonHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AbandonHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AbandonHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AbandonHandler.java
Sun Jul 23 04:31:42 2006
@@ -38,6 +38,8 @@
 {
     private static final Logger log = LoggerFactory.getLogger( AbandonHandler.class );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
@@ -78,7 +80,7 @@
         }
         else
         {
-            if ( log.isDebugEnabled() )
+            if ( IS_DEBUG )
             {
                 log.debug( "Abandoned request: " + req );
             }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java
Sun Jul 23 04:31:42 2006
@@ -51,13 +51,15 @@
     private static final Logger log = LoggerFactory.getLogger( AddHandler.class );
     private static Control[] EMPTY_CONTROLS = new Control[0];
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
         AddRequest req = ( AddRequest ) request;
         LdapResult result = req.getResultResponse().getLdapResult();
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             log.debug( "Received a Add message : " + req.toString() );
         }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java
Sun Jul 23 04:31:42 2006
@@ -53,6 +53,8 @@
     private static final Logger log = LoggerFactory.getLogger( BindHandler.class );
     private static final Control[] EMPTY = new Control[0];
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
@@ -122,7 +124,8 @@
             }
 
             String msg = "Bind failed";
-            if ( log.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 msg += ":\n" + ExceptionUtils.getStackTrace( e );
                 msg += "\n\nBindRequest = \n" + req.toString();

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java
Sun Jul 23 04:31:42 2006
@@ -52,6 +52,8 @@
     private static final Logger log = LoggerFactory.getLogger( CompareHandler.class );
     private static Control[] EMPTY_CONTROLS = new Control[0];
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
@@ -104,7 +106,7 @@
         {
             String msg = "failed to compare entry " + req.getName();
 
-            if ( log.isDebugEnabled() )
+            if ( IS_DEBUG )
             {
                 msg += ":\n" + ExceptionUtils.getStackTrace( e );
             }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java
Sun Jul 23 04:31:42 2006
@@ -51,6 +51,8 @@
     private static final Logger log = LoggerFactory.getLogger( DeleteHandler.class );
     private static Control[] EMPTY_CONTROLS = new Control[0];
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
@@ -91,7 +93,7 @@
         {
             String msg = "failed to delete entry " + req.getName();
 
-            if ( log.isDebugEnabled() )
+            if ( IS_DEBUG )
             {
                 msg += ":\n" + ExceptionUtils.getStackTrace( e );
             }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java
Sun Jul 23 04:31:42 2006
@@ -48,18 +48,20 @@
  */
 public class ModifyDnHandler implements LdapMessageHandler
 {
-    private static final Logger LOG = LoggerFactory.getLogger( ModifyDnHandler.class );
+    private static final Logger log = LoggerFactory.getLogger( ModifyDnHandler.class );
     private static Control[] EMPTY_CONTROLS = new Control[0];
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
         ModifyDnRequest req = ( ModifyDnRequest ) request;
         LdapResult result = req.getResultResponse().getLdapResult();
 
-        if ( LOG.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
-            LOG.debug( "req.getName() == [" + req.getName() + "]" );
+            log.debug( "req.getName() == [" + req.getName() + "]" );
         }
 
         if ( req.getName().isEmpty() )
@@ -151,7 +153,8 @@
             catch ( NamingException e )
             {
                 String msg = "failed to modify DN of entry " + req.getName();
-                if ( LOG.isDebugEnabled() )
+                
+                if ( IS_DEBUG )
                 {
                     msg += ":\n" + ExceptionUtils.getStackTrace( e );
                 }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java
Sun Jul 23 04:31:42 2006
@@ -49,10 +49,12 @@
  */
 public class ModifyHandler implements LdapMessageHandler
 {
-    private static final Logger LOG = LoggerFactory.getLogger( ModifyHandler.class );
+    private static final Logger log = LoggerFactory.getLogger( ModifyHandler.class );
     private static final ModificationItem[] EMPTY = new ModificationItem[0];
     private static Control[] EMPTY_CONTROLS = new Control[0];
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     public void messageReceived( IoSession session, Object request )
     {
@@ -93,7 +95,8 @@
         catch ( NamingException e )
         {
             String msg = "failed to modify entry " + req.getName();
-            if ( LOG.isDebugEnabled() )
+            
+            if ( IS_DEBUG )
             {
                 msg += ":\n" + ExceptionUtils.getStackTrace( e );
             }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java
Sun Jul 23 04:31:42 2006
@@ -67,6 +67,8 @@
     final SearchRequest req;
     final PersistentSearchControl control;
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     PersistentSearchListener(ServerLdapContext ctx, IoSession session, SearchRequest req)
     {
@@ -132,7 +134,7 @@
         SessionRegistry.getSingleton().removeOutstandingRequest( session, new Integer( req.getMessageId()
) );
         String msg = "failed on persistent search operation";
 
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             msg += ":\n" + req + ":\n" + ExceptionUtils.getStackTrace( evt.getException()
);
         }

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java
Sun Jul 23 04:31:42 2006
@@ -68,6 +68,8 @@
     private static final String DEREFALIASES_KEY = "java.naming.ldap.derefAliases";
     private StartupConfiguration cfg;
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     /**
      * Builds the JNDI search controls for a SearchRequest.
@@ -125,7 +127,7 @@
      */
     public void messageReceived( IoSession session, Object request )
     {
-    	if ( log.isDebugEnabled() )
+    	if ( IS_DEBUG )
     	{
     		log.debug( "Message received : " + request.toString() );
     	}

Modified: directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
URL: http://svn.apache.org/viewvc/directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java?rev=424717&r1=424716&r2=424717&view=diff
==============================================================================
--- directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
(original)
+++ directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java
Sun Jul 23 04:31:42 2006
@@ -67,6 +67,8 @@
     private Object prefetched;
     private final int scope;
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     /**
      * Creates a search response iterator for the resulting enumeration
@@ -399,7 +401,7 @@
     {
         String msg = "failed on search operation";
         
-        if ( log.isDebugEnabled() )
+        if ( IS_DEBUG )
         {
             msg += ":\n" + req + ":\n" + ExceptionUtils.getStackTrace( e );
         }



Mime
View raw message