hudson.remoting.Future.get()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(190)

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

Future.get介绍

暂无

代码示例

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

try {
  future.get();
  return future2.get();
} catch (ExecutionException e) {
  Throwable cause = e.getCause();
} catch (IOException e) {// BuildException or IOException
  try {
    future.get(3,TimeUnit.SECONDS);
    throw e;    // the remote side completed successfully, so the error must be local
  } catch (ExecutionException x) {
  return future.get();
} catch (ExecutionException e) {
  Throwable cause = e.getCause();

代码示例来源:origin: org.jvnet.hudson.plugins/cvs

private void join(Future<Void> task) throws InterruptedException, IOException {
  try {
    task.get();
  } catch (ExecutionException e) {
    throw new IOException2(e);
  }
}

代码示例来源:origin: org.hudsonci.plugins/cvs

private void join(Future<Void> task) throws InterruptedException, IOException {
  try {
    task.get();
  } catch (ExecutionException e) {
    throw new IOException2(e);
  }
}

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

public X get() throws InterruptedException, ExecutionException {
  return adapt(core.get());
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-remoting

public X get() throws InterruptedException, ExecutionException {
  return adapt(core.get());
}

代码示例来源:origin: org.eclipse.hudson/hudson-remoting

public X get() throws InterruptedException, ExecutionException {
  return adapt(core.get());
}

代码示例来源:origin: org.eclipse.hudson/hudson-remoting

public X get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  return adapt(core.get(timeout, unit));
}

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

public X get() throws InterruptedException, ExecutionException {
  return adapt(core.get());
}

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

public X get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  return adapt(core.get(timeout, unit));
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-remoting

public X get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
  return adapt(core.get(timeout, unit));
}

代码示例来源:origin: org.eclipse.hudson.main/hudson-remoting

private void ping() throws IOException, InterruptedException {
  Future<?> f = channel.callAsync(new Ping());
  try {
    f.get(timeout,MILLISECONDS);
  } catch (ExecutionException e) {
    if (e.getCause() instanceof RequestAbortedException)
      return; // connection has shut down orderly.
    onDead();
  } catch (TimeoutException e) {
    onDead();
  }
}

代码示例来源:origin: org.eclipse.hudson/hudson-remoting

private void ping() throws IOException, InterruptedException {
  Future<?> f = channel.callAsync(new Ping());
  try {
    f.get(timeout,MILLISECONDS);
  } catch (ExecutionException e) {
    if (e.getCause() instanceof RequestAbortedException)
      return; // connection has shut down orderly.
    onDead();
  } catch (TimeoutException e) {
    onDead();
  }
}

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

private void ping() throws IOException, InterruptedException {
  Future<?> f = channel.callAsync(new Ping());
  try {
    f.get(timeout,MILLISECONDS);
  } catch (ExecutionException e) {
    if (e.getCause() instanceof RequestAbortedException)
      return; // connection has shut down orderly.
    onDead();
  } catch (TimeoutException e) {
    onDead();
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/disk-usage

public static Long calculateWorkspaceDiskUsageForPath(FilePath workspace, ArrayList<FilePath> exceeded) throws IOException, InterruptedException{
  Long diskUsage = 0l;
  if(workspace.exists()){
    try{
      diskUsage = workspace.getChannel().callAsync(new DiskUsageCallable(workspace, exceeded)).get(Jenkins.getInstance().getPlugin(DiskUsagePlugin.class).getConfiguration().getTimeoutWorkspace(), TimeUnit.MINUTES);             
    }
    catch(Exception e){
      Logger.getLogger(DiskUsageUtil.class.getName()).log(Level.WARNING, "Disk usage fails to calculate workspace for file path " + workspace.getRemote() + " through channel " + workspace.getChannel(),e);
    }
  }
  return diskUsage;
}

代码示例来源:origin: ingenieux/awseb-deployment-plugin

public boolean perform() throws Exception {
    FilePath rootFileObject = new FilePath(this.workspace, config.getRootObject());

    final DeployerContext
        deployerContext = new DeployerContext(config, rootFileObject, listener);

    final VirtualChannel channel = launcher.getChannel();

    if (null == channel)
      throw new IllegalStateException("Null Channel (?)");

    final Future<Boolean>
        booleanFuture =
        channel.callAsync(new SlaveDeployerCallable(deployerContext));

    return booleanFuture.get();
  }
}

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

public void testLocalWrite2() throws Exception {
  Pipe p = Pipe.createLocalToRemote();
  Future<Integer> f = channel.callAsync(new ReadingCallable(p));
  Thread.sleep(2000); // wait for remote to connect to local.
  write(p);
  int r = f.get();
  System.out.println("result=" + r);
  assertEquals(5,r);
}

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

/**
 * Writer end closes even before the remote computation kicks in.
 */
public void testQuickBurstWrite() throws Exception {
  final Pipe p = Pipe.createLocalToRemote();
  Future<Integer> f = channel.callAsync(new QuickBurstCallable(p));
  OutputStream os = p.getOut();
  os.write(1);
  os.close();
  // at this point the async executable kicks in.
  // TODO: introduce a lock to ensure the ordering.
  assertEquals(1,(int)f.get());
}

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

/**
 * Test the "remote-write local-read" pipe.
 */
public void testRemoteWrite() throws Exception {
  Pipe p = Pipe.createRemoteToLocal();
  Future<Integer> f = channel.callAsync(new WritingCallable(p));
  read(p);
  int r = f.get();
  System.out.println("result=" + r);
  assertEquals(5,r);
}

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

/**
 * Test the "local-write remote-read" pipe.
 */
public void testLocalWrite() throws Exception {
  Pipe p = Pipe.createLocalToRemote();
  Future<Integer> f = channel.callAsync(new ReadingCallable(p));
  write(p);
  int r = f.get();
  System.out.println("result=" + r);
  assertEquals(5,r);
}

代码示例来源: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);
}

相关文章