code: public boolean canOpen()
    {
      if (getIdleCount() > 0) {
        return true;
      }
      
      State state = _state;
  
      if (state == State.ACTIVE)
        return true;
      else if (! state.isEnabled())
        return false;
      else {
        long now = CurrentTime.currentTime();
  
        if (isFailed(now)) {
          return false;
        }
  
        return true;
      }
    }
docs: Returns true if the server can open a connection.