当前位置: 首页>>代码示例>>Java>>正文


Java IProcess.terminate方法代码示例

本文整理汇总了Java中org.eclipse.debug.core.model.IProcess.terminate方法的典型用法代码示例。如果您正苦于以下问题:Java IProcess.terminate方法的具体用法?Java IProcess.terminate怎么用?Java IProcess.terminate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.debug.core.model.IProcess的用法示例。


在下文中一共展示了IProcess.terminate方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: removeConsoleLaunch

import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
/**
 * Removes a launch from a pydev console and stops the related process (may be called from a thread).
 *
 * @param launch the launch to be removed
 */
public void removeConsoleLaunch(ILaunch launch) {
    boolean removed;
    synchronized (consoleLaunchesLock) {
        removed = consoleLaunches.remove(launch);
    }
    if (removed) {
        IProcess[] processes = launch.getProcesses();
        if (processes != null) {
            for (IProcess p : processes) {
                try {
                    p.terminate();
                } catch (Exception e) {
                    Log.log(e);
                }
            }
        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:24,代码来源:InteractiveConsolePlugin.java

示例2: terminate

import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
@Override
public void terminate() throws DebugException {
	for (Iterator<IProcess> iter = processes.iterator(); iter.hasNext(); iter.remove()) {
		IProcess p = iter.next();
		if (p.canTerminate()) {
			p.terminate();
		}
	}
	for (Iterator<IDebugTarget> iter = targets.iterator(); iter.hasNext(); iter.remove()) {
		IDebugTarget t = iter.next();
		if (t.canTerminate()) {
			t.terminate();
		}
	}
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:16,代码来源:MockLaunch.java

示例3: execSync

import org.eclipse.debug.core.model.IProcess; //导入方法依赖的package包/类
/**
 * Executes the given commands synchronously.
 *
 * <p>
 * If the workingDirectory is null, the current directory for process is used.
 * </p>
 * @param command the command line can not be null or empty
 * @param workingDirectory working directory for the executed command, can be null
 * @param outStreamListener  listener for output, can be null
 * @param errorStreamListene listener for error output, can be null
 * @param envp environment variables to set in the process, can be null
 * @param launchConfiguration the launch to add as part of this call, can be null
 * @return the exit code for the process
 * @throws CoreException if the execution fails
 */
public int execSync ( String[] command, File workingDirectory, 
		IStreamListener outStreamListener, 
		IStreamListener errorStreamListener, IProgressMonitor monitor, 
		String[] envp, ILaunchConfiguration launchConfiguration) throws CoreException{
	if(monitor == null){
		monitor = new NullProgressMonitor();
	}
	HybridCore.trace("Sync Execute command line: "+Arrays.toString(command));
	IProcess prcs = exec(command, workingDirectory, monitor, envp, launchConfiguration,outStreamListener,errorStreamListener);
	if(prcs == null ){
		return 0;
	}
	
	while (!prcs.isTerminated()) {
		try {
			if (monitor.isCanceled()) {
				prcs.terminate();
				break;
			}
			Thread.sleep(50);
		} catch (InterruptedException e) {
			HybridCore.log(IStatus.INFO, "Exception waiting for process to terminate", e);
		}
	}
	return prcs.getExitValue();
}
 
开发者ID:eclipse,项目名称:thym,代码行数:42,代码来源:ExternalProcessUtility.java


注:本文中的org.eclipse.debug.core.model.IProcess.terminate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。