Example #1
0
  private boolean setupJMSObjectsWithRetry() {
    if (JMSBridgeImpl.trace) {
      HornetQJMSServerLogger.LOGGER.trace("Setting up connections");
    }

    int count = 0;

    while (true && !stopping) {
      boolean ok = setupJMSObjects();

      if (ok) {
        return true;
      }

      count++;

      if (maxRetries != -1 && count == maxRetries) {
        break;
      }

      HornetQJMSServerLogger.LOGGER.failedToSetUpBridge(failureRetryInterval);

      pause(failureRetryInterval);
    }

    // If we get here then we exceeded maxRetries
    return false;
  }