Issue #1004 make dispose/shutdown of plot jobs more permenant by joining.
Former-commit-id: 4c5e5e0d54c523723edd16b756dc1caf208f5cd6
This commit is contained in:
parent
6dae0398d3
commit
c9774a4f03
3 changed files with 22 additions and 2 deletions
|
@ -184,8 +184,11 @@ public class PlotDataThreadPool {
|
|||
}
|
||||
|
||||
public void shutdown() {
|
||||
List<PlotModelDataRequestJob> jobListCopy = new ArrayList<PlotModelDataRequestJob>(
|
||||
jobList);
|
||||
jobList.clear();
|
||||
stationQueue.clear();
|
||||
for (PlotModelDataRequestJob job : jobList) {
|
||||
for (PlotModelDataRequestJob job : jobListCopy) {
|
||||
job.shutdown();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,6 +145,9 @@ public class PlotModelDataRequestJob extends Job {
|
|||
// TODO need to determine if this type of plot is a combination or
|
||||
// not
|
||||
combineData(stationQuery);
|
||||
if (monitor.isCanceled()) {
|
||||
break;
|
||||
}
|
||||
|
||||
for (PlotInfo[] infos : stationQuery) {
|
||||
// schedule next work for other jobs
|
||||
|
@ -341,8 +344,12 @@ public class PlotModelDataRequestJob extends Job {
|
|||
|
||||
public void shutdown() {
|
||||
this.cancel();
|
||||
try {
|
||||
join();
|
||||
} catch (InterruptedException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
}
|
||||
this.generatorJob.shutdown();
|
||||
this.generatorJob.clearImageCache();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.eclipse.core.runtime.jobs.Job;
|
|||
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.data.IRenderedImageCallback;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
|
@ -118,6 +119,9 @@ public class PlotModelGeneratorJob extends Job {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (monitor.isCanceled()) {
|
||||
break;
|
||||
}
|
||||
caller.modelGenerated(infos, image);
|
||||
} catch (Exception e) {
|
||||
statusHandler.error("Error creating plot", e);
|
||||
|
@ -152,5 +156,11 @@ public class PlotModelGeneratorJob extends Job {
|
|||
protected void shutdown() {
|
||||
cancel();
|
||||
taskQueue.clear();
|
||||
try {
|
||||
join();
|
||||
} catch (InterruptedException e) {
|
||||
statusHandler.handle(Priority.PROBLEM, e.getLocalizedMessage(), e);
|
||||
}
|
||||
clearImageCache();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue