Sets the wait strategy that sleeps a random amount milliseconds before retrying

@param minimum
@param maximum
@return
187221
public Retryer<R> randomWait(final long minimum, final long maximum) {
        checkArgument(minimum >= 0, "minimum must be >= 0 but is %d", minimum);
        checkArgument(maximum > minimum, "maximum must be > minimum but maximum is %d and minimum is", maximum, minimum);
        
        final Random random = new Random();
        return withWaitStrategy(new WaitStrategy() {
            @Override public long computeSleepTime(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) {
                long t = Math.abs(random.nextLong()) % (maximum - minimum);
                return t + minimum;
            }
        });
    }
91681
@Override
    public ManagedProcess waitForExitMaxMsOrDestroy(long maxWaitUntilDestroyTimeout)
            throws ManagedProcessException {
        waitForExitMaxMs(maxWaitUntilDestroyTimeout);
        if (isAlive()) {
            logger.info("Process didn't exit within max. {}ms, so going to destroy it now: {}",
                    maxWaitUntilDestroyTimeout, getProcLongName());
            destroy();
        }
        return this;
    }
943041
public void setMin(Double min) {
        String minStr = doubleToNiceStr(min);
        JQMCommon.setAttribute(input, "min", minStr);
        refreshMin(input.getElement().getId(), minStr);
        validateValue();
    }
96646
public static long randomLong(final long min, final long max) {

        return Math.round(Math.random() * (max - min) + min);
    }
611826
public FluoConfiguration setConnectionRetryTimeout(int timeoutMS) {
    Preconditions.checkArgument(timeoutMS >= -1,
        CONNECTION_RETRY_TIMEOUT_MS_PROP + " must be >= -1");
    setProperty(CONNECTION_RETRY_TIMEOUT_MS_PROP, timeoutMS);
    return this;
  }
125291
public void setIdleMin(int min)
  {
    if (min == _idleMin) {
      // avoid update() overhead if unchanged
      return;
    }
    
    if (min <= 0) {
      min = DEFAULT_IDLE_MIN;
    }
    
    if (_threadMax < min)
      throw new ConfigException(L.l("IdleMin ({0}) must be less than ThreadMax ({1})", min, _threadMax));
    if (min <= 0)
      throw new ConfigException(L.l("IdleMin ({0}) must be greater than 0.", min));

    _idleMin = min;
    
    update();
  }
66161
public void setIdleMin(int min)
  {
    if (min < 1)
      throw new IllegalArgumentException(L.l("idle-min must be greater than zero."));

    if (_idleMax <= min) {
      throw new IllegalArgumentException(L.l("idle-min '{0}' must be less than idle-max '{1}'.",
                                             min, _idleMax));
    }

    _idleMin = min;

    _launcher.setIdleMin(_idleMin);
  }
796216
public void sleep(Deadline deadline)
	{
		final long millis = Math.min(deadline.getTimeLeft(), getMilliseconds());

		if (millis > 0)
		{
			try
			{
				Thread.sleep(millis);
			}
			catch (InterruptedException e)
			{
				// ignore but return
			}
		}
	}
1269274
public void setExecutorTaskMax(int max)
  {
    if (getThreadMax() < max)
      throw new ConfigException(L.l("<thread-executor-max> ({0}) must be less than <thread-max> ({1})",
                                    max, getThreadMax()));

    if (max == 0)
      throw new ConfigException(L.l("<thread-executor-max> must not be zero."));

    _executorTaskMax = max;
  }
1184813
public boolean withEveryRetryWaitFor(int time, TimeUnit units) {
        for (int i = 1; i <= retries; i++) {
            if (openSocket()) {
                return true;
            }
            sleepFor(time, units);
        }
        return false;
    }
564487
public static void checkMinMax(int min, int max) {
    checkMin(min);
    checkMax(max);
    checkArgument(min <= max, "min > max");
  }
657564
private void applyWait(int fullTimes) {
        int newFullTimes = fullTimes > maxFullTimes ? maxFullTimes : fullTimes;
        if (fullTimes <= 3) { // 3次以内
            Thread.yield();
        } else { // 超过3次，最多只sleep 10ms
            LockSupport.parkNanos(1000 * 1000L * newFullTimes);
        }

    }
720476
public void setRetryInterval(int retryInterval) throws RabbitmqCommunicateException
    {
        if (retryInterval <= 0)
        {
            String messageFmt = "RetryInterval is invalid. RetryInterval={0}";
            String message = MessageFormat.format(messageFmt, retryInterval);
            throw new RabbitmqCommunicateException(message);
        }
        this.retryInterval = retryInterval;
    }
211533
public static final RetryPolicy retryUpToMaximumTimeWithFixedSleep(long maxTime, long sleepTime, TimeUnit timeUnit) {
    return new RetryUpToMaximumTimeWithFixedSleep(maxTime, sleepTime, timeUnit);
  }
201402
public Retryer<R> stopAfterDelay(final long delayInMillis) {
        checkArgument(delayInMillis >= 0L, "delayInMillis must be >= 0 but is %d", delayInMillis);
        return withStopStrategy(new StopStrategy() {
            
            @Override public boolean shouldStop(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) {
                return delaySinceFirstAttemptInMillis >= delayInMillis;
            }
        });
    }
933392
public void wait(int retry) {
        long sleepMillis = BACKOFF[Math.min(retry, BACKOFF.length - 1)] * 1000L;
        try {
            Thread.sleep(sleepMillis);
        } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
            throw new WebbException(ie);
        }
    }
464628
public Retryer<R> incrementingWait(final long initialSleepTime, final long increment) {
        checkArgument(initialSleepTime >= 0L, "initialSleepTime must be >= 0 but is %d", initialSleepTime);
        return withWaitStrategy(new WaitStrategy() {

            @Override public long computeSleepTime(int previousAttemptNumber, long delaySinceFirstAttemptInMillis) {
                long result = initialSleepTime + (increment * (previousAttemptNumber - 1));
                return result >= 0L ? result : 0L;
            }
        });
    }