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

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

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

Channel.flushPipe介绍

暂无

代码示例

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

public Void invoke(File f, VirtualChannel channel) throws IOException {
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(f);
      Util.copyStream(fis,out);
      try {
        if (Channel.current() != null){
          Channel.current().flushPipe();
        }
      } catch (InterruptedException ex) {
        Logger.getLogger(FilePath.class.getName()).log(Level.SEVERE, null, ex);
      }
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(out);
    }
  }
});

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public Void invoke(File f, VirtualChannel channel) throws IOException {
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(f);
      Util.copyStream(fis,out);
      try {
        if (Channel.current() != null){
          Channel.current().flushPipe();
        }
      } catch (InterruptedException ex) {
        Logger.getLogger(FilePath.class.getName()).log(Level.SEVERE, null, ex);
      }
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(out);
    }
  }
});

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

public Void invoke(File f, VirtualChannel channel) throws IOException {
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(f);
      Util.copyStream(fis, out);
      try {
        if (Channel.current() != null) {
          Channel.current().flushPipe();
        }
      } catch (InterruptedException ex) {
        Logger.getLogger(FilePath.class.getName()).log(Level.SEVERE, null, ex);
      }
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(out);
    }
  }
});

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

public Void invoke(File f, VirtualChannel channel) throws IOException {
    FileInputStream fis = null;
    try {
      fis = new FileInputStream(f);
      Util.copyStream(fis,out);
      try {
        if (Channel.current() != null){
          Channel.current().flushPipe();
        }
      } catch (InterruptedException ex) {
        Logger.getLogger(FilePath.class.getName()).log(Level.SEVERE, null, ex);
      }
      return null;
    } finally {
      IOUtils.closeQuietly(fis);
      IOUtils.closeQuietly(out);
    }
  }
});

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

public Integer call() throws IOException {
  Launcher.ProcStarter ps = new LocalLauncher(listener).launch();
  ps.cmds(cmd).masks(masks).envs(env).stdin(in).stdout(out).stderr(err);
  if(workDir!=null)   ps.pwd(workDir);
  Proc p = ps.start();
  try {
    return p.join();
  } catch (InterruptedException e) {
    return -1;
  } finally{
    try {
      // Fix: http://issues.hudson-ci.org/browse/HUDSON-7809
      // This call should not return immediately after the
      // process is done. The pipe associated with the channel
      // may be still transmitting data.
      // Get the channel associated with this thread and flush
      // its IO pipe
      Channel.current().flushPipe();
    } catch (InterruptedException ex) {
      Logger.getLogger(Launcher.class.getName()).log(Level.INFO, null, ex);
    }
  }
}

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

public Integer call() throws IOException {
  Launcher.ProcStarter ps = new LocalLauncher(listener).launch();
  ps.cmds(cmd).masks(masks).envs(env).stdin(in).stdout(out).stderr(err);
  if(workDir!=null)   ps.pwd(workDir);
  Proc p = ps.start();
  try {
    return p.join();
  } catch (InterruptedException e) {
    return -1;
  } finally{
    try {
      // Fix: http://issues.hudson-ci.org/browse/HUDSON-7809
      // This call should not return immediately after the
      // process is done. The pipe associated with the channel
      // may be still transmitting data.
      // Get the channel associated with this thread and flush
      // its IO pipe
      Channel.current().flushPipe();
    } catch (InterruptedException ex) {
      Logger.getLogger(Launcher.class.getName()).log(Level.INFO, null, ex);
    }
  }
}

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

public Integer call() throws IOException {
  Launcher.ProcStarter ps = new LocalLauncher(listener).launch();
  ps.cmds(cmd).masks(masks).envs(env).stdin(in).stdout(out).stderr(err);
  if (workDir != null) {
    ps.pwd(workDir);
  }
  Proc p = ps.start();
  try {
    return p.join();
  } catch (InterruptedException e) {
    return -1;
  } finally {
    try {
      // Fix: http://issues.hudson-ci.org/browse/HUDSON-7809
      // This call should not return immediately after the
      // process is done. The pipe associated with the channel
      // may be still transmitting data.
      // Get the channel associated with this thread and flush
      // its IO pipe
      Channel.current().flushPipe();
    } catch (InterruptedException ex) {
      Logger.getLogger(Launcher.class.getName()).log(Level.INFO, null, ex);
    }
  }
}
private static final long serialVersionUID = 1L;

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

public Integer call() throws IOException {
  Launcher.ProcStarter ps = new LocalLauncher(listener).launch();
  ps.cmds(cmd).masks(masks).envs(env).stdin(in).stdout(out).stderr(err);
  if(workDir!=null)   ps.pwd(workDir);
  Proc p = ps.start();
  try {
    return p.join();
  } catch (InterruptedException e) {
    return -1;
  } finally{
    try {
      // Fix: http://issues.hudson-ci.org/browse/HUDSON-7809
      // This call should not return immediately after the
      // process is done. The pipe associated with the channel
      // may be still transmitting data.
      // Get the channel associated with this thread and flush
      // its IO pipe
      Channel.current().flushPipe();
    } catch (InterruptedException ex) {
      Logger.getLogger(Launcher.class.getName()).log(Level.INFO, null, ex);
    }
  }
}

相关文章