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


Java Agent类代码示例

本文整理汇总了Java中org.eclipse.che.api.agent.shared.model.Agent的典型用法代码示例。如果您正苦于以下问题:Java Agent类的具体用法?Java Agent怎么用?Java Agent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Agent类属于org.eclipse.che.api.agent.shared.model包,在下文中一共展示了Agent类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: launch

import org.eclipse.che.api.agent.shared.model.Agent; //导入依赖的package包/类
@Override
public void launch(Instance machine, Agent agent) throws ServerException, AgentStartException {
  super.launch(machine, agent);

  DockerNode node = (DockerNode) machine.getNode();
  DockerInstance dockerMachine = (DockerInstance) machine;
  try {
    node.bindWorkspace();
  } catch (EnvironmentException e) {
    throw new AgentStartException(
        format(
            "Agent '%s' start failed because of an error with underlying environment. Error: %s",
            agent.getId(), e.getLocalizedMessage()));
  }
  LOG.info(
      "Docker machine has been deployed. "
          + "ID '{}'. Workspace ID '{}'. "
          + "Container ID '{}'. Node host '{}'. Node IP '{}'",
      machine.getId(),
      machine.getWorkspaceId(),
      dockerMachine.getContainer(),
      node.getHost(),
      node.getIp());
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:25,代码来源:MachineInnerRsyncAgentLauncherImpl.java

示例2: configure

import org.eclipse.che.api.agent.shared.model.Agent; //导入依赖的package包/类
@Override
protected void configure() {
  Multibinder.newSetBinder(binder(), Agent.class).addBinding().to(SampleAgent.class);
}
 
开发者ID:eclipse,项目名称:che-archetypes,代码行数:5,代码来源:SampleAgentModule.java

示例3: configure

import org.eclipse.che.api.agent.shared.model.Agent; //导入依赖的package包/类
@Override
protected void configure() {
  bind(org.eclipse.che.api.agent.server.AgentRegistryService.class);

  bind(org.eclipse.che.api.agent.server.WsAgentHealthChecker.class)
      .to(com.codenvy.machine.WsAgentHealthCheckerWithAuth.class);

  bind(org.eclipse.che.api.agent.server.AgentRegistry.class)
      .to(org.eclipse.che.api.agent.server.impl.AgentRegistryImpl.class);

  bindConstant()
      .annotatedWith(Names.named("machine.terminal_agent.run_command"))
      .to(
          "$HOME/che/terminal/che-websocket-terminal "
              + "-addr :4411 "
              + "-cmd ${SHELL_INTERPRETER} "
              + "-path '/[^/]+' "
              + "-enable-auth "
              + "-enable-activity-tracking");
  bindConstant()
      .annotatedWith(Names.named("machine.exec_agent.run_command"))
      .to(
          "$HOME/che/exec-agent/che-exec-agent "
              + "-addr :4412 "
              + "-cmd ${SHELL_INTERPRETER} "
              + "-path '/[^/]+' "
              + "-enable-auth "
              + "-logs-dir $HOME/che/exec-agent/logs");

  Multibinder<AgentLauncher> launchers = Multibinder.newSetBinder(binder(), AgentLauncher.class);
  launchers.addBinding().to(org.eclipse.che.api.agent.WsAgentLauncher.class);
  launchers
      .addBinding()
      .to(com.codenvy.machine.agent.launcher.MachineInnerRsyncAgentLauncherImpl.class);
  launchers.addBinding().to(org.eclipse.che.api.agent.ExecAgentLauncher.class);
  launchers.addBinding().to(org.eclipse.che.api.agent.TerminalAgentLauncher.class);
  launchers.addBinding().to(org.eclipse.che.api.agent.SshAgentLauncher.class);

  Multibinder<Agent> agents = Multibinder.newSetBinder(binder(), Agent.class);
  agents.addBinding().to(com.codenvy.machine.agent.MachineInnerRsyncAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.SshAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.UnisonAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.ExecAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.TerminalAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.WsAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.LSPhpAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.LSPythonAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.LSJsonAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.LSCSharpAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.LSTypeScriptAgent.class);
  agents.addBinding().to(org.eclipse.che.api.agent.GitCredentialsAgent.class);

  bind(org.eclipse.che.plugin.machine.ssh.exec.SshMachineExecAgentLauncher.class);
  bind(String.class)
      .annotatedWith(Names.named("workspace.backup.public_key"))
      .toProvider(com.codenvy.machine.agent.WorkspaceSyncPublicKeyProvider.class);
}
 
开发者ID:codenvy,项目名称:codenvy,代码行数:58,代码来源:CodenvyAgentModule.java


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