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


Java ILaunch.terminate方法代码示例

本文整理汇总了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");
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:24,代码来源:SwtBotLaunchManagerActions.java

示例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();
}
 
开发者ID:fbricon,项目名称:wildfly-hive,代码行数:13,代码来源:WildFlySwarmServerBehavior.java

示例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 );
  }
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:8,代码来源:LaunchTerminator.java

示例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() );
  }
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:10,代码来源:TerminateLaunchesAction.java

示例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();
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:11,代码来源:LaunchConfigsPDETest.java

示例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();
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:11,代码来源:LaunchTerminatorPDETest.java

示例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 );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:13,代码来源:LaunchConfigCleanerPDETest.java

示例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() );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:13,代码来源:LaunchConfigCleanerPDETest.java

示例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();
}
 
开发者ID:Beagle-PSE,项目名称:Beagle,代码行数:38,代码来源:EclipseLaunchConfiguration.java

示例11: terminateLaunches

import org.eclipse.debug.core.ILaunch; //导入方法依赖的package包/类
private void terminateLaunches() throws DebugException {
  for( ILaunch launch : launchManager.getLaunches() ) {
    launch.terminate();
  }
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:6,代码来源:LaunchConfigRule.java


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