List of usage examples for org.apache.commons.pool2.impl GenericKeyedObjectPool borrowObject
@Override public T borrowObject(K key) throws Exception
#borrowObject(Object,long) borrowObject (key, #getMaxWaitMillis() )
. From source file:com.vmware.identity.idm.server.provider.LdapConnectionPool.java
public ILdapConnectionEx borrowConnection(PooledLdapConnectionIdentity identity) throws Exception { String tenantName = identity.getTenantName().toLowerCase(); GenericKeyedObjectPool<PooledLdapConnectionIdentity, ILdapConnectionEx> currentPool = poolMap .get(tenantName);/*from w w w . j a v a2 s . co m*/ if (currentPool == null) { throw new IllegalStateException("Connection pool does not exist for tenant " + tenantName); } return currentPool.borrowObject(identity); }