KickJava   Java API By Example, From Geeks To Geeks.

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


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.core.runtime.IAdaptable;
15 import org.eclipse.debug.core.DebugException;
16 import org.eclipse.debug.core.DebugPlugin;
17 import org.eclipse.debug.core.ILaunch;
18
19 /**
20  * A process represents a program running in normal (non-debug) mode.
21  * Processes support setting and getting of client defined attributes.
22  * This way, clients can annotate a process with any extra information
23  * important to them. For example, classpath annotations, or command
24  * line arguments used to launch the process may be important to a client.
25  * <p>
26  * Clients may implement this interface, however, the debug plug-in
27  * provides an implementation of this interface for a
28  * <code>java.lang.Process</code>.
29  * </p>
30  * @see org.eclipse.debug.core.DebugPlugin#newProcess(ILaunch, Process, String)
31  */

32 public interface IProcess extends IAdaptable, ITerminate {
33     
34     /**
35      * Attribute key for a common, optional, process property. The value of this
36      * attribute is the command line a process was launched with.
37      *
38      * @since 2.1
39      */

40     public final static String JavaDoc ATTR_CMDLINE= DebugPlugin.getUniqueIdentifier() + ".ATTR_CMDLINE"; //$NON-NLS-1$
41

42     /**
43      * Attribute key for a common, optional, process property. The value of this
44      * attribute is an identifier for the type of this process. Process types
45      * are client defined - whoever creates a process may define its type. For
46      * example, a process type could be "java", "javadoc", or "ant".
47      *
48      * @since 2.1
49      */

50     public final static String JavaDoc ATTR_PROCESS_TYPE = DebugPlugin.getUniqueIdentifier() + ".ATTR_PROCESS_TYPE"; //$NON-NLS-1$
51

52     /**
53      * Attribute key for a common, optional, process property. The value of this
54      * attribute specifies an alternate dynamic label for a process, displayed by
55      * the console.
56      *
57      * @since 3.0
58      */

59     public final static String JavaDoc ATTR_PROCESS_LABEL = DebugPlugin.getUniqueIdentifier() + ".ATTR_PROCESS_LABEL"; //$NON-NLS-1$
60

61     /**
62      * Returns a human-readable label for this process.
63      *
64      * @return a label for this process
65      */

66     public String JavaDoc getLabel();
67     /**
68      * Returns the launch this element originated from.
69      *
70      * @return the launch this process is contained in
71      */

72     public ILaunch getLaunch();
73     /**
74      * Returns a proxy to the standard input, output, and error streams
75      * for this process, or <code>null</code> if not supported.
76      *
77      * @return a streams proxy, or <code>null</code> if not supported
78      */

79     public IStreamsProxy getStreamsProxy();
80     
81     /**
82      * Sets the value of a client defined attribute.
83      *
84      * @param key the attribute key
85      * @param value the attribute value
86      */

87     public void setAttribute(String JavaDoc key, String JavaDoc value);
88     
89     /**
90      * Returns the value of a client defined attribute.
91      *
92      * @param key the attribute key
93      * @return value the String attribute value, or <code>null</code> if undefined
94      */

95     public String JavaDoc getAttribute(String JavaDoc key);
96     
97     /**
98      * Returns the exit value of this process. Conventionally, 0 indicates
99      * normal termination.
100      *
101      * @return the exit value of this process
102      * @exception DebugException if this process has not yet terminated
103      */

104     public int getExitValue() throws DebugException;
105 }
106
Popular Tags