< prev index next >

src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/RetryExecutor.java

Print this page

        

*** 51,60 **** --- 51,64 ---- void abort() { aborted = true; } + void stop() { + stop = true; + } + static RetryExecutor retryOnKnownErrorMessage(String v) { RetryExecutor result = new RetryExecutor(); return result.setExecutorInitializer(exec -> { exec.setOutputConsumer(output -> { if (!output.anyMatch(v::equals)) {
*** 72,83 **** --- 76,92 ---- executeLoop(() -> Executor.of(pb)); } private void executeLoop(Supplier<Executor> execSupplier) throws IOException { aborted = false; + stop = false; for (;;) { try { + if (stop) { + break; + } + Executor exec = execSupplier.get(); if (executorInitializer != null) { executorInitializer.accept(exec); } exec.executeExpectSuccess();
*** 97,104 **** --- 106,114 ---- } } private Consumer<Executor> executorInitializer; private boolean aborted; + private boolean stop; private int attempts; private int timeoutMillis; }
< prev index next >