int validConnectionsCounter) {
boolean isResourceEligibleForRemoval = false;
ResourceState state = h.getResourceState();
//remove all idle-time lapsed resources.
ResourceAllocator alloc = h.getResourceAllocator();
if (preferValidateOverRecreate && alloc.hasValidatingMCF()) {
//validConnectionsCounter is incremented if the connection
//is valid but only till the steady pool size.
if (validConnectionsCounter < pool.getSteadyPoolSize()
&& alloc.isConnectionValid(h)) {
h.setLastValidated(System.currentTimeMillis());
state.touchTimestamp();
} else {
//Connection invalid and hence remove resource.