Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-01-19 00:56:30 -0500
committerUwe Stieber2013-01-19 00:56:30 -0500
commitb49dd63777380a0cd0d53202c3a882f30d7f3d9a (patch)
treebc3173249d87f8064463d86ff4d0edb5e419d8eb /target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core
parentb17c812c54b20b866170bef7a2ccaecc72a0bf94 (diff)
downloadorg.eclipse.tcf-b49dd63777380a0cd0d53202c3a882f30d7f3d9a.tar.gz
org.eclipse.tcf-b49dd63777380a0cd0d53202c3a882f30d7f3d9a.tar.xz
org.eclipse.tcf-b49dd63777380a0cd0d53202c3a882f30d7f3d9a.zip
Target Explorer: Fix Bugzilla 398504 - [SysMonitor] Provide command line for each process
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java5
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java110
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java2
3 files changed, 70 insertions, 47 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java
index 3de43db7a..6943f6ef0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/interfaces/IProcessContextNodeProperties.java
@@ -25,4 +25,9 @@ public interface IProcessContextNodeProperties {
* The context name. If set, used in the UI to represent the context node.
*/
public static final String PROPERTY_NAME = IModelNode.PROPERTY_NAME;
+
+ /**
+ * The command line of the context. The command line is a string array.
+ */
+ public static final String PROPERTY_CMD_LINE = "cmdline"; //$NON-NLS-1$
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
index d0afad1aa..84e693c95 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelRefreshService.java
@@ -260,12 +260,20 @@ public class RuntimeModelRefreshService extends AbstractModelService<IRuntimeMod
public void doneGetContext(IToken token, Exception error, SysMonitorContext context) {
((IProcessContextNode)node).setSysMonitorContext(context);
- // Get the process context
- service.getContext(contextId, new IProcesses.DoneGetContext() {
+ // Get the command line of the context
+ sysMonService.getCommandLine(contextId, new ISysMonitor.DoneGetCommandLine() {
@Override
- public void doneGetContext(IToken token, Exception error, IProcesses.ProcessContext context) {
- ((IProcessContextNode)node).setProcessContext(context);
- callback.done(RuntimeModelRefreshService.this, Status.OK_STATUS);
+ public void doneGetCommandLine(IToken token, Exception error, String[] cmd_line) {
+ node.setProperty(IProcessContextNodeProperties.PROPERTY_CMD_LINE, error == null ? cmd_line : null);
+
+ // Get the process context
+ service.getContext(contextId, new IProcesses.DoneGetContext() {
+ @Override
+ public void doneGetContext(IToken token, Exception error, IProcesses.ProcessContext context) {
+ ((IProcessContextNode)node).setProcessContext(context);
+ callback.done(RuntimeModelRefreshService.this, Status.OK_STATUS);
+ }
+ });
}
});
}
@@ -345,51 +353,59 @@ public class RuntimeModelRefreshService extends AbstractModelService<IRuntimeMod
node.setType(parent == null ? TYPE.Process : TYPE.Thread);
contexts.put(node.getUUID(), node);
- // Query the corresponding process context
- service.getContext(contextId, new IProcesses.DoneGetContext() {
+ // Get the command line of the context
+ sysMonService.getCommandLine(contextId, new ISysMonitor.DoneGetCommandLine() {
@Override
- public void doneGetContext(IToken token, Exception error, IProcesses.ProcessContext context) {
- // Errors are ignored
- node.setProcessContext(context);
- if (context != null) node.setProperty(IProcessContextNodeProperties.PROPERTY_NAME, context.getName());
-
- // Get the asynchronous refresh context adapter
- final IAsyncRefreshableCtx refreshable = (IAsyncRefreshableCtx)node.getAdapter(IAsyncRefreshableCtx.class);
-
- // Refresh the children of the node if the depth is still larger than 0
- if (depth - 1 > 0 && (refreshable == null || !refreshable.getQueryState(QueryType.CHILD_LIST).equals(QueryState.IN_PROGRESS))) {
- if (refreshable != null) {
- // Mark the refresh as in progress
- refreshable.setQueryState(QueryType.CHILD_LIST, QueryState.IN_PROGRESS);
- // Create a new pending operation node and associate it with the refreshable
- PendingOperationModelNode pendingNode = new PendingOperationNode();
- pendingNode.setParent(node);
- refreshable.setPendingOperationNode(pendingNode);
- }
-
- // Don't send change events while refreshing
- final boolean changed = node.setChangeEventsEnabled(false);
- // Initiate the refresh
- List<IProcessContextNode> oldChildren = node.getChildren(IProcessContextNode.class);
- refreshContextChildren(oldChildren, model, node, depth - 1, new Callback() {
- @Override
- protected void internalDone(Object caller, IStatus status) {
- // Mark the refresh as done
- refreshable.setQueryState(QueryType.CHILD_LIST, QueryState.DONE);
- // Reset the pending operation node
- refreshable.setPendingOperationNode(null);
- // Re-enable the change events if they had been enabled before
- if (changed) node.setChangeEventsEnabled(true);
- // Trigger a refresh of the view content
- ChangeEvent event = new ChangeEvent(node, IContainerModelNode.NOTIFY_CHANGED, null, null);
- EventManager.getInstance().fireEvent(event);
- // Finally invoke the callback
+ public void doneGetCommandLine(IToken token, Exception error, String[] cmd_line) {
+ node.setProperty(IProcessContextNodeProperties.PROPERTY_CMD_LINE, error == null ? cmd_line : null);
+
+ // Query the corresponding process context
+ service.getContext(contextId, new IProcesses.DoneGetContext() {
+ @Override
+ public void doneGetContext(IToken token, Exception error, IProcesses.ProcessContext context) {
+ // Errors are ignored
+ node.setProcessContext(context);
+ if (context != null) node.setProperty(IProcessContextNodeProperties.PROPERTY_NAME, context.getName());
+
+ // Get the asynchronous refresh context adapter
+ final IAsyncRefreshableCtx refreshable = (IAsyncRefreshableCtx)node.getAdapter(IAsyncRefreshableCtx.class);
+
+ // Refresh the children of the node if the depth is still larger than 0
+ if (depth - 1 > 0 && (refreshable == null || !refreshable.getQueryState(QueryType.CHILD_LIST).equals(QueryState.IN_PROGRESS))) {
+ if (refreshable != null) {
+ // Mark the refresh as in progress
+ refreshable.setQueryState(QueryType.CHILD_LIST, QueryState.IN_PROGRESS);
+ // Create a new pending operation node and associate it with the refreshable
+ PendingOperationModelNode pendingNode = new PendingOperationNode();
+ pendingNode.setParent(node);
+ refreshable.setPendingOperationNode(pendingNode);
+ }
+
+ // Don't send change events while refreshing
+ final boolean changed = node.setChangeEventsEnabled(false);
+ // Initiate the refresh
+ List<IProcessContextNode> oldChildren = node.getChildren(IProcessContextNode.class);
+ refreshContextChildren(oldChildren, model, node, depth - 1, new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ // Mark the refresh as done
+ refreshable.setQueryState(QueryType.CHILD_LIST, QueryState.DONE);
+ // Reset the pending operation node
+ refreshable.setPendingOperationNode(null);
+ // Re-enable the change events if they had been enabled before
+ if (changed) node.setChangeEventsEnabled(true);
+ // Trigger a refresh of the view content
+ ChangeEvent event = new ChangeEvent(node, IContainerModelNode.NOTIFY_CHANGED, null, null);
+ EventManager.getInstance().fireEvent(event);
+ // Finally invoke the callback
+ innerCallback.done(RuntimeModelRefreshService.this, Status.OK_STATUS);
+ }
+ });
+ } else {
innerCallback.done(RuntimeModelRefreshService.this, Status.OK_STATUS);
}
- });
- } else {
- innerCallback.done(RuntimeModelRefreshService.this, Status.OK_STATUS);
- }
+ }
+ });
}
});
} else {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
index 95ff83016..33db65f67 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.core/src/org/eclipse/tcf/te/tcf/processes/core/model/runtime/services/RuntimeModelUpdateService.java
@@ -16,6 +16,7 @@ import org.eclipse.tcf.te.runtime.model.interfaces.contexts.IAsyncRefreshableCtx
import org.eclipse.tcf.te.tcf.core.model.interfaces.services.IModelUpdateService;
import org.eclipse.tcf.te.tcf.core.model.services.AbstractModelService;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNode;
+import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.IProcessContextNodeProperties;
import org.eclipse.tcf.te.tcf.processes.core.model.interfaces.runtime.IRuntimeModel;
/**
@@ -76,6 +77,7 @@ public class RuntimeModelUpdateService extends AbstractModelService<IRuntimeMode
if (dst instanceof IProcessContextNode && src instanceof IProcessContextNode) {
((IProcessContextNode)dst).setSysMonitorContext(((IProcessContextNode)src).getSysMonitorContext());
((IProcessContextNode)dst).setProcessContext(((IProcessContextNode)src).getProcessContext());
+ dst.setProperty(IProcessContextNodeProperties.PROPERTY_CMD_LINE, src.getProperty(IProcessContextNodeProperties.PROPERTY_CMD_LINE));
}
// Re-enable the change events

Back to the top