You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by sm...@apache.org on 2016/05/24 03:21:27 UTC

directory-fortress-core git commit: FC-38 - cleanup unneeded lock

Repository: directory-fortress-core
Updated Branches:
  refs/heads/master 015dfdf82 -> 90de94d29


FC-38 - cleanup unneeded lock


Project: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/commit/90de94d2
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/90de94d2
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/90de94d2

Branch: refs/heads/master
Commit: 90de94d299417c2f89e466f159c73304e7f7f5cd
Parents: 015dfdf
Author: Shawn McKinney <sm...@apache.org>
Authored: Mon May 23 22:21:21 2016 -0500
Committer: Shawn McKinney <sm...@apache.org>
Committed: Mon May 23 22:21:21 2016 -0500

----------------------------------------------------------------------
 .../directory/fortress/core/impl/HierUtil.java  | 70 --------------------
 1 file changed, 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/90de94d2/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java b/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
index 9b2c1d4..df23540 100755
--- a/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
+++ b/src/main/java/org/apache/directory/fortress/core/impl/HierUtil.java
@@ -105,56 +105,6 @@ final class HierUtil
      * @param type
      * @return
      */
-    static ReadWriteLock getLock( String contextId, Type type )
-    {
-        String syncKey = getSynchKey( contextId, type );
-     
-        try
-        {
-            getLockLock.readLock().lock();
-            ReadWriteLock synchObj = synchMap.get( syncKey );
-            
-            if ( synchObj == null )
-            {
-                // Not found, we will create a new one and store it into the map
-                try
-                {
-                    getLockLock.readLock().unlock();
-                    getLockLock.writeLock().lock();
-
-                    // Retry immediately to get the lock from the map, it might have been updated by
-                    // another thread while this thread was blocked on the write lock 
-                    synchObj = synchMap.get( syncKey );
-                    
-                    if ( synchObj == null )
-                    {
-                        synchObj = new ReentrantReadWriteLock();
-                        synchMap.put( syncKey, synchObj );
-                    }
-
-                    getLockLock.readLock().lock();
-                }
-                finally
-                {
-                    getLockLock.writeLock().unlock();
-                }
-            }
-            
-            return synchObj;
-        }
-        finally
-        {
-            getLockLock.readLock().unlock();
-        }
-    }
-
-
-    /**
-     *
-     * @param contextId
-     * @param type
-     * @return
-     */
     private static String getSynchKey( String contextId, Type type )
     {
         return type.toString() + ":" + contextId;
@@ -212,26 +162,6 @@ final class HierUtil
 
 
     /**
-     * This method Convert from logical, {@code org.jgrapht.graph.SimpleDirectedGraph} to ldap entity, {@link org.apache.directory.fortress.core.model.Hier}.
-     * The conversion iterates over all edges in the graph and loads the corresponding {@link Relationship} data
-     * into the ldap entity.  The ldap entity stores this data physically in the {@code ftRels} attribute of {@code ftHier} object class.
-     *
-     * @param graph contains a reference to simple digraph {@code org.jgrapht.graph.SimpleDirectedGraph}.
-     * @return reference to hierarchical ldap entity {@link org.apache.directory.fortress.core.model.Hier}.
-     */
-    static Hier toHier( SimpleDirectedGraph<String, Relationship> graph )
-    {
-        Hier he = new Hier();
-        Set<Relationship> eSet = graph.edgeSet();
-        for ( Relationship edge : eSet )
-        {
-            he.setRelationship( edge );
-        }
-        return he;
-    }
-
-
-    /**
      * This method converts from physical ldap entity format, {@link Hier} to logical {@code org.jgrapht.graph.SimpleDirectedGraph}.
      *
      * @param hier contains parent-child relationship in preparation to storing in ldap {@code ftRels} attribute of {@code ftHier} object class.