@Override protected void realRun() throws SAXException, IOException, OsmTransferException { DataSet theirDataSet; try { synchronized (this) { if (canceled) return; multiObjectReader = MultiFetchServerObjectReader.create(); } initMultiFetchReader(multiObjectReader); theirDataSet = multiObjectReader.parseOsm( progressMonitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false)); missingPrimitives = multiObjectReader.getMissingPrimitives(); synchronized (this) { multiObjectReader = null; } new DataSetMerger(ds, theirDataSet).merge(); if (downloadRelations) { loadIncompleteRelationMembers(); } loadIncompleteNodes(); } catch (OsmTransferException e) { if (canceled) return; lastException = e; } }
@Override protected void cancel() { canceled = true; synchronized (this) { if (multiObjectReader != null) { multiObjectReader.cancel(); } if (objectReader != null) { objectReader.cancel(); } } }