Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2015-01-22 02:36:12 -0500
committerTobias Schwarz2015-01-22 02:36:12 -0500
commite1ccaaee40a51f1eae7c4bff508599a2871a1739 (patch)
treeb6e60f80dcb268e21d4a280cb989d1236250a312
parent94f7d9d4f218d829cf1e9bcaf5f2dc423b0182fa (diff)
downloadorg.eclipse.tcf-e1ccaaee40a51f1eae7c4bff508599a2871a1739.tar.gz
org.eclipse.tcf-e1ccaaee40a51f1eae7c4bff508599a2871a1739.tar.xz
org.eclipse.tcf-e1ccaaee40a51f1eae7c4bff508599a2871a1739.zip
SM: add method to use already running simulator instead of starting new
one.
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/ISimulatorService.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java11
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java10
3 files changed, 29 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/ISimulatorService.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/ISimulatorService.java
index 1f666c049..47c9ee9d1 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/ISimulatorService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.services/src/org/eclipse/tcf/te/runtime/services/interfaces/ISimulatorService.java
@@ -50,6 +50,16 @@ public interface ISimulatorService extends IService {
public void start(Object context, String config, ICallback callback, IProgressMonitor monitor);
/**
+ * Use a running simulator.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param config The encoded simulator settings or <code>null</code>.
+ * @param callback The callback to invoke once the operation finishes. Must not be <code>null</code>.
+ * @param monitor The progress monitor or <code>null</code>.
+ */
+ public void useRunning(Object context, String config, ICallback callback, IProgressMonitor monitor);
+
+ /**
* Stops the simulator.
*
* @param context The context. Must not be <code>null</code>.
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java
index 0f6d2c425..0e63f140a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/services/AbstractSimulatorService.java
@@ -9,11 +9,22 @@
*******************************************************************************/
package org.eclipse.tcf.te.tcf.locator.services;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.services.AbstractService;
import org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService;
+import org.eclipse.tcf.te.runtime.utils.StatusHelper;
/**
* Abstract simulator service implementation.
*/
public abstract class AbstractSimulatorService extends AbstractService implements ISimulatorService {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService#useRunning(java.lang.Object, java.lang.String, org.eclipse.tcf.te.runtime.interfaces.callback.ICallback, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public void useRunning(Object context, String config, ICallback callback, IProgressMonitor monitor) {
+ callback.done(this, StatusHelper.getStatus(new UnsupportedOperationException("Using already running '" + getName() + "' is not supported."))); //$NON-NLS-1$ //$NON-NLS-2$
+ }
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java
index 3b7d9cf22..97f984229 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/utils/SimulatorUtils.java
@@ -157,8 +157,14 @@ public final class SimulatorUtils {
}
}, monitor);
} else {
- callback.setResult(Boolean.FALSE);
- callback.done(this, Status.OK_STATUS);
+ // Start the simulator
+ result.service.useRunning(peerNode, result.settings, new Callback() {
+ @Override
+ protected void internalDone(Object caller, IStatus status) {
+ callback.setResult(new Boolean(status.isOK()));
+ callback.done(caller, status);
+ }
+ }, monitor);
}
}
}, monitor);

Back to the top