Issue #1363 The intance of PythonGuidanceJob can now be created on any thread.
Change-Id: I4f24c904007df455aee557cd80cac8836da3d517 Former-commit-id:9b6bf382f7
[formerly7b5f60f2cc
] [formerly5fde71e598
] [formerlye7d453bd77
[formerly5fde71e598
[formerly 1640c177e60e8e3ba522568a662bedda0cd7546e]]] Former-commit-id:e7d453bd77
Former-commit-id: 252282391a361f02e921c16d8c1e364551da52db [formerly48c5724c06
] Former-commit-id:e2b28b7f96
This commit is contained in:
parent
1b98611701
commit
9fab4bca56
2 changed files with 13 additions and 18 deletions
|
@ -29,9 +29,6 @@ import jep.JepException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Status;
|
import org.eclipse.core.runtime.Status;
|
||||||
import org.eclipse.swt.events.DisposeEvent;
|
|
||||||
import org.eclipse.swt.events.DisposeListener;
|
|
||||||
import org.eclipse.ui.PlatformUI;
|
|
||||||
|
|
||||||
import com.raytheon.uf.common.localization.IPathManager;
|
import com.raytheon.uf.common.localization.IPathManager;
|
||||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||||
|
@ -62,6 +59,9 @@ import com.raytheon.viz.aviation.monitor.AvnPyUtil;
|
||||||
* Apr 14, 2011 8065 rferrel Implemented enqueue to place
|
* Apr 14, 2011 8065 rferrel Implemented enqueue to place
|
||||||
* Alerts at the front of the queue
|
* Alerts at the front of the queue
|
||||||
* and work with data caching.
|
* and work with data caching.
|
||||||
|
* Nov 28, 2012 1363 rferrel No longer add a dispose listner so the
|
||||||
|
* creation of instance can be done on
|
||||||
|
* any thread.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -107,7 +107,6 @@ public class PythonGuidanceJob extends AbstractQueueJob<GuidanceRequest> {
|
||||||
super(name);
|
super(name);
|
||||||
suspendMonitor = new Object();
|
suspendMonitor = new Object();
|
||||||
suspendJob = false;
|
suspendJob = false;
|
||||||
setupDispose();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -147,6 +146,13 @@ public class PythonGuidanceJob extends AbstractQueueJob<GuidanceRequest> {
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final static synchronized void dispose() {
|
||||||
|
if (instance != null) {
|
||||||
|
instance.shutdown();
|
||||||
|
instance = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shutdowns the running instance and cleans up any threads.
|
* Shutdowns the running instance and cleans up any threads.
|
||||||
*/
|
*/
|
||||||
|
@ -197,20 +203,6 @@ public class PythonGuidanceJob extends AbstractQueueJob<GuidanceRequest> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set up dispose listener to clean up when Cave goes away.
|
|
||||||
*/
|
|
||||||
private void setupDispose() {
|
|
||||||
|
|
||||||
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell()
|
|
||||||
.addDisposeListener(new DisposeListener() {
|
|
||||||
@Override
|
|
||||||
public void widgetDisposed(DisposeEvent e) {
|
|
||||||
shutdown();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
|
|
@ -59,6 +59,7 @@ import com.raytheon.viz.aviation.climatology.WeatherPlotDialog;
|
||||||
import com.raytheon.viz.aviation.editor.ITafSettable;
|
import com.raytheon.viz.aviation.editor.ITafSettable;
|
||||||
import com.raytheon.viz.aviation.editor.TafViewerEditorDlg;
|
import com.raytheon.viz.aviation.editor.TafViewerEditorDlg;
|
||||||
import com.raytheon.viz.aviation.editor.TafViewerEditorDlg.TafSettings;
|
import com.raytheon.viz.aviation.editor.TafViewerEditorDlg.TafSettings;
|
||||||
|
import com.raytheon.viz.aviation.guidance.PythonGuidanceJob;
|
||||||
import com.raytheon.viz.aviation.guidance.ViewerTab;
|
import com.raytheon.viz.aviation.guidance.ViewerTab;
|
||||||
import com.raytheon.viz.aviation.model.ForecastModel;
|
import com.raytheon.viz.aviation.model.ForecastModel;
|
||||||
import com.raytheon.viz.aviation.monitor.CcfpMonitorObserver;
|
import com.raytheon.viz.aviation.monitor.CcfpMonitorObserver;
|
||||||
|
@ -141,6 +142,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
|
||||||
* 10/11/2012 1229 rferrel Changes for non-blocking TafViewerEditorDlg.
|
* 10/11/2012 1229 rferrel Changes for non-blocking TafViewerEditorDlg.
|
||||||
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
* 10/15/2012 1229 rferrel Changes for non-blocking HelpUsageDlg.
|
||||||
* 11/26/2012 1298 rferrel Non-blocking dialog cleanup.
|
* 11/26/2012 1298 rferrel Non-blocking dialog cleanup.
|
||||||
|
* 11/28/2012 1363 rferrel Dispose of PythonGuidanceJob when closing.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author grichard
|
* @author grichard
|
||||||
|
@ -895,6 +897,7 @@ public class TafMonitorDlg extends CaveSWTDialog {
|
||||||
|
|
||||||
tveDlg.disposeDialog();
|
tveDlg.disposeDialog();
|
||||||
PythonCacheGuidanceJob.dispose();
|
PythonCacheGuidanceJob.dispose();
|
||||||
|
PythonGuidanceJob.dispose();
|
||||||
return close();
|
return close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue