progress.started(); iterator = collection.features(); while (!progress.isCanceled() && iterator.hasNext()) { Feature feature = null; try { visitor.visit(feature); if (size > 0) { progress.progress(position++ / size); progress.exceptionOccurred(erp); String fid = feature == null ? "feature" : feature.getIdentifier().toString(); throw new IOException( progress.complete(); if (iterator != null) { iterator.close();
public void setTask(InternationalString task) { delegate.setTask(task); }
/** * @param progress * @param writer */ private void reportProgress(float progress, ImageWriter writer) { monitor.progress(progress); if (monitor.isCanceled()) writer.abort(); }
public final Map<String, Object> execute(Map<String, Object> input, ProgressListener monitor) { if (started) throw new IllegalStateException("Process can only be run once"); started = true; if (monitor == null) monitor = new NullProgressListener(); try { if (monitor.isCanceled()) return null; // respect isCanceled this.input = input; result = new HashMap<String, Object>(); process(); return result; } catch (Throwable eek) { monitor.exceptionOccurred(eek); return null; } finally { monitor.complete(); } }
public CoverageSource access( Name name, Map<String, Serializable> params, AccessType accessType, Hints hints, ProgressListener listener) throws IOException { if (listener == null) { listener = new NullProgressListener(); } listener.started(); try { return new NetCDFSource((NetCDFImageReader) reader, name); } catch (Throwable e) { LOGGER.log(Level.SEVERE, "Failed to access the NetCDF source", e); listener.exceptionOccurred(e); return null; } finally { listener.complete(); } }
TimeParser timeParser = new TimeParser(configuration.getMaxAnimationFrames()); Collection parsedTimes = timeParser.parse(time); progressListener.started(); int count = 1; Map<String, WebMapServer> serverCache = new HashMap<>(); futures.add(future); progressListener.progress(90 * (((float) count) / totalTimes)); progressListener.setTask( new SimpleInternationalString( "Generated frames " + count + " out of " + totalTimes)); if (progressListener.isCanceled()) { throw new ProcessException("Bailing out due to progress cancellation"); future.get(); progressListener.progress(100); } finally { executor.shutdown();
public void complete() { delegate.complete(); }
return oldRootTree.getId(); if (progress.isCanceled()) { return null; while (diffs.hasNext()) { if (numChanges != 0) { progress.progress((float) (++i * 100) / numChanges); if (progress.isCanceled()) { return null; if (progress.isCanceled()) { return null; progress.complete();
public boolean isCanceled() { return delegate.isCanceled(); }
public void visitItem(Object item) { SimpleFeature feature = null; try { feature = (SimpleFeature) item; visitor.visit(feature); } catch (Throwable t) { progress.exceptionOccurred(t); String fid = feature == null ? "feature" : feature.getIdentifier().toString(); problem[0] = new IOException("Problem visiting " + fid + ":" + t, t); } finally { progress.progress(count / size); } } });
public void getNotification(ProcessingEvent event) { listener.setTask(new SimpleInternationalString(event.getMessage())); if (event.getPercentage() >= 0) { listener.progress((float) event.getPercentage()); } // stop requested? if (listener.isCanceled()) { oef.stopThread(); } }
public void started() { delegate.started(); }
public void complete() { delegate.progress(start + amount); progress = 100.0f; }
progressListener.complete(); progressListener.exceptionOccurred(processException);
public void exceptionOccurred(Throwable exception) { delegate.exceptionOccurred(exception); }
running = pid != null; remoteClient.registerProcessClientListener(this); while (running && (listener != null && !listener.isCanceled())) { doneSignal.await(SIGNAL_TIMEOUT, TimeUnit.SECONDS); listener.exceptionOccurred(e); if (listener != null && listener.isCanceled()) { LOGGER.log( Level.WARNING,
private void checkForCancellation(ProgressListener listener) { if (listener.isCanceled()) { throw new ProcessException(listener.getTask().toString()); } }