當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。