本文整理汇总了Java中org.eclipse.debug.core.ILaunch.terminate方法的典型用法代码示例。如果您正苦于以下问题:Java ILaunch.terminate方法的具体用法?Java ILaunch.terminate怎么用?Java ILaunch.terminate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.ILaunch
的用法示例。
在下文中一共展示了ILaunch.terminate方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitUntilLaunchTerminates
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
/**
* Waits until {@code launch} terminates or {@code monitor} is canceled. if the monitor is
* canceled, attempts to terminate the launch before returning.
*
* @return true if the launch terminated normally; false otherwise
*/
@VisibleForTesting
static boolean waitUntilLaunchTerminates(ILaunch launch, IProgressMonitor monitor)
throws InterruptedException, DebugException {
while (!launch.isTerminated() && !monitor.isCanceled()) {
Thread.sleep(100 /*ms*/);
}
if (monitor.isCanceled()) {
launch.terminate();
return false;
}
for (IProcess process : launch.getProcesses()) {
if (process.getExitValue() != 0) {
return false;
}
}
return true;
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:25,代码来源:FlexMavenPackagedProjectStagingDelegate.java
示例2: terminateAllLaunchConfigs
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
public static void terminateAllLaunchConfigs(SWTBot bot) {
SwtBotUtils.print("Terminating Launches");
ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
ILaunch[] launches = manager.getLaunches();
if (launches == null || launches.length == 0) {
SwtBotUtils.print("No Launches to terminate");
}
for (ILaunch launch : launches) {
if (!launch.isTerminated()) {
try {
launch.terminate();
} catch (DebugException e) {
SwtBotUtils.printError("Could not terminate launch." + e.getMessage());
}
}
}
SwtBotWorkbenchActions.waitForIdle(bot);
SwtBotUtils.print("Terminated Launches");
}
示例3: stop
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
@Override
public void stop(boolean force) {
ILaunch launch = getServer().getLaunch();
if (launch != null) {
try {
launch.terminate();
} catch (DebugException e) {
e.printStackTrace();
}
}
setServerStopped();
}
示例4: terminateLaunch
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
private static void terminateLaunch( ILaunch launch ) {
try {
launch.terminate();
} catch( DebugException debugException ) {
StatusManager.getManager().handle( debugException.getStatus(), StatusManager.LOG );
}
}
示例5: terminateLaunch
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
private void terminateLaunch( ILaunch launch ) {
try {
if( launch.canTerminate() ) {
launch.terminate();
}
} catch( DebugException e ) {
status.merge( e.getStatus() );
}
}
示例6: testIsRunningWithLaunchedLaunchConfig
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
@Test
public void testIsRunningWithLaunchedLaunchConfig() throws CoreException {
ILaunchConfigurationWorkingCopy launchConfig = launchConfigRule.createPublicLaunchConfig();
ILaunch launch = launchConfig.launch( RUN_MODE, null );
boolean running = LaunchConfigs.isRunning( launchConfig );
launch.terminate();
assertThat( running ).isTrue();
}
示例7: testTerminateLaunchesWithTerminatedLaunch
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
@Test
public void testTerminateLaunchesWithTerminatedLaunch() throws CoreException {
ILaunchConfiguration launchConfig = launchConfigRule.createPublicLaunchConfig().doSave();
ILaunch launch = launchConfig.launch( RUN_MODE, new NullProgressMonitor() );
launch.terminate();
new LaunchTerminator( launchConfig ).terminateLaunches();
assertThat( launch.isTerminated() ).isTrue();
}
示例8: testNoCleanupWhenLaunchConfigRenamed
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
@Test
public void testNoCleanupWhenLaunchConfigRenamed() throws CoreException {
prepareLaunchPreferences( true, launchConfigRule.getPublicTestLaunchConfigType() );
launchConfigCleaner.install();
ILaunchConfiguration launchConfig = launchConfigRule.createPublicLaunchConfig().doSave();
ILaunch launch = launchConfig.launch( RUN_MODE, null );
String newName = launchConfigRule.renameLaunchConfig( launchConfig );
launch.terminate();
assertThat( getLaunchConfigs() ).extracting( "name" ).contains( newName );
}
示例9: testNoCleanupWhenLaunchConfigDeleted
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
@Test
public void testNoCleanupWhenLaunchConfigDeleted() throws CoreException {
prepareLaunchPreferences( true, launchConfigRule.getPublicTestLaunchConfigType() );
launchConfigCleaner.install();
ILaunchConfiguration launchConfig = launchConfigRule.createPublicLaunchConfig().doSave();
ILaunch launch = launchConfig.launch( RUN_MODE, null );
launchConfig.delete();
launch.terminate();
assertThat( getLaunchConfigs() ).extracting( "name" ).doesNotContain( launchConfig.getName() );
}
示例10: execute
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
@Override
public void execute() throws InterruptedException {
this.done = false;
this.execute = true;
// try again until we succeed or we’re told to stop by the failure handler
while (this.execute) {
// catches core exceptions. These might be thrown when terminating the
// launch, too.
try {
final ILaunch launch = this.workingCopy.launch(ILaunchManager.RUN_MODE, null);
// handles interrupts.
try {
synchronized (this) {
while (!this.done) {
this.wait();
}
}
} catch (final InterruptedException interrupt) {
launch.terminate();
this.copy();
throw interrupt;
}
this.execute = false;
} catch (final CoreException runException) {
final FailureReport<Void> failure = new FailureReport<Void>().cause(runException)
.retryWith(() -> this.execute = true)
.continueWith(() -> this.execute = false);
FAILURE_HANDLER.handle(failure);
}
}
// reset the launch configuration
this.copy();
}
示例11: terminateLaunches
import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
private void terminateLaunches() throws DebugException {
for( ILaunch launch : launchManager.getLaunches() ) {
launch.terminate();
}
}