Merge "Issue #1004 make dispose/shutdown of plot jobs more permenant by joining." into development_on_ss_builds
Former-commit-id:b704e8d3f4
[formerly 65ea6e46e059a058d5a46b0cf28f1b50c3057744] Former-commit-id:6c758b7c84
This commit is contained in:
commit
81bba55a1e
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