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; 12 13 import java.util.Map; 14 15 import org.eclipse.debug.core.model.IProcess; 16 17 /** 18 * A process factory is used to override default process (<code>IProcess</code>) 19 * creation by the debug plug-in, and can be contributed via plug-in XML. When a 20 * new process is created via <code>DebugPlugin.newProcess(..)</code>, the 21 * launch configuration associated with the specified launch is consulted for 22 * a process factory attribute (<code>DebugPlugin.ATTR_PROCESS_FACTORY_ID</code>). If 23 * present, the associated process factory is consulted to create a process for 24 * the launch. If not present a default process implementation is created and 25 * returned by the debug plug-in. 26 * <p> 27 * Following is example plug-in XML that contributes a process factory. 28 * <pre> 29 * <extension point="org.eclipse.debug.core.processFactories"> 30 * <processFactory 31 * id="com.example.ExampleIdentifier" 32 * class="com.example.ExampleProcessFactory"> 33 * </processFactory> 34 * </extension> 35 * </pre> 36 * The attributes are specified as follows: 37 * <ul> 38 * <li>id - a unique identifier for this extension point</li> 39 * <li>class - the fully qualified name of a class the implements 40 * <code>IProcessFactory</code></li> 41 * </ul> 42 * </p> 43 * <p> 44 * Clients contributing a process factory are intended to implement this interface. 45 * </p> 46 * @since 3.0 47 */ 48 49 public interface IProcessFactory { 50 51 /** 52 * Creates and returns a new process representing the given 53 * <code>java.lang.Process</code>. A streams proxy is created 54 * for the I/O streams in the system process. The process 55 * is added to the given launch, and the process is initialized 56 * with the given attribute map. 57 * 58 * @param launch the launch the process is contained in 59 * @param process the system process to wrap 60 * @param label the label assigned to the process 61 * @param attributes initial values for the attribute map 62 * @return the process 63 * @see IProcess 64 */ 65 public IProcess newProcess(ILaunch launch, Process process, String label, Map attributes); 66 } 67