hudson.remoting.Channel.waitForRemoteProperty()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.2k)|赞(0)|评价(0)|浏览(189)

本文整理了Java中hudson.remoting.Channel.waitForRemoteProperty()方法的一些代码示例,展示了Channel.waitForRemoteProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Channel.waitForRemoteProperty()方法的具体详情如下:
包路径:hudson.remoting.Channel
类名称:Channel
方法名:waitForRemoteProperty

Channel.waitForRemoteProperty介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

/**
 * @deprecated Specific to {@link Mode#REMOTING}.
 */
@Deprecated
/*package*/ CLI(CLIConnectionFactory factory) throws IOException, InterruptedException {
  URL jenkins = factory.jenkins;
  this.httpsProxyTunnel = factory.httpsProxyTunnel;
  this.authorization = factory.authorization;
  ExecutorService exec = factory.exec;
  
  ownsPool = exec==null;
  pool = exec!=null ? exec : Executors.newCachedThreadPool(new NamingThreadFactory(Executors.defaultThreadFactory(), "CLI.pool"));
  Channel _channel;
  try {
    _channel = connectViaCliPort(jenkins, getCliTcpPort(jenkins));
  } catch (IOException e) {
    LOGGER.log(Level.FINE, "Failed to connect via CLI port. Falling back to HTTP", e);
    try {
      _channel = connectViaHttp(jenkins);
    } catch (IOException e2) {
      e.addSuppressed(e2);
      throw e;
    }
  }
  this.channel = _channel;
  // execute the command
  entryPoint = (CliEntryPoint)_channel.waitForRemoteProperty(CliEntryPoint.class.getName());
  if(entryPoint.protocolVersion()!=CliEntryPoint.VERSION)
    throw new IOException(Messages.CLI_VersionMismatch());
}

代码示例来源:origin: jenkinsci/remoting

/**
 * @deprecated
 *      Because {@link ChannelProperty} is identity-equality, this method would never work.
 *      This is a design error.
 */
@Deprecated
public <T> T waitForRemoteProperty(ChannelProperty<T> key) throws InterruptedException {
  return key.type.cast(waitForRemoteProperty((Object) key));
}

代码示例来源:origin: jenkinsci/remoting

protected JarLoader getJarLoader(Channel channel) throws InterruptedException {
  JarLoader jl = channel.getProperty(JarLoader.THEIRS);
  if (jl==null) {// even if two threads run this simultaneously, it is harmless
    jl = (JarLoader) channel.waitForRemoteProperty(JarLoader.OURS);
    channel.setProperty(JarLoader.THEIRS,jl);
  }
  return jl;
}

代码示例来源:origin: hudson/hudson-2.x

entryPoint = (CliEntryPoint)channel.waitForRemoteProperty(CliEntryPoint.class.getName());

代码示例来源:origin: jenkinsci/acceptance-test-harness

private boolean connect() throws IOException {
  if (conn != null)      return false;
  System.out.println("Requesting jut instance using socket " + socket.getAbsolutePath());
  UnixSocketAddress address = new UnixSocketAddress(socket);
  conn = UnixSocketChannel.open(address);
  channel = new ChannelBuilder("JenkinsPool", Executors.newCachedThreadPool())
      .withMode(Mode.BINARY)
      .build(ChannelStream.in(conn), ChannelStream.out(conn));
  try {
    controller = (IJenkinsController)channel.waitForRemoteProperty("controller");
    controller.start();
    url = controller.getUrl();
    if (!isQuite) {
      splitter.addLogListener(getLogPrinter());
    }
    final LogListener l = channel.export(LogListener.class, splitter);
    channel.call(new InstallLogger(controller,l));
    for (byte[] content : toUnpack) {
      controller.populateJenkinsHome(content, false);
    }
    toUnpack.clear();
  } catch (InterruptedException e) {
    throw new IOException(e);
  }
  return true;
}

代码示例来源:origin: jenkinsci/remoting

public void testWaitForRemoteProperty() throws Exception {
  Future<Void> f = channel.callAsync(new WaitForRemotePropertyCallable());
  assertEquals("bar", channel.waitForRemoteProperty("foo"));
  f.get(1, TimeUnit.SECONDS);
}

相关文章