/** * Creates a new waiter with the given strategies. * @param terminationStrategy The termination strategy to use. * @param delayStrategy The delay strategy to use. */ public BmcGenericWaiter(TerminationStrategy terminationStrategy, DelayStrategy delayStrategy) { WaiterConfiguration waiterConfig = new WaiterConfiguration(terminationStrategy, delayStrategy); this.waiter = new GenericWaiter(waiterConfig); }
context.setCurrentTime(System.currentTimeMillis()); if (waiterConfiguration.getTerminationStrategy().shouldTerminate(context)) { LOG.debug("Termination strategy decided to terminate with context at: {}", context); break; long sleepTime = waiterConfiguration.getDelayStrategy().nextDelay(context); LOG.debug("Sleeping for {}ms, context at: {}", sleepTime, context); Thread.sleep(sleepTime);