1 /******************************************************************************* 2 * Copyright (c) 2000, 2005 IBM Corporation and others. 3 * All rights reserved. This program and the accompanying materials 4 * are made available under the terms of the Eclipse Public License v1.0 5 * which accompanies this distribution, and is available at 6 * http://www.eclipse.org/legal/epl-v10.html 7 * 8 * Contributors: 9 * IBM Corporation - initial API and implementation 10 *******************************************************************************/ 11 package org.eclipse.debug.core.model; 12 13 14 import org.eclipse.debug.core.DebugException; 15 16 /** 17 * Provides the ability to suspend and resume a thread 18 * or debug target. 19 * <p> 20 * Clients may implement this interface. 21 * </p> 22 */ 23 public interface ISuspendResume { 24 /** 25 * Returns whether this element can currently be resumed. 26 * 27 * @return whether this element can currently be resumed 28 */ 29 public boolean canResume(); 30 /** 31 * Returns whether this element can currently be suspended. 32 * 33 * @return whether this element can currently be suspended 34 */ 35 public boolean canSuspend(); 36 /** 37 * Returns whether this element is currently suspended. 38 * 39 * @return whether this element is currently suspended 40 */ 41 public boolean isSuspended(); 42 /** 43 * Causes this element to resume its execution, generating a <code>RESUME</code> event. 44 * Has no effect on an element that is not suspended. This call is non-blocking. 45 * 46 * @exception DebugException on failure. Reasons include:<ul> 47 * <li>TARGET_REQUEST_FAILED - The request failed in the target 48 * <li>NOT_SUPPORTED - The capability is not supported by the target 49 * </ul> 50 */ 51 public void resume() throws DebugException; 52 /** 53 * Causes this element to suspend its execution, generating a <code>SUSPEND</code> event. 54 * Has no effect on an already suspended element. 55 * Implementations may be blocking or non-blocking. 56 * 57 * @exception DebugException on failure. Reasons include:<ul> 58 * <li>TARGET_REQUEST_FAILED - The request failed in the target 59 * <li>NOT_SUPPORTED - The capability is not supported by the target 60 * </ul> 61 */ 62 public void suspend() throws DebugException; 63 } 64