本文整理汇总了Java中com.intellij.debugger.impl.GenericDebuggerRunner类的典型用法代码示例。如果您正苦于以下问题:Java GenericDebuggerRunner类的具体用法?Java GenericDebuggerRunner怎么用?Java GenericDebuggerRunner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericDebuggerRunner类属于com.intellij.debugger.impl包,在下文中一共展示了GenericDebuggerRunner类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: launchDebugger
import com.intellij.debugger.impl.GenericDebuggerRunner; //导入依赖的package包/类
private static void launchDebugger(final Project project, final GaugeDebugInfo debugInfo) {
Runnable runnable = () -> {
final long startTime = System.currentTimeMillis();
GenericDebuggerRunner basicProgramRunner = new GenericDebuggerRunner();
RunManagerImpl manager = new RunManagerImpl(project);
ConfigurationFactory configFactory = RemoteConfigurationType.getInstance().getConfigurationFactories()[0];
RemoteConfiguration remoteConfig = new RemoteConfiguration(project, configFactory);
remoteConfig.PORT = debugInfo.getPort();
remoteConfig.HOST = debugInfo.getHost();
remoteConfig.USE_SOCKET_TRANSPORT = true;
remoteConfig.SERVER_MODE = false;
RunnerAndConfigurationSettingsImpl configuration = new RunnerAndConfigurationSettingsImpl(manager, remoteConfig, false);
ExecutionEnvironment environment = new ExecutionEnvironment(new DefaultDebugExecutor(), basicProgramRunner, configuration, project);
boolean debuggerConnected = false;
// Trying to connect to gauge java for 25 secs. The sleep is because it may take a few seconds for gauge to launch the java process and the jvm to load after that
while (!debuggerConnected && ((System.currentTimeMillis() - startTime) < 25000)) {
try {
Thread.sleep(5000);
basicProgramRunner.execute(environment);
debuggerConnected = true;
} catch (Exception e) {
System.err.println("Failed to connect debugger. Retrying... : " + e.getMessage());
}
}
};
ApplicationManager.getApplication().invokeAndWait(runnable, ModalityState.any());
}
开发者ID:getgauge,项目名称:Intellij-Plugin,代码行数:30,代码来源:GaugeRunProcessHandler.java
注:本文中的com.intellij.debugger.impl.GenericDebuggerRunner类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论