Fixed handling of JobStatus for stopped RMs
diff --git a/rms/org.eclipse.ptp.rm.jaxb.control.core/src/org/eclipse/ptp/rm/jaxb/control/JAXBResourceManagerControl.java b/rms/org.eclipse.ptp.rm.jaxb.control.core/src/org/eclipse/ptp/rm/jaxb/control/JAXBResourceManagerControl.java
index 039178f..809c20c 100644
--- a/rms/org.eclipse.ptp.rm.jaxb.control.core/src/org/eclipse/ptp/rm/jaxb/control/JAXBResourceManagerControl.java
+++ b/rms/org.eclipse.ptp.rm.jaxb.control.core/src/org/eclipse/ptp/rm/jaxb/control/JAXBResourceManagerControl.java
@@ -264,19 +264,16 @@
@Override
protected IJobStatus doGetJobStatus(String jobId, IProgressMonitor monitor) throws CoreException {
try {
- if (!resourceManagerIsActive() || (monitor != null && monitor.isCanceled())) {
- return new CommandJobStatus(getResourceManager().getUniqueName(), jobId, IJobStatus.COMPLETED, null, this);
- }
pinTable.pin(jobId);
-
- SubMonitor progress = SubMonitor.convert(monitor, 100);
+ ICommandJobStatus status = jobStatusMap.getStatus(jobId);
/*
* First check to see when the last call was made; throttle requests
* coming in intervals less than
* ICommandJobStatus.UPDATE_REQUEST_INTERVAL
*/
- ICommandJobStatus status = jobStatusMap.getStatus(jobId);
+ SubMonitor progress = SubMonitor.convert(monitor, 100);
+
if (status != null) {
if (IJobStatus.COMPLETED.equals(status.getState())) {
/*
@@ -304,7 +301,7 @@
PropertyType p = (PropertyType) rmVarMap.get(jobId);
CommandType job = controlData.getGetJobStatus();
- if (job != null) {
+ if (job != null && resourceManagerIsActive() && !progress.isCanceled()) {
p = new PropertyType();
p.setVisible(false);
p.setName(jobId);
@@ -634,7 +631,8 @@
}
/**
- * Run the shut down commands, if any
+ * Run the shut down commands, if any. Cancel any running interactive
+ * processes.
*
* @throws CoreException
*/
diff --git a/rms/org.eclipse.ptp.rm.lml_jaxb/src/org/eclipse/ptp/rm/lml_jaxb/actions/ActionUtils.java b/rms/org.eclipse.ptp.rm.lml_jaxb/src/org/eclipse/ptp/rm/lml_jaxb/actions/ActionUtils.java
index f035864..e9f8842 100644
--- a/rms/org.eclipse.ptp.rm.lml_jaxb/src/org/eclipse/ptp/rm/lml_jaxb/actions/ActionUtils.java
+++ b/rms/org.eclipse.ptp.rm.lml_jaxb/src/org/eclipse/ptp/rm/lml_jaxb/actions/ActionUtils.java
@@ -157,6 +157,9 @@
*/
public static void maybeUpdateJobState(JobStatusData job, TableView view, IProgressMonitor monitor) throws CoreException {
final IResourceManager rm = PTPCorePlugin.getDefault().getModelManager().getResourceManagerFromUniqueName(job.getRmId());
+ if (!rm.getState().equals(IResourceManager.STARTED_STATE)) {
+ return;
+ }
final IResourceManagerControl control = rm.getControl();
final IJobStatus refreshed = control.getJobStatus(job.getJobId(), monitor);
job.updateState(refreshed);