Issue #1004 make dispose/shutdown of plot jobs more permenant by joining.
Former-commit-id:c2732bff32
[formerly3f92e385a6
] [formerly3abfef55cc
] [formerlyc1bacb33b1
[formerly3abfef55cc
[formerly 6cb8e45b4f3a78abcfeee982306684eef025fd3d]]] Former-commit-id:c1bacb33b1
Former-commit-id: ae7e4d38b5d51780ccb3e30c473ea1697431b7a0 [formerlyf711cfdae2
] Former-commit-id:0e48e6e4fd
This commit is contained in:
parent
cc62b9875d
commit
445232b6d5
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