@Override public void checkCancelled() throws InterruptedException { parent.checkCancelled(); }
private void waitForDone() throws InterruptedException, IOException { assert executing.isEmpty() == false; monitor.checkCancelled(); Executing done = doneQueue.take(); assert done.isDone(); handleDone(done); while (true) { monitor.checkCancelled(); Executing rest = doneQueue.poll(); if (rest == null) { break; } assert rest.isDone(); handleDone(rest); } }
@Override public final void execute( PhaseMonitor monitor, ExecutionContext context, List<? extends Job> jobs, ErrorHandler errorHandler) throws InterruptedException, IOException { if (monitor == null) { throw new IllegalArgumentException("monitor must not be null"); //$NON-NLS-1$ } if (context == null) { throw new IllegalArgumentException("context must not be null"); //$NON-NLS-1$ } if (jobs == null) { throw new IllegalArgumentException("jobs must not be null"); //$NON-NLS-1$ } if (errorHandler == null) { throw new IllegalArgumentException("errorHandler must not be null"); //$NON-NLS-1$ } monitor.open(jobs.size()); try { monitor.checkCancelled(); Engine engine = new Engine(getJobExecutor(), monitor, context, errorHandler, jobs); engine.run(); } finally { monitor.close(); } }
private boolean submit(Job job) throws InterruptedException, IOException { assert job != null; monitor.checkCancelled(); try { Executing execution = executor.submit( monitor.createJobMonitor(job.getId(), 1), context, job, doneQueue); executing.put(execution.getJob().getId(), execution); return true; } catch (IOException e) { sawError = true; handleException(job, e); return false; } }