private void checkExecutionStopRequest(GraphRewrite event) { if (ticks.incrementAndGet() % 20 == 0) if (event.shouldWindupStop()) throw new WindupStopException("Stop requested while analyzing Java files."); }
private void checkCancelled(GraphRewrite event) { if (event.shouldWindupStop()) { throw new WindupStopException("Request to stop detected during unzipping of archives"); } }
private void checkExecutionStopRequest(GraphRewrite event) { if (ticks.incrementAndGet() % 20 == 0) if (event.shouldWindupStop()) throw new WindupStopException("Stop requested while analyzing Java files."); }
private void checkCancelled(GraphRewrite event) { if (event.shouldWindupStop()) { throw new WindupStopException("Request to stop detected during unzipping of archives"); } }
@Override public void fileDecompiled(List<String> inputPath, String outputPath) { try { result.addDecompiled(inputPath, outputPath); } catch (WindupStopException stop) { this.cancelled = true; throw new WindupStopException(stop); } }
@Override public void fileDecompiled(List<String> inputPath, String outputPath) { try { result.addDecompiled(inputPath, outputPath); } catch (WindupStopException stop) { this.cancelled = true; throw new WindupStopException(stop); } }
@Override public void fileDecompiled(List<String> inputPaths, String outputPath) { try { result.addDecompiled(inputPaths, outputPath); delegate.fileDecompiled(inputPaths, outputPath); } catch (WindupStopException stop) { this.cancelled = true; throw new WindupStopException(stop); } }
@Override public void fileDecompiled(List<String> inputPaths, String outputPath) { try { result.addDecompiled(inputPaths, outputPath); delegate.fileDecompiled(inputPaths, outputPath); } catch (WindupStopException stop) { this.cancelled = true; throw new WindupStopException(stop); } }
private void printProgressEstimate(GraphRewrite event, ProgressEstimate estimate) { if (estimate.getWorked() % LOG_INTERVAL != 0) return; int timeRemainingInMillis = (int) estimate.getTimeRemainingInMillis(); if (timeRemainingInMillis > 0) { boolean windupStopRequested = event.ruleEvaluationProgress("Analyze Java", estimate.getWorked(), estimate.getTotal(), timeRemainingInMillis / 1000); if (windupStopRequested) { throw new WindupStopException(Util.WINDUP_BRAND_NAME_ACRONYM + " stop requested through ruleEvaluationProgress() during " + AnalyzeJavaFilesRuleProvider.class.getName()); } } LOG.info("Analyzed Java File: " + estimate.getWorked() + " / " + estimate.getTotal()); }
+ ex.getMessage(); log.log(Level.WARNING, msg + System.lineSeparator()+" (Rethrowing)"); throw new WindupStopException(msg, ex);
private void printProgressEstimate(GraphRewrite event, ProgressEstimate estimate) { if (estimate.getWorked() % LOG_INTERVAL != 0) return; int timeRemainingInMillis = (int) estimate.getTimeRemainingInMillis(); if (timeRemainingInMillis > 0) { boolean windupStopRequested = event.ruleEvaluationProgress("Analyze Java", estimate.getWorked(), estimate.getTotal(), timeRemainingInMillis / 1000); if (windupStopRequested) { throw new WindupStopException(Util.WINDUP_BRAND_NAME_ACRONYM + " stop requested through ruleEvaluationProgress() during " + AnalyzeJavaFilesRuleProvider.class.getName()); } } LOG.info("Analyzed Java File: " + estimate.getWorked() + " / " + estimate.getTotal()); }
+ ex.getMessage(); log.log(Level.WARNING, msg + System.lineSeparator()+" (Rethrowing)"); throw new WindupStopException(msg, ex);
throw new WindupStopException(stop);
throw new WindupStopException(ex); // To get a sane stack trace
throw new WindupStopException(ex); // To get a sane stack trace
@Override public void perform(GraphRewrite event, EvaluationContext context) { if (event.shouldWindupStop()) { throw new WindupStopException("Request to stop detected during iteration related to: " + messagePrefix); } if (totalIterations == -1) { @SuppressWarnings("unchecked") Iterable<WindupVertexFrame> frames = (Iterable<WindupVertexFrame>) event.getRewriteContext().get(Iteration.DEFAULT_VARIABLE_LIST_STRING); totalIterations = Iterators.asList(frames).size(); progressEstimate = new ProgressEstimate(totalIterations); } progressEstimate.addWork(1); if (progressEstimate.getWorked() % interval == 0) { if (estimateTimeRemaining) { long remainingTimeMillis = progressEstimate.getTimeRemainingInMillis(); if (remainingTimeMillis > 1000) event.ruleEvaluationProgress(messagePrefix, progressEstimate.getWorked(), totalIterations, (int) remainingTimeMillis / 1000); } LOG.info(messagePrefix + ": " + progressEstimate.getWorked() + " / " + totalIterations); } }
@Override public void perform(GraphRewrite event, EvaluationContext context) { if (event.shouldWindupStop()) { throw new WindupStopException("Request to stop detected during iteration related to: " + messagePrefix); } if (totalIterations == -1) { @SuppressWarnings("unchecked") Iterable<WindupVertexFrame> frames = (Iterable<WindupVertexFrame>) event.getRewriteContext().get(Iteration.DEFAULT_VARIABLE_LIST_STRING); totalIterations = Iterators.asList(frames).size(); progressEstimate = new ProgressEstimate(totalIterations); } progressEstimate.addWork(1); if (progressEstimate.getWorked() % interval == 0) { if (estimateTimeRemaining) { long remainingTimeMillis = progressEstimate.getTimeRemainingInMillis(); if (remainingTimeMillis > 1000) event.ruleEvaluationProgress(messagePrefix, progressEstimate.getWorked(), totalIterations, (int) remainingTimeMillis / 1000); } LOG.info(messagePrefix + ": " + progressEstimate.getWorked() + " / " + totalIterations); } }
throw new WindupStopException(Util.WINDUP_BRAND_NAME_ACRONYM+" stop requested in " + this.toString(), ex);
throw new WindupStopException(Util.WINDUP_BRAND_NAME_ACRONYM+" stop requested in " + this.toString(), ex);