List of usage examples for org.apache.commons.pool2.impl GenericKeyedObjectPool close
@Override public void close()
From source file:com.vmware.identity.idm.server.provider.LdapConnectionPool.java
public void cleanPool(String tenantName) { GenericKeyedObjectPool<PooledLdapConnectionIdentity, ILdapConnectionEx> pool = poolMap .remove(tenantName.toLowerCase()); if (pool != null) { pool.close(); logger.info("Pool closed for tenant " + tenantName); }// www . j a va 2 s . co m }
From source file:com.vmware.identity.idm.server.provider.LdapConnectionPool.java
public void createPool(String tenantName) { GenericKeyedObjectPool<PooledLdapConnectionIdentity, ILdapConnectionEx> newPool = null; GenericKeyedObjectPool<PooledLdapConnectionIdentity, ILdapConnectionEx> currentPool = poolMap .get(tenantName.toLowerCase()); if (currentPool == null) { newPool = new GenericKeyedObjectPool<>(new PooledLdapConnectionFactory(), getGenericKeyedObjectPoolConfig(tenantName)); currentPool = poolMap.putIfAbsent(tenantName.toLowerCase(), newPool); if (currentPool != null) { newPool.close(); }//from w ww .ja v a 2 s .c o m logger.info(currentPool != null ? "Pool created for tenant " + tenantName : "Pool already existed for tenant " + tenantName); } }