public boolean startConnection(){
  State state=_state.get();
  if (state.isActive()) {
    _connectionCount.incrementAndGet();
    return true;
  }
  long now=CurrentTime.currentTime();
  long lastFailTime=_lastFailTime;
  long recoverTimeout=_dynamicRecoverTimeout.get();
  if (now < lastFailTime + recoverTimeout) {
    return false;
  }
  int count;
  do {
    count=_connectionCount.get();
    if (count > 0) {
      return false;
    }
  }
 while (!_connectionCount.compareAndSet(count,count + 1));
  return true;
}

public boolean startConnection ( ) { State state = _state . get ( ) ; if ( state . isActive ( ) ) { _connectionCount . incrementAndGet ( ) ; return true ; } long now = CurrentTime . currentTime ( ) ; long lastFailTime = _lastFailTime ; long recoverTimeout = _dynamicRecoverTimeout . get ( ) ; if ( now < lastFailTime + recoverTimeout ) { return false ; } int count ; do { count = _connectionCount . get ( ) ; if ( count > 0 ) { return false ; } } while ( ! _connectionCount . compareAndSet ( count , count + 1 ) ) ; return true ; }
start a new connection . returns true if the connection can be started .
