Menu

Retrieving the pool from a LDAP connection

2013-12-12
2013-12-12
  • Oscar Golden L.

    Oscar Golden L. - 2013-12-12

    Hi,
    I am experimenting with multiple connection pools. I am at a point where it will be very convenient to retrieve the pool a particular LDAP connection is associated with.
    However the getConnection() method of the LDAPConnection class is currently not public.

      AbstractConnectionPool getConnectionPool()
      {
        return connectionPool;
      }
    

    Anyone knows a workaround to that ?
    Thanks,

     
  • Neil Wilson

    Neil Wilson - 2013-12-12

    At present, this method is only used internally within the LDAP SDK (e.g., to intercept a request to close the connection so that it is released to the pool as defunct) so it isn't public. However, I can consider making it public.

    For now, you have a couple of options. One way would be to the getConnectionPoolName method, and to maintain a map of connection pool names to connection pool instances. Another would be to use reflection to retrieve the getConnectionPool method, make it accessible, and invoke it.

     
  • Neil Wilson

    Neil Wilson - 2013-12-12

    I have just committed a change that makes the LDAPConnection.getConnectionPool method public. This will be included in the next release of the LDAP SDK. If you want it now, then you can check out and build the SDK from the Subversion repository, or you can use one of the workarounds I described earlier.

     

Log in to post a comment.