directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1312051 - in /directory/apacheds/branches/index-work: core-api/src/main/java/org/apache/directory/server/core/api/ core-api/src/main/java/org/apache/directory/server/core/api/filtering/ core-avl/src/main/java/org/apache/directory/server/co...
Date Tue, 10 Apr 2012 23:56:43 GMT
Author: elecharny
Date: Tue Apr 10 23:56:43 2012
New Revision: 1312051

URL: http://svn.apache.org/viewvc?rev=1312051&view=rev
Log:
o Added a LOG_CURSOR logger
o Added the close() and close( Exception ) methods when it was missing

Modified:
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
    directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
    directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/EntryToResponseCursor.java
Tue Apr 10 23:56:43 2012
@@ -38,6 +38,8 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.message.SearchResultDoneImpl;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntry;
 import org.apache.directory.shared.ldap.model.message.SearchResultEntryImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -48,6 +50,9 @@ import org.apache.directory.shared.ldap.
  */
 public class EntryToResponseCursor implements SearchCursor
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** the underlying cursor */
     private Cursor<Entry> wrapped;
 
@@ -61,6 +66,7 @@ public class EntryToResponseCursor imple
 
     public EntryToResponseCursor( int messageId, Cursor<Entry> wrapped )
     {
+        LOG_CURSOR.debug( "Creating EntryToResponseCursor " + this );
         this.wrapped = wrapped;
         this.messageId = messageId;
     }
@@ -104,12 +110,14 @@ public class EntryToResponseCursor imple
 
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing EntryToResponseCursor " + this );
         wrapped.close();
     }
 
 
     public void close( Exception e ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing EntryToResponseCursor " + this );
         wrapped.close( e );
     }
 

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/BaseEntryFilteringCursor.java
Tue Apr 10 23:56:43 2012
@@ -57,6 +57,9 @@ public class BaseEntryFilteringCursor im
     /** the logger used by this class */
     private static final Logger log = LoggerFactory.getLogger( BaseEntryFilteringCursor.class
);
 
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** the underlying wrapped search results Cursor */
     private final Cursor<Entry> wrapped;
 
@@ -101,6 +104,7 @@ public class BaseEntryFilteringCursor im
      */
     public BaseEntryFilteringCursor( Cursor<Entry> wrapped, SearchingOperationContext
operationContext )
     {
+        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor " + this );
         this.wrapped = wrapped;
         this.operationContext = operationContext;
         this.filters = new ArrayList<EntryFilter>();
@@ -119,6 +123,7 @@ public class BaseEntryFilteringCursor im
     public BaseEntryFilteringCursor( Cursor<Entry> wrapped,
         SearchingOperationContext operationContext, List<EntryFilter> filters )
     {
+        LOG_CURSOR.debug( "Creating BaseEntryFilteringCursor " + this );
         this.wrapped = wrapped;
         this.operationContext = operationContext;
         this.filters = new ArrayList<EntryFilter>();
@@ -248,6 +253,7 @@ public class BaseEntryFilteringCursor im
      */
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor " + this );
         wrapped.close();
         prefetched = null;
     }
@@ -258,6 +264,7 @@ public class BaseEntryFilteringCursor im
      */
     public void close( Exception reason ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing BaseEntryFilteringCursor " + this );
         wrapped.close( reason );
         prefetched = null;
     }

Modified: directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
(original)
+++ directory/apacheds/branches/index-work/core-api/src/main/java/org/apache/directory/server/core/api/filtering/CursorList.java
Tue Apr 10 23:56:43 2012
@@ -26,7 +26,6 @@ import java.util.List;
 
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
 import org.apache.directory.shared.i18n.I18n;
-import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.ClosureMonitor;
 import org.apache.directory.shared.ldap.model.cursor.Cursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
@@ -47,6 +46,9 @@ import org.slf4j.LoggerFactory;
  */
 public class CursorList implements EntryFilteringCursor
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The inner List */
     private final List<EntryFilteringCursor> list;
 
@@ -82,6 +84,8 @@ public class CursorList implements Entry
      */
     public CursorList( int start, List<EntryFilteringCursor> list, int end, SearchingOperationContext
searchContext )
     {
+        LOG_CURSOR.debug( "Creating CursorList " + this );
+        
         if ( list != null )
         {
             this.list = list;
@@ -443,12 +447,14 @@ public class CursorList implements Entry
 
     public void close() throws Exception
     {
+        LOG_CURSOR.debug( "Closing CursorList " + this );
         close( null );
     }
 
 
     public void close( Exception reason ) throws Exception
     {
+        LOG_CURSOR.debug( "Closing CursorList " + this );
         closed = true;
 
         for ( Cursor<?> c : list )

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/ArrayTreeCursor.java
Tue Apr 10 23:56:43 2012
@@ -22,6 +22,8 @@ package org.apache.directory.server.core
 
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -31,6 +33,9 @@ import org.apache.directory.shared.ldap.
  */
 public class ArrayTreeCursor<E> extends AbstractCursor<E>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The underlying ArrayTree */
     private ArrayTree<E> array;
 
@@ -47,6 +52,7 @@ public class ArrayTreeCursor<E> extends 
      */
     public ArrayTreeCursor( ArrayTree<E> array )
     {
+        LOG_CURSOR.debug( "Creating ArrayTreeCursor " + this );
         this.array = array;
         position = Position.BEFORE_FIRST;
     }
@@ -292,4 +298,24 @@ public class ArrayTreeCursor<E> extends 
                 throw new IllegalStateException( "Unexpected position " + position );
         }
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing ArrayTreeCursor " + this );
+        super.close();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception reason ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing ArrayTreeCursor " + this );
+        super.close( reason );
+    }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlSingletonOrOrderedSetCursor.java
Tue Apr 10 23:56:43 2012
@@ -25,6 +25,8 @@ import java.util.Comparator;
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -34,6 +36,9 @@ import org.apache.directory.shared.ldap.
  */
 public class AvlSingletonOrOrderedSetCursor<K, V> extends AbstractCursor<Tuple<K,
SingletonOrOrderedSet<V>>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The underlying AVL tree map */
     private AvlTreeMap<K, V> tree;
 
@@ -48,6 +53,7 @@ public class AvlSingletonOrOrderedSetCur
 
     public AvlSingletonOrOrderedSetCursor( AvlTreeMap<K, V> tree )
     {
+        LOG_CURSOR.debug( "Creating AvlSingletonOrOrderedSetCursor " + this );
         this.tree = tree;
     }
 
@@ -285,4 +291,24 @@ public class AvlSingletonOrOrderedSetCur
     {
         throw new UnsupportedOperationException( "This Cursor does not support duplicate
keys." );
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor " + this );
+        super.close();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception reason ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlSingletonOrOrderedSetCursor " + this );
+        super.close( reason );
+    }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeCursor.java
Tue Apr 10 23:56:43 2012
@@ -22,6 +22,8 @@ package org.apache.directory.server.core
 
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -31,6 +33,9 @@ import org.apache.directory.shared.ldap.
  */
 public class AvlTreeCursor<E> extends AbstractCursor<E>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     /** The underlying AVL tree */
     private AvlTree<E> tree;
 
@@ -43,6 +48,7 @@ public class AvlTreeCursor<E> extends Ab
 
     public AvlTreeCursor( AvlTree<E> tree )
     {
+        LOG_CURSOR.debug( "Creating AvlTreeCursor " + this );
         this.tree = tree;
     }
 
@@ -242,4 +248,24 @@ public class AvlTreeCursor<E> extends Ab
                 throw new IllegalStateException( "Unexpected position " + position );
         }
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlTreeCursor " + this );
+        super.close();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception reason ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlTreeCursor " + this );
+        super.close( reason );
+    }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/AvlTreeMapNoDupsWrapperCursor.java
Tue Apr 10 23:56:43 2012
@@ -23,6 +23,8 @@ package org.apache.directory.server.core
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -34,12 +36,15 @@ import org.apache.directory.shared.ldap.
  */
 public class AvlTreeMapNoDupsWrapperCursor<K, V> extends AbstractCursor<Tuple<K,
V>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final AvlSingletonOrOrderedSetCursor<K, V> wrapped;
     private final Tuple<K, V> returnedTuple = new Tuple<K, V>();
 
-
     public AvlTreeMapNoDupsWrapperCursor( AvlSingletonOrOrderedSetCursor<K, V> wrapped
)
     {
+        LOG_CURSOR.debug( "Creating AvlTreeMapNoDupsWrapperCursor " + this );
         this.wrapped = wrapped;
     }
 
@@ -112,7 +117,6 @@ public class AvlTreeMapNoDupsWrapperCurs
 
             if ( tuple.getValue().isOrderedSet() )
             {
-                System.out.println( "tuple key = " + tuple.getKey() );
                 tuple.getValue().getOrderedSet().printTree();
             }
 
@@ -140,4 +144,18 @@ public class AvlTreeMapNoDupsWrapperCurs
     {
         return wrapped.previous();
     }
+
+
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor " + this );
+        wrapped.close();
+    }
+
+
+    public void close( Exception reason ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing AvlTreeMapNoDupsWrapperCursor " + this );
+        wrapped.close( reason );
+    }
 }

Modified: directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java?rev=1312051&r1=1312050&r2=1312051&view=diff
==============================================================================
--- directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
(original)
+++ directory/apacheds/branches/index-work/core-avl/src/main/java/org/apache/directory/server/core/avltree/KeyTupleAvlCursor.java
Tue Apr 10 23:56:43 2012
@@ -23,6 +23,8 @@ import org.apache.directory.server.i18n.
 import org.apache.directory.shared.ldap.model.cursor.AbstractCursor;
 import org.apache.directory.shared.ldap.model.cursor.InvalidCursorPositionException;
 import org.apache.directory.shared.ldap.model.cursor.Tuple;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 
 /**
@@ -34,6 +36,9 @@ import org.apache.directory.shared.ldap.
  */
 public class KeyTupleAvlCursor<K, V> extends AbstractCursor<Tuple<K, V>>
 {
+    /** A dedicated log for cursors */
+    private static final Logger LOG_CURSOR = LoggerFactory.getLogger( "CURSOR" );
+
     private final AvlTreeCursor<V> wrapped;
     private final K key;
 
@@ -49,6 +54,7 @@ public class KeyTupleAvlCursor<K, V> ext
      */
     public KeyTupleAvlCursor( AvlTree<V> avlTree, K key )
     {
+        LOG_CURSOR.debug( "Creating KeyTupleAvlCursor " + this );
         this.key = key;
         this.wrapped = new AvlTreeCursor<V>( avlTree );
     }
@@ -204,4 +210,34 @@ public class KeyTupleAvlCursor<K, V> ext
 
         throw new InvalidCursorPositionException();
     }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close() throws Exception
+    {
+        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor " + this );
+        super.close();
+
+        if ( wrapped != null )
+        {
+            wrapped.close();
+        }
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void close( Exception cause ) throws Exception
+    {
+        LOG_CURSOR.debug( "Closing KeyTupleAvlCursor " + this );
+        super.close( cause );
+
+        if ( wrapped != null )
+        {
+            wrapped.close( cause );
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message