/** * Invokes the wait condition, trying every second for 10 seconds * * @param waitCondition The condition that determines when to stop waiting * @return True if the condition returned true */ public static boolean invoke(final WaitCondition waitCondition) { return invoke(waitCondition, STARTUP_WAIT); }
/** * Invokes the wait condition, trying every second for the configured * seconds * * @param waitCondition The condition that determines when to stop waiting * @param tries The number of tries to attempt * @return True if the condition returned true */ public static boolean invoke(final WaitCondition waitCondition, final int tries) { final int secondMillis = 1000; return invoke(waitCondition, tries * secondMillis, TimeUnit.MILLISECONDS, secondMillis); }
/** * We are going to wait to see if we got the event for a minute, if not we are going to do one more partition. */ private void waitForRateLimitInfo() { WaitUntil.invoke(new WaitUntil.WaitCondition() { @Override public boolean isFinished() { return limitReached; } @Override public String getWaitMessage() { return "Waiting for HipChat status for Rate Limit"; } }, RATE_LIMIT_TIMEOUT, TimeUnit.SECONDS, retryInterval); }
private void waitUntilModulesAreDisabled(final List<ModuleDescriptor> descriptors) { WaitUntil.invoke(new WaitUntil.WaitCondition() { public boolean isFinished() { for (ModuleDescriptor descriptor : descriptors) { ModuleDescriptor<?> module = pluginAccessor.getEnabledPluginModule(descriptor.getCompleteKey()); if (module != null) { return false; } } return true; } public String getWaitMessage() { return "Waiting until the enabled plugins are available"; } }); }
private void waitUntilModulesAreEnabled(final List<ModuleDescriptor> generatedDescriptors) WaitUntil.invoke(new WaitUntil.WaitCondition()
WaitUntil.invoke(new WaitUntil.WaitCondition() { private long singlePluginTimeout; private long singlePluginWarn;
WaitUntil.invoke(new WaitUntil.WaitCondition()