directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1395592 - /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
Date Mon, 08 Oct 2012 14:50:06 GMT
Author: elecharny
Date: Mon Oct  8 14:50:06 2012
New Revision: 1395592

URL: http://svn.apache.org/viewvc?rev=1395592&view=rev
Log:
Added some speed up for logs

Modified:
    directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java?rev=1395592&r1=1395591&r2=1395592&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/EntryCursorImpl.java
Mon Oct  8 14:50:06 2012
@@ -47,6 +47,9 @@ public class EntryCursorImpl extends Abs
     /** A dedicated log for cursors */
     private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
 
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG_CURSOR.isDebugEnabled();
+
     /** a reference to hold the retrieved SearchResponse object from SearchFuture */
     private Response response;
 
@@ -64,7 +67,11 @@ public class EntryCursorImpl extends Abs
      */
     public EntryCursorImpl( SearchCursor searchCursor )
     {
-        LOG_CURSOR.debug( "Creating EntryCursorImpl {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Creating EntryCursorImpl {}", this );
+    	}
+    	
         this.searchCursor = searchCursor;
         messageId = -1;
     }
@@ -163,7 +170,11 @@ public class EntryCursorImpl extends Abs
     @Override
     public void close() throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	}
+    	
         searchCursor.close();
     }
 
@@ -174,7 +185,11 @@ public class EntryCursorImpl extends Abs
     @Override
     public void close( Exception cause ) throws Exception
     {
-        LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	if ( IS_DEBUG )
+    	{
+    		LOG_CURSOR.debug( "Closing EntryCursorImpl {}", this );
+    	}
+    	
         searchCursor.close( cause );
     }
 



Mime
View raw message