KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > core > model > IThread


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  * A thread is a sequential flow of execution in a debug target.
18  * A thread contains stack frames. Stack frames are only available when the
19  * thread is suspended, and are returned in top-down order.
20  * Minimally, a thread supports the following:
21  * <ul>
22  * <li>suspend/resume
23  * <li>stepping
24  * <li>terminate
25  * </ul>
26  * <p>
27  * Clients may implement this interface.
28  * </p>
29  * @see ISuspendResume
30  * @see IStep
31  * @see ITerminate
32  * @see IStackFrame
33  */

34
35 public interface IThread extends IDebugElement, ISuspendResume, IStep, ITerminate {
36     /**
37      * Returns the stack frames contained in this thread. An
38      * empty collection is returned if this thread contains
39      * no stack frames, or is not currently suspended. Stack frames
40      * are returned in top down order.
41      *
42      * @return a collection of stack frames
43      * @exception DebugException if this method fails. Reasons include:
44      * <ul><li>Failure communicating with the VM. The DebugException's
45      * status code contains the underlying exception responsible for
46      * the failure.</li>
47      * </ul>
48      * @since 2.0
49      */

50     public IStackFrame[] getStackFrames() throws DebugException;
51     
52     /**
53      * Returns whether this thread currently contains any stack
54      * frames.
55      *
56      * @return whether this thread currently contains any stack frames
57      * @exception DebugException if this method fails. Reasons include:
58      * <ul><li>Failure communicating with the debug target. The DebugException's
59      * status code contains the underlying exception responsible for
60      * the failure.</li>
61      * </ul>
62      * @since 2.0
63      */

64     public boolean hasStackFrames() throws DebugException;
65     
66     /**
67      * Returns the priority of this thread. The meaning of this
68      * number is operating-system dependent.
69      *
70      * @return thread priority
71      * @exception DebugException if this method fails. Reasons include:
72      * <ul><li>Failure communicating with the VM. The DebugException's
73      * status code contains the underlying exception responsible for
74      * the failure.</li>
75      */

76     public int getPriority() throws DebugException;
77     /**
78      * Returns the top stack frame or <code>null</code> if there is
79      * currently no top stack frame.
80      *
81      * @return the top stack frame, or <code>null</code> if none
82      * @exception DebugException if this method fails. Reasons include:
83      * <ul><li>Failure communicating with the VM. The DebugException's
84      * status code contains the underlying exception responsible for
85      * the failure.</li>
86      */

87     public IStackFrame getTopStackFrame() throws DebugException;
88     /**
89      * Returns the name of this thread. Name format is debug model
90      * specific, and should be specified by a debug model.
91      *
92      * @return this thread's name
93      * @exception DebugException if this method fails. Reasons include:
94      * <ul><li>Failure communicating with the VM. The DebugException's
95      * status code contains the underlying exception responsible for
96      * the failure.</li>
97      */

98     public String JavaDoc getName() throws DebugException;
99
100     /**
101      * Returns the breakpoints that caused this thread to suspend,
102      * or an empty collection if this thread is not suspended or
103      * was not suspended by a breakpoint. Usually a single breakpoint
104      * will be returned, but this collection can contain more than
105      * one breakpoint if two breakpoints are at the same location in
106      * a program.
107      *
108      * @return the collection of breakpoints that caused this thread to suspend
109      */

110     public IBreakpoint[] getBreakpoints();
111 }
112
Popular Tags