| /******************************************************************************* |
| * Copyright (c) 2004-2008 Andras Schmidt, Andras Balogh, Istvan Rath and Daniel Varro |
| * 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: |
| * Andras Schmidt, Andras Balogh, Istvan Rath - initial API and implementation |
| *******************************************************************************/ |
| |
| package org.eclipse.viatra2.interpreters.debugInterface; |
| |
| /** |
| * This interface represents a running instance of a machine. Debugger should |
| * use this interface to start stop, and monitor the process. State get and |
| * state set methods should only be used, when in stopped state. All threads are |
| * in the same state as the process state. |
| * |
| * @author Andras Schmidt |
| * |
| */ |
| public interface RunningProcess { |
| /** |
| * Means that the macine is being inited before running the first rule. |
| */ |
| public static int STATE_INIT = 3; |
| |
| /** |
| * Means that the machine is running |
| */ |
| public static int STATE_RUNNING = 0; |
| |
| /** |
| * Means that the machine is going to stop at the next consistent breakpoint |
| * state. |
| */ |
| public static int STATE_STOPPING = 1; |
| |
| /** |
| * Means that the machine is stopped. |
| */ |
| public static int STATE_STOPPED = 2; |
| |
| /** |
| * Means that the machine is ready (runned normally or exited with |
| * exception) |
| */ |
| public static int STATE_READY = 4; |
| |
| public int getState(); |
| |
| /** |
| * Use in running state: the machine goes to stopping state so it will stop |
| * as soon as possible. |
| * |
| */ |
| public void stop(); |
| |
| /** |
| * Use in stopped state: the machine goes to running state. |
| * |
| */ |
| public void start(); |
| |
| /** |
| * Terminate the process. Stops and then goes to ready state. |
| * |
| */ |
| public void terminate() throws NotSupportedException; |
| |
| /** |
| * Add a listener to the process. |
| * |
| * @param listener |
| */ |
| public void addListener(RunningProcessListener listener); |
| |
| /** |
| * Remove a listener from the process. |
| * |
| * @param listener |
| */ |
| public void removeListener(RunningProcessListener listener); |
| |
| /** |
| * Return the threads of the process. |
| * |
| * @return |
| */ |
| public RunningThread[] getThreads(); |
| |
| public Exception getException(); |
| } |