directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cp...@apache.org
Subject directory-fortress-core git commit: added method to close ldap pools
Date Fri, 11 Mar 2016 22:00:07 GMT
Repository: directory-fortress-core
Updated Branches:
  refs/heads/master df5944331 -> 6cbea1ddf


added method to close ldap pools


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/6cbea1dd
Tree: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/tree/6cbea1dd
Diff: http://git-wip-us.apache.org/repos/asf/directory-fortress-core/diff/6cbea1dd

Branch: refs/heads/master
Commit: 6cbea1ddff3a959ace0be9f66b16afa42da7b22e
Parents: df59443
Author: clp207 <clp207@psu.edu>
Authored: Fri Mar 11 16:59:40 2016 -0500
Committer: clp207 <clp207@psu.edu>
Committed: Fri Mar 11 16:59:40 2016 -0500

----------------------------------------------------------------------
 .../core/ldap/ApacheDsDataProvider.java         | 29 ++++++++++++++++++++
 1 file changed, 29 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-fortress-core/blob/6cbea1dd/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
b/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
index 14b0942..673fa16 100644
--- a/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
+++ b/src/main/java/org/apache/directory/fortress/core/ldap/ApacheDsDataProvider.java
@@ -1611,4 +1611,33 @@ public abstract class ApacheDsDataProvider
         return sb.toString();
     }
 
+    /**
+     * Closes all the ldap connection pools.
+     */
+    public static void closeAllConnectionPools(){
+        try{
+            LOG.info("Closing admin pool");
+            adminPool.close();
+        }
+        catch(Exception e){
+            LOG.warn("Error closing admin pool: " + e.getMessage());
+        }
+        
+        try{
+            LOG.info("Closing user pool");
+            userPool.close();
+        }
+        catch(Exception e){
+            LOG.warn("Error closing user pool: " + e.getMessage());
+        }
+        
+        try{
+            LOG.info("Closing log pool");
+            logPool.close();
+        }
+        catch(Exception e){
+            LOG.warn("Error closing log pool: " + e.getMessage());
+        }
+    }
+    
 }


Mime
View raw message