Skip to main content
summaryrefslogtreecommitdiffstats
blob: 383847b7f2f4a8e2be61feffbdc7c3ea480c6bba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.core.model;


import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;

/**
 * A process represents a program running in normal (non-debug) mode.
 * Processes support setting and getting of client defined attributes.
 * This way, clients can annotate a process with any extra information
 * important to them. For example, classpath annotations, or command
 * line arguments used to launch the process may be important to a client.
 * <p>
 * Clients may implement this interface, however, the debug plug-in
 * provides an implementation of this interface for a
 * <code>java.lang.Process</code>. 
 * </p>
 * @see org.eclipse.debug.core.DebugPlugin#newProcess(ILaunch, Process, String)
 */
public interface IProcess extends IAdaptable, ITerminate {
	
	/**
	 * Attribute key for a common, optional, process property. The value of this
	 * attribute is the command line a process was launched with.
	 * 
	 * @since 2.1
	 */
	public final static String ATTR_CMDLINE= DebugPlugin.getUniqueIdentifier() + ".ATTR_CMDLINE"; //$NON-NLS-1$
	
	/**
	 * Attribute key for a common, optional, process property. The value of this
	 * attribute is an identifier for the type of this process. Process types
	 * are client defined - whoever creates a process may define its type. For
	 * example, a process type could be "java", "javadoc", or "ant".
	 *
	 * @since 2.1
	 */
	public final static String ATTR_PROCESS_TYPE = DebugPlugin.getUniqueIdentifier() + ".ATTR_PROCESS_TYPE"; //$NON-NLS-1$		

	/**
	 * Attribute key for a common, optional, process property. The value of this
	 * attribute specifies an alternate dynamic label for a process, displayed by
	 * the console.
	 * 
	 * @since 3.0
	 */
	public final static String ATTR_PROCESS_LABEL = DebugPlugin.getUniqueIdentifier() + ".ATTR_PROCESS_LABEL"; //$NON-NLS-1$
	
	/**
	 * Returns a human-readable label for this process.
	 *
	 * @return a label for this process
	 */
	public String getLabel();
	/**
	 * Returns the launch this element originated from.
	 *
	 * @return the launch this process is contained in
	 */
	public ILaunch getLaunch();
	/**
	 * Returns a proxy to the standard input, output, and error streams 
	 * for this process, or <code>null</code> if not supported.
	 *
	 * @return a streams proxy, or <code>null</code> if not supported
	 */
	public IStreamsProxy getStreamsProxy();
	
	/**
	 * Sets the value of a client defined attribute.
	 *
	 * @param key the attribute key
	 * @param value the attribute value
	 */
	public void setAttribute(String key, String value);
	
	/**
	 * Returns the value of a client defined attribute.
	 *
	 * @param key the attribute key
	 * @return value the String attribute value, or <code>null</code> if undefined
	 */
	public String getAttribute(String key);
	
	/**
	 * Returns the exit value of this process. Conventionally, 0 indicates
	 * normal termination.
	 * 
	 * @return the exit value of this process
	 * @exception DebugException if this process has not yet terminated
	 */
	public int getExitValue() throws DebugException;
}

Back to the top