• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java RemoteConnection类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.execution.configurations.RemoteConnection的典型用法代码示例。如果您正苦于以下问题:Java RemoteConnection类的具体用法?Java RemoteConnection怎么用?Java RemoteConnection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RemoteConnection类属于com.intellij.execution.configurations包,在下文中一共展示了RemoteConnection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getStateDescription

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
public String getStateDescription() {
  if (myState.myDescription != null) {
    return myState.myDescription;
  }

  switch (myState.myState) {
    case STOPPED:
      return DebuggerBundle.message("status.debug.stopped");
    case RUNNING:
      return DebuggerBundle.message("status.app.running");
    case WAITING_ATTACH:
      RemoteConnection connection = getProcess().getConnection();
      final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
      final String transportName = DebuggerBundle.getTransportName(connection);
      return connection.isServerMode() ? DebuggerBundle.message("status.listening", addressDisplayName, transportName) : DebuggerBundle.message("status.connecting", addressDisplayName, transportName);
    case PAUSED:
      return DebuggerBundle.message("status.paused");
    case WAIT_EVALUATION:
      return DebuggerBundle.message("status.waiting.evaluation.result");
    case DISPOSED:
      return DebuggerBundle.message("status.debug.stopped");
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:DebuggerSession.java


示例2: updateHelpText

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
private void updateHelpText() {
  boolean useSockets = !myRbShmem.isSelected();

  final RemoteConnection connection = new RemoteConnection(
    useSockets,
    myHostName,
    useSockets ? myPortField.getText().trim() : myAddressField.getText().trim(),
    myRbListen.isSelected()
  );
  final String cmdLine = connection.getLaunchCommandLine();
  // -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7007
  final String jvmtiCmdLine = cmdLine.replace("-Xdebug", "").replace("-Xrunjdwp:", "-agentlib:jdwp=").trim();
  myHelpArea.updateText(jvmtiCmdLine);
  myJDK14HelpArea.updateText(cmdLine);
  myJDK13HelpArea.updateText("-Xnoagent -Djava.compiler=NONE " + cmdLine);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:RemoteConfigurable.java


示例3: createContentDescriptor

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor createContentDescriptor(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
  if (state instanceof ExternalSystemRunConfiguration.MyRunnableState) {
    int port = ((ExternalSystemRunConfiguration.MyRunnableState)state).getDebugPort();
    if (port > 0) {
      RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", String.valueOf(port), true);
      return attachVirtualMachine(state, environment, connection, true);
    }
    else {
      LOG.warn("Can't attach debugger to external system task execution. Reason: target debug port is unknown");
    }
  }
  else {
    LOG.warn(String.format(
      "Can't attach debugger to external system task execution. Reason: invalid run profile state is provided"
      + "- expected '%s' but got '%s'",
      ExternalSystemRunConfiguration.MyRunnableState.class.getName(), state.getClass().getName()
    ));
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ExternalSystemTaskDebugRunner.java


示例4: doExecute

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor doExecute(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws ExecutionException {
    if(DEBUG_EXECUTOR.equals(environment.getExecutor().getId())) {
        RoboVmRunConfiguration runConfig = (RoboVmRunConfiguration)environment.getRunProfile();
        RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", "" + runConfig.getDebugPort(), false);
        connection.setServerMode(true);
        return attachVirtualMachine(state, environment, connection, false);
    } else {
        ExecutionResult executionResult = state.execute(environment.getExecutor(), this);
        if (executionResult == null) {
            return null;
        }
        return new RunContentBuilder(executionResult, environment).showRunContent(environment.getContentToReuse());
    }
}
 
开发者ID:robovm,项目名称:robovm-idea,代码行数:17,代码来源:RoboVmRunner.java


示例5: getEventText

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
public String getEventText(Pair<Breakpoint, Event> descriptor) {
  String text = "";
  final Event event = descriptor.getSecond();
  final Breakpoint breakpoint = descriptor.getFirst();
  if (event instanceof LocatableEvent) {
    if (breakpoint instanceof LineBreakpoint && !((LineBreakpoint)breakpoint).isVisible()) {
      text = DebuggerBundle.message("status.stopped.at.cursor");
    }
    else {
      try {
        text = breakpoint != null? breakpoint.getEventMessage(((LocatableEvent)event)) : DebuggerBundle.message("status.generic.breakpoint.reached");
      }
      catch (InternalException e) {
        text = DebuggerBundle.message("status.generic.breakpoint.reached");
      }
    }
  }
  else if (event instanceof VMStartEvent) {
    text = DebuggerBundle.message("status.process.started");
  }
  else if (event instanceof VMDeathEvent) {
    text = DebuggerBundle.message("status.process.terminated");
  }
  else if (event instanceof VMDisconnectEvent) {
    final RemoteConnection connection = getConnection();
    final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
    final String transportName = DebuggerBundle.getTransportName(connection);
    text = DebuggerBundle.message("status.disconnected", addressDisplayName, transportName);
  }
  return text;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:32,代码来源:DebugProcessEvents.java


示例6: attachVirtualMachine

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
public RunContentDescriptor attachVirtualMachine(Executor executor,
                                                 ProgramRunner runner,
                                                 ExecutionEnvironment environment,
                                                 RunProfileState state,
                                                 RunContentDescriptor reuseContent,
                                                 RemoteConnection remoteConnection,
                                                 boolean pollConnection) throws ExecutionException {
  return attachVirtualMachine(new DefaultDebugUIEnvironment(myProject,
                                                          executor,
                                                          runner,
                                                          environment,
                                                          state,
                                                          reuseContent,
                                                          remoteConnection,
                                                          pollConnection));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:DebuggerPanelsManager.java


示例7: getStateDescription

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
public String getStateDescription() {
  if (myState.myDescription != null) {
    return myState.myDescription;
  }

  switch (myState.myState) {
    case STATE_STOPPED:
      return DebuggerBundle.message("status.debug.stopped");
    case STATE_RUNNING:
      return DebuggerBundle.message("status.app.running");
    case STATE_WAITING_ATTACH:
      RemoteConnection connection = getProcess().getConnection();
      final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
      final String transportName = DebuggerBundle.getTransportName(connection);
      return connection.isServerMode() ? DebuggerBundle.message("status.listening", addressDisplayName, transportName) : DebuggerBundle.message("status.connecting", addressDisplayName, transportName);
    case STATE_PAUSED:
      return DebuggerBundle.message("status.paused");
    case STATE_WAIT_EVALUATION:
      return DebuggerBundle.message("status.waiting.evaluation.result");
    case STATE_DISPOSED:
      return DebuggerBundle.message("status.debug.stopped");
  }
  return myState.myDescription;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:DebuggerSession.java


示例8: createContentDescriptor

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor createContentDescriptor(Project project,
                                                       RunProfileState state,
                                                       RunContentDescriptor contentToReuse,
                                                       ExecutionEnvironment env) throws ExecutionException
{
  if (state instanceof ExternalSystemRunConfiguration.MyRunnableState) {
    int port = ((ExternalSystemRunConfiguration.MyRunnableState)state).getDebugPort();
    if (port > 0) {
      RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", String.valueOf(port), false);
      return attachVirtualMachine(project, state, contentToReuse, env, connection, true);
    }
    else {
      LOG.warn("Can't attach debugger to external system task execution. Reason: target debug port is unknown");
    }
  }
  else {
    LOG.warn(String.format(
      "Can't attach debugger to external system task execution. Reason: invalid run profile state is provided"
      + "- expected '%s' but got '%s'",
      ExternalSystemRunConfiguration.MyRunnableState.class.getName(), state.getClass().getName()
    ));
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:ExternalSystemTaskDebugRunner.java


示例9: createContentDescriptor

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor createContentDescriptor(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws
		ExecutionException
{
	final PlayJavaModuleBasedConfiguration runProfile = (PlayJavaModuleBasedConfiguration) environment.getRunProfile();

	final PropertiesFile applicationConf = PlayJavaUtil.getApplicationConf(runProfile.getConfigurationModule().getModule());
	if(applicationConf == null)
	{
		throw new ExecutionException(PlayJavaConstants.CONF__APPLICATION_CONF + " not found");
	}

	final IProperty propertyByKey = applicationConf.findPropertyByKey(PlayJavaConstants.JPDA_PORT);
	if(propertyByKey == null)
	{
		throw new ExecutionException(PlayJavaConstants.JPDA_PORT + " key not found");
	}

	RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", propertyByKey.getValue(), false);

	return attachVirtualMachine(state, environment, connection, true);
}
 
开发者ID:consulo,项目名称:consulo-play,代码行数:24,代码来源:PlayJavaGenericDebuggerRunner.java


示例10: createContentDescriptor

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
@Override
protected RunContentDescriptor createContentDescriptor(@NotNull RunProfileState state, @NotNull ExecutionEnvironment environment) throws
		ExecutionException
{
	if(state instanceof ExternalSystemRunConfiguration.MyRunnableState)
	{
		int port = ((ExternalSystemRunConfiguration.MyRunnableState) state).getDebugPort();
		if(port > 0)
		{
			RemoteConnection connection = new RemoteConnection(true, "127.0.0.1", String.valueOf(port), true);
			return attachVirtualMachine(state, environment, connection, true);
		}
		else
		{
			LOG.warn("Can't attach debugger to external system task execution. Reason: target debug port is unknown");
		}
	}
	else
	{
		LOG.warn(String.format("Can't attach debugger to external system task execution. Reason: invalid run profile state is provided" + "- " +
				"expected '%s' but got '%s'", ExternalSystemRunConfiguration.MyRunnableState.class.getName(), state.getClass().getName()));
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:ExternalSystemTaskDebugRunner.java


示例11: DefaultDebugEnvironment

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
public DefaultDebugEnvironment(@NotNull ExecutionEnvironment environment, @NotNull RunProfileState state, RemoteConnection remoteConnection, boolean pollConnection) {
  this.environment = environment;
  this.state = state;
  myRemoteConnection = remoteConnection;
  myPollConnection = pollConnection;

  mySearchScope = SearchScopeProvider.createSearchScope(environment.getProject(), environment.getRunProfile());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:DefaultDebugEnvironment.java


示例12: attachVirtualMachine

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
public RunContentDescriptor attachVirtualMachine(@NotNull ExecutionEnvironment environment,
                                                 RunProfileState state,
                                                 RemoteConnection remoteConnection,
                                                 boolean pollConnection) throws ExecutionException {
  return attachVirtualMachine(new DefaultDebugUIEnvironment(environment, state, remoteConnection, pollConnection));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:DebuggerPanelsManager.java


示例13: DefaultDebugUIEnvironment

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
public DefaultDebugUIEnvironment(@NotNull ExecutionEnvironment environment,
                                 RunProfileState state,
                                 RemoteConnection remoteConnection,
                                 boolean pollConnection) {
  myExecutionEnvironment = environment;
  myModelEnvironment = new DefaultDebugEnvironment(environment, state, remoteConnection, pollConnection);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:DefaultDebugUIEnvironment.java


示例14: attach

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Nullable
private ExecutionResult attach(DebugEnvironment environment) throws ExecutionException {
  RemoteConnection remoteConnection = environment.getRemoteConnection();
  final String addressDisplayName = DebuggerBundle.getAddressDisplayName(remoteConnection);
  final String transportName = DebuggerBundle.getTransportName(remoteConnection);
  final ExecutionResult executionResult = myDebugProcess.attachVirtualMachine(environment, this);
  getContextManager().setState(SESSION_EMPTY_CONTEXT, State.WAITING_ATTACH,
                               Event.START_WAIT_ATTACH,
                               DebuggerBundle.message("status.waiting.attach", addressDisplayName, transportName));
  return executionResult;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:DebuggerSession.java


示例15: connectorIsReady

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Override
public void connectorIsReady() {
  DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
    @Override
    public void run() {
      RemoteConnection connection = myDebugProcess.getConnection();
      final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
      final String transportName = DebuggerBundle.getTransportName(connection);
      final String connectionStatusMessage = connection.isServerMode() ? DebuggerBundle.message("status.listening", addressDisplayName, transportName) : DebuggerBundle.message("status.connecting", addressDisplayName, transportName);
      getContextManager().setState(SESSION_EMPTY_CONTEXT, State.WAITING_ATTACH,
                                   Event.START_WAIT_ATTACH, connectionStatusMessage);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DebuggerSession.java


示例16: processAttached

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Override
public void processAttached(final DebugProcessImpl process) {
  final RemoteConnection connection = getProcess().getConnection();
  final String addressDisplayName = DebuggerBundle.getAddressDisplayName(connection);
  final String transportName = DebuggerBundle.getTransportName(connection);
  final String message = DebuggerBundle.message("status.connected", addressDisplayName, transportName);

  process.printToConsole(message + "\n");
  DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
    @Override
    public void run() {
      getContextManager().setState(SESSION_EMPTY_CONTEXT, State.RUNNING, Event.ATTACHED, message);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:DebuggerSession.java


示例17: attachException

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Override
public void attachException(final RunProfileState state, final ExecutionException exception, final RemoteConnection remoteConnection) {
  DebuggerInvocationUtil.invokeLater(getProject(), new Runnable() {
    @Override
    public void run() {
      String message = "";
      if (state instanceof RemoteState) {
        message = DebuggerBundle.message("status.connect.failed", DebuggerBundle.getAddressDisplayName(remoteConnection), DebuggerBundle.getTransportName(remoteConnection));
      }
      message += exception.getMessage();
      getContextManager().setState(SESSION_EMPTY_CONTEXT, State.STOPPED, Event.DETACHED, message);
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:DebuggerSession.java


示例18: startDebugSession

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Override
public void startDebugSession(@NotNull JavaDebugConnectionData info, @NotNull ExecutionEnvironment executionEnvironment, @NotNull RemoteServer<?> server)
  throws ExecutionException {
  final Project project = executionEnvironment.getProject();
  final DebuggerPanelsManager manager = DebuggerPanelsManager.getInstance(project);
  final JavaDebugServerModeHandler serverModeHandler = info.getServerModeHandler();
  boolean serverMode = serverModeHandler != null;
  final RemoteConnection remoteConnection = new RemoteConnection(true, info.getHost(), String.valueOf(info.getPort()), serverMode);
  DebugEnvironment debugEnvironment = new RemoteServerDebugEnvironment(project, remoteConnection, executionEnvironment.getRunProfile());
  DebugUIEnvironment debugUIEnvironment = new RemoteServerDebugUIEnvironment(debugEnvironment, executionEnvironment);
  RunContentDescriptor debugContentDescriptor = manager.attachVirtualMachine(debugUIEnvironment);
  LOG.assertTrue(debugContentDescriptor != null);
  ProcessHandler processHandler = debugContentDescriptor.getProcessHandler();
  LOG.assertTrue(processHandler != null);
  if (serverMode) {
    serverModeHandler.attachRemote();
    DebuggerManager.getInstance(executionEnvironment.getProject())
      .addDebugProcessListener(processHandler, new DebugProcessAdapter() {
        public void processDetached(DebugProcess process, boolean closedByUser) {
          try {
            serverModeHandler.detachRemote();
          }
          catch (ExecutionException e) {
            LOG.info(e);
          }
        }
      });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:JavaDebuggerLauncherImpl.java


示例19: AndroidDebugState

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
public AndroidDebugState(Project project,
                         RemoteConnection connection,
                         AndroidRunningState state,
                         IDevice device) {
  myProject = project;
  myConnection = connection;
  myState = state;
  myDevice = device;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AndroidDebugRunner.java


示例20: createContentDescriptor

import com.intellij.execution.configurations.RemoteConnection; //导入依赖的package包/类
@Override
@Nullable
public RunContentDescriptor createContentDescriptor(
    RunProfileState state, ExecutionEnvironment environment) throws ExecutionException {
  if (!(state instanceof BlazeJavaRunProfileState)) {
    return null;
  }
  BlazeJavaRunProfileState blazeState = (BlazeJavaRunProfileState) state;
  RemoteConnection connection = blazeState.getRemoteConnection();
  return attachVirtualMachine(state, environment, connection, POLL_TIMEOUT_MILLIS);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:12,代码来源:BlazeJavaDebuggerRunner.java



注:本文中的com.intellij.execution.configurations.RemoteConnection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WSEditor类代码示例发布时间:2022-05-22
下一篇:
Java PairConsumer类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap