public BasicPoolEntry allocEntry(final Object state){
  if (!freeEntries.isEmpty()) {
    ListIterator<BasicPoolEntry> it=freeEntries.listIterator(freeEntries.size());
    while (it.hasPrevious()) {
      BasicPoolEntry entry=it.previous();
      if (LangUtils.equals(state,entry.getState())) {
        it.remove();
        return entry;
      }
    }
  }
  if (!freeEntries.isEmpty()) {
    BasicPoolEntry entry=freeEntries.remove();
    entry.setState(null);
    OperatedClientConnection conn=entry.getConnection();
    try {
      conn.close();
    }
 catch (    IOException ex) {
      log.debug("I/O error closing connection",ex);
    }
    return entry;
  }
  return null;
}

public BasicPoolEntry allocEntry ( final Object state ) { if ( ! freeEntries . isEmpty ( ) ) { ListIterator < BasicPoolEntry > it = freeEntries . listIterator ( freeEntries . size ( ) ) ; while ( it . hasPrevious ( ) ) { BasicPoolEntry entry = it . previous ( ) ; if ( LangUtils . equals ( state , entry . getState ( ) ) ) { it . remove ( ) ; return entry ; } } } if ( ! freeEntries . isEmpty ( ) ) { BasicPoolEntry entry = freeEntries . remove ( ) ; entry . setState ( null ) ; OperatedClientConnection conn = entry . getConnection ( ) ; try { conn . close ( ) ; } catch ( IOException ex ) { log . debug ( "I/O error closing connection" , ex ) ; } return entry ; } return null ; }
obtains a free entry from this pool , if one is available .
