directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1396586 - in /directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api: LdapConnectionPool.java PoolableLdapConnectionFactory.java
Date Wed, 10 Oct 2012 13:21:32 GMT
Author: pamarcelot
Date: Wed Oct 10 13:21:32 2012
New Revision: 1396586

URL: http://svn.apache.org/viewvc?rev=1396586&view=rev
Log:
Fix for DIRAPI-92 (LdapConnectionPool should extend GenericObjectPool<LdapConnection>).

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

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java?rev=1396586&r1=1396585&r2=1396586&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/LdapConnectionPool.java
Wed Oct 10 13:21:32 2012
@@ -32,9 +32,8 @@ import org.apache.commons.pool.impl.Gene
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class LdapConnectionPool extends GenericObjectPool
+public class LdapConnectionPool extends GenericObjectPool<LdapConnection>
 {
-
     /**
      * Instantiates a new LDAP connection pool.
      *
@@ -68,5 +67,4 @@ public class LdapConnectionPool extends 
     {
         super.returnObject( connection );
     }
-
 }

Modified: directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/PoolableLdapConnectionFactory.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/PoolableLdapConnectionFactory.java?rev=1396586&r1=1396585&r2=1396586&view=diff
==============================================================================
--- directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/PoolableLdapConnectionFactory.java
(original)
+++ directory/shared/trunk/ldap/client/api/src/main/java/org/apache/directory/ldap/client/api/PoolableLdapConnectionFactory.java
Wed Oct 10 13:21:32 2012
@@ -31,9 +31,8 @@ import org.slf4j.LoggerFactory;
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class PoolableLdapConnectionFactory implements PoolableObjectFactory
+public class PoolableLdapConnectionFactory implements PoolableObjectFactory<LdapConnection>
 {
-
     /** configuration object for the connection */
     private LdapConnectionConfig config;
 
@@ -57,19 +56,18 @@ public class PoolableLdapConnectionFacto
     /**
      * {@inheritDoc}
      */
-    public void activateObject( Object obj ) throws Exception
+    public void activateObject( LdapConnection connection ) throws Exception
     {
-        LOG.debug( "activating {}", obj );
+        LOG.debug( "Activating {}", connection );
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public void destroyObject( Object obj ) throws Exception
+    public void destroyObject( LdapConnection connection ) throws Exception
     {
-        LOG.debug( "destroying {}", obj );
-        LdapConnection connection = ( LdapConnection ) obj;
+        LOG.debug( "Destroying {}", connection );
         connection.unBind();
         connection.close();
     }
@@ -78,9 +76,9 @@ public class PoolableLdapConnectionFacto
     /**
      * {@inheritDoc}
      */
-    public Object makeObject() throws Exception
+    public LdapConnection makeObject() throws Exception
     {
-        LOG.debug( "creating a LDAP connection" );
+        LOG.debug( "Creating a LDAP connection" );
 
         LdapNetworkConnection connection = new LdapNetworkConnection( config );
         connection.bind( config.getName(), config.getCredentials() );
@@ -91,21 +89,19 @@ public class PoolableLdapConnectionFacto
     /**
      * {@inheritDoc}
      */
-    public void passivateObject( Object obj ) throws Exception
+    public void passivateObject( LdapConnection connection ) throws Exception
     {
-        LOG.debug( "passivating {}", obj );
+        LOG.debug( "Passivating {}", connection );
     }
 
 
     /**
      * {@inheritDoc}
      */
-    public boolean validateObject( Object obj )
+    public boolean validateObject( LdapConnection connection )
     {
-        LOG.debug( "validating {}", obj );
+        LOG.debug( "Validating {}", connection );
 
-        LdapConnection connection = ( LdapConnection ) obj;
         return connection.isConnected();
     }
-
 }



Mime
View raw message