From 8068562b829f7f9b2800d7c848964eb063876c79 Mon Sep 17 00:00:00 2001 From: Tobias Schwarz Date: Fri, 15 Mar 2013 13:57:29 +0100 Subject: Target Explorer: simulator service support --- .../services/interfaces/ISimulatorService.java | 137 ++++++++++++--------- 1 file changed, 82 insertions(+), 55 deletions(-) (limited to 'target_explorer/plugins/org.eclipse.tcf.te.runtime.services') 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 4023183ff..9bdf8b78f 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 @@ -1,55 +1,82 @@ -/******************************************************************************* - * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved. - * This program and the accompanying materials are made available under the terms - * of the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Wind River Systems - initial API and implementation - *******************************************************************************/ -package org.eclipse.tcf.te.runtime.services.interfaces; - -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback; - -/** - * Simulator service. - *
- * Allows to start/stop external simulators. - *
- * Simulator instance related UI parts, like configuration panels, are retrieved
- * by clients via the {@link IUIService}.
- */
-public interface ISimulatorService extends IService {
-
- /**
- * Starts the simulator.
- *
- * @param context The context. Must not be null
.
- * @param config The encoded simulator settings or null
.
- * @param callback The callback to invoke once the operation finishes. Must not be null
.
- * @param monitor The progress monitor or null
.
- */
- public void start(Object context, String config, ICallback callback, IProgressMonitor monitor);
-
- /**
- * Stops the simulator.
- *
- * @param context The context. Must not be null
.
- * @param config The encoded simulator settings or null
.
- * @param callback The callback to invoke once the operation finishes. Must not be null
.
- * @param monitor The progress monitor or null
.
- */
- public void stop(Object context, String config, ICallback callback, IProgressMonitor monitor);
-
- /**
- * Checks if the simulator is running.
- *
- * The result of the check is return as {@link Boolean} object by the callback's {@link ICallback#getResult()} method.
- *
- * @param context The context. Must not be null
.
- * @param config The encoded simulator settings or null
.
- * @param callback The callback to invoke once the operation finishes. Must not be null
.
- */
- public void isRunning(Object context, String config, ICallback callback);
-}
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.runtime.services.interfaces;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
+
+/**
+ * Simulator service.
+ *
+ * Allows to start/stop external simulators. + *
+ * Simulator instance related UI parts, like configuration panels, are retrieved
+ * by clients via the {@link IUIService}.
+ */
+public interface ISimulatorService extends IService {
+
+ /**
+ * The constants for the simulator state.
+ */
+ public enum State { Stopped, Starting, Started, Stopping }
+
+ /**
+ * Starts the simulator.
+ *
+ * @param context The context. Must not be null
.
+ * @param config The encoded simulator settings or null
.
+ * @param callback The callback to invoke once the operation finishes. Must not be null
.
+ * @param monitor The progress monitor or null
.
+ */
+ public void start(Object context, String config, ICallback callback, IProgressMonitor monitor);
+
+ /**
+ * Stops the simulator.
+ *
+ * @param context The context. Must not be null
.
+ * @param config The encoded simulator settings or null
.
+ * @param callback The callback to invoke once the operation finishes. Must not be null
.
+ * @param monitor The progress monitor or null
.
+ */
+ public void stop(Object context, String config, ICallback callback, IProgressMonitor monitor);
+
+ /**
+ * Checks if the simulator is running.
+ *
+ * The result of the check is return as {@link Boolean} object by the callback's {@link ICallback#getResult()} method.
+ *
+ * @param context The context. Must not be null
.
+ * @param config The encoded simulator settings or null
.
+ * @param callback The callback to invoke once the operation finishes. Must not be null
.
+ */
+ public void isRunning(Object context, String config, ICallback callback);
+
+ /**
+ * Get the state of the simulator for the given context.
+ * @param context The context. Must not be null
.
+ * @param config The encoded simulator settings or null
.
+ * @return The simulator state.
+ */
+ public State getState(Object context, String config);
+
+ /**
+ * Get the default config for the simulator.
+ * The returned config does not need to be valid!
+ * @return The default config or null
.
+ */
+ public String getDefaultConfig();
+
+ /**
+ * Validate a simulator config.
+ * @param config The config to validate.
+ * @return true
if the config is valid.
+ */
+ public boolean isValidConfig(String config);
+}
--
cgit v1.2.3