From 3f7ddbf313aaabbfba4650cb2036cb41e51a9bde Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Thu, 18 Apr 2013 11:37:28 +0000
Subject: [PATCH] Fix OPENDJ-838: Add ConnectionFactory.close() method to facilitate resource cleanup after application exit

---
 opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java
index 0e7655d..043e489 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2009-2010 Sun Microsystems, Inc.
- *      Portions copyright 2011-2012 ForgeRock AS.
+ *      Portions copyright 2011-2013 ForgeRock AS.
  */
 
 package org.forgerock.opendj.ldap;
@@ -39,9 +39,10 @@
  * Server.
  */
 public final class LDAPConnectionFactory implements ConnectionFactory {
-    // We implement the factory using the pimpl idiom in order to avoid making
-    // too many implementation classes public.
-
+    /*
+     * We implement the factory using the pimpl idiom in order to avoid making
+     * too many implementation classes public.
+     */
     private final LDAPConnectionFactoryImpl impl;
 
     /**
@@ -125,18 +126,17 @@
         }
     }
 
-    /**
-     * {@inheritDoc}
-     */
+    @Override
+    public void close() {
+        impl.close();
+    }
+
     @Override
     public FutureResult<Connection> getConnectionAsync(
             final ResultHandler<? super Connection> handler) {
         return impl.getConnectionAsync(handler);
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public Connection getConnection() throws ErrorResultException {
         return impl.getConnection();
@@ -183,9 +183,6 @@
         return impl.getSocketAddress();
     }
 
-    /**
-     * {@inheritDoc}
-     */
     @Override
     public String toString() {
         return impl.toString();

--
Gitblit v1.10.0