org.jruby.Ruby.getOut()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(12.5k)|赞(0)|评价(0)|浏览(105)

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

Ruby.getOut介绍

暂无

代码示例

代码示例来源:origin: org.jruby/jruby-complete

private void pumpInput(Process child, Ruby runtime) {
  // no read requested, hook up read to parents output
  InputStream childIn = ChannelHelper.unwrapBufferedStream(child.getInputStream());
  FileChannel childInChannel = null;
  if (childIn instanceof FileInputStream) {
    childInChannel = ((FileInputStream) childIn).getChannel();
  }
  OutputStream parentOut = ChannelHelper.unwrapBufferedStream(runtime.getOut());
  FileChannel parentOutChannel = null;
  if (parentOut instanceof FileOutputStream) {
    parentOutChannel = ((FileOutputStream) parentOut).getChannel();
  }
  if (childInChannel != null && parentOutChannel != null) {
    inputPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
  } else {
    inputPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
  }
  inputPumper.start();
  input = null;
  inputChannel = null;
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private void pumpInput(Process child, Ruby runtime) {
  // no read requested, hook up read to parents output
  InputStream childIn = unwrapBufferedStream(child.getInputStream());
  FileChannel childInChannel = null;
  if (childIn instanceof FileInputStream) {
    childInChannel = ((FileInputStream) childIn).getChannel();
  }
  OutputStream parentOut = unwrapBufferedStream(runtime.getOut());
  FileChannel parentOutChannel = null;
  if (parentOut instanceof FileOutputStream) {
    parentOutChannel = ((FileOutputStream) parentOut).getChannel();
  }
  if (childInChannel != null && parentOutChannel != null) {
    inputPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
  } else {
    inputPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
  }
  inputPumper.start();
  input = null;
  inputChannel = null;
}

代码示例来源:origin: org.jruby/jruby-complete

private void pumpInerr(Process child, Ruby runtime) {
    // no read requested, hook up read to parents output
    InputStream childIn = ChannelHelper.unwrapBufferedStream(child.getErrorStream());
    FileChannel childInChannel = null;
    if (childIn instanceof FileInputStream) {
      childInChannel = ((FileInputStream) childIn).getChannel();
    }
    OutputStream parentOut = ChannelHelper.unwrapBufferedStream(runtime.getOut());
    FileChannel parentOutChannel = null;
    if (parentOut instanceof FileOutputStream) {
      parentOutChannel = ((FileOutputStream) parentOut).getChannel();
    }
    if (childInChannel != null && parentOutChannel != null) {
      inerrPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
    } else {
      inerrPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
    }
    inerrPumper.start();
    inerr = null;
    inerrChannel = null;
  }
}

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

private void pumpInput(Process child, Ruby runtime) {
  // no read requested, hook up read to parents output
  InputStream childIn = ChannelHelper.unwrapBufferedStream(child.getInputStream());
  FileChannel childInChannel = null;
  if (childIn instanceof FileInputStream) {
    childInChannel = ((FileInputStream) childIn).getChannel();
  }
  OutputStream parentOut = ChannelHelper.unwrapBufferedStream(runtime.getOut());
  FileChannel parentOutChannel = null;
  if (parentOut instanceof FileOutputStream) {
    parentOutChannel = ((FileOutputStream) parentOut).getChannel();
  }
  if (childInChannel != null && parentOutChannel != null) {
    inputPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
  } else {
    inputPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
  }
  inputPumper.start();
  input = null;
  inputChannel = null;
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private void pumpInput(Process child, Ruby runtime) {
  // no read requested, hook up read to parents output
  InputStream childIn = unwrapBufferedStream(child.getInputStream());
  FileChannel childInChannel = null;
  if (childIn instanceof FileInputStream) {
    childInChannel = ((FileInputStream) childIn).getChannel();
  }
  OutputStream parentOut = unwrapBufferedStream(runtime.getOut());
  FileChannel parentOutChannel = null;
  if (parentOut instanceof FileOutputStream) {
    parentOutChannel = ((FileOutputStream) parentOut).getChannel();
  }
  if (childInChannel != null && parentOutChannel != null) {
    inputPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
  } else {
    inputPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
  }
  inputPumper.start();
  input = null;
  inputChannel = null;
}

代码示例来源:origin: org.jruby/jruby-complete

@Override
public void report(ProfileCollection collector) {
  if(!(collector instanceof ProfileData))
    throw new IllegalArgumentException( "Given collector must be an instance of " + ProfileData.class.getName() + "." );
  RubyInstanceConfig config = getConfig();
  ProfileData   profileData = (ProfileData) collector;
  ProfileOutput      output = config.getProfileOutput();
  ProfilePrinter profilePrinter = ProfilePrinter.newPrinter( config.getProfilingMode(), profileData );
  if (profilePrinter != null) {
    output.printProfile(profilePrinter);
  } else {
    getRuntime().getOut().println("\nno printer for profile mode: " + config.getProfilingMode() + " !");
  }
}

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

private void pumpInerr(Process child, Ruby runtime) {
    // no read requested, hook up read to parents output
    InputStream childIn = ChannelHelper.unwrapBufferedStream(child.getErrorStream());
    FileChannel childInChannel = null;
    if (childIn instanceof FileInputStream) {
      childInChannel = ((FileInputStream) childIn).getChannel();
    }
    OutputStream parentOut = ChannelHelper.unwrapBufferedStream(runtime.getOut());
    FileChannel parentOutChannel = null;
    if (parentOut instanceof FileOutputStream) {
      parentOutChannel = ((FileOutputStream) parentOut).getChannel();
    }
    if (childInChannel != null && parentOutChannel != null) {
      inerrPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
    } else {
      inerrPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
    }
    inerrPumper.start();
    inerr = null;
    inerrChannel = null;
  }
}

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

@Override
public void report(ProfileCollection collector) {
  if(!(collector instanceof ProfileData))
    throw new IllegalArgumentException( "Given collector must be an instance of " + ProfileData.class.getName() + "." );
  RubyInstanceConfig config = getConfig();
  ProfileData   profileData = (ProfileData) collector;
  ProfileOutput      output = config.getProfileOutput();
  ProfilePrinter profilePrinter = ProfilePrinter.newPrinter( config.getProfilingMode(), profileData );
  if (profilePrinter != null) {
    output.printProfile(profilePrinter);
  } else {
    getRuntime().getOut().println("\nno printer for profile mode: " + config.getProfilingMode() + " !");
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

private void pumpInerr(Process child, Ruby runtime) {
    // no read requested, hook up read to parents output
    InputStream childIn = unwrapBufferedStream(child.getErrorStream());
    FileChannel childInChannel = null;
    if (childIn instanceof FileInputStream) {
      childInChannel = ((FileInputStream) childIn).getChannel();
    }
    OutputStream parentOut = unwrapBufferedStream(runtime.getOut());
    FileChannel parentOutChannel = null;
    if (parentOut instanceof FileOutputStream) {
      parentOutChannel = ((FileOutputStream) parentOut).getChannel();
    }
    if (childInChannel != null && parentOutChannel != null) {
      inerrPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
    } else {
      inerrPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
    }
    inerrPumper.start();
    inerr = null;
    inerrChannel = null;
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

private void pumpInerr(Process child, Ruby runtime) {
    // no read requested, hook up read to parents output
    InputStream childIn = unwrapBufferedStream(child.getErrorStream());
    FileChannel childInChannel = null;
    if (childIn instanceof FileInputStream) {
      childInChannel = ((FileInputStream) childIn).getChannel();
    }
    OutputStream parentOut = unwrapBufferedStream(runtime.getOut());
    FileChannel parentOutChannel = null;
    if (parentOut instanceof FileOutputStream) {
      parentOutChannel = ((FileOutputStream) parentOut).getChannel();
    }
    if (childInChannel != null && parentOutChannel != null) {
      inerrPumper = new ChannelPumper(runtime, childInChannel, parentOutChannel, Pumper.Slave.IN, this);
    } else {
      inerrPumper = new StreamPumper(runtime, childIn, parentOut, false, Pumper.Slave.IN, this);
    }
    inerrPumper.start();
    inerr = null;
    inerrChannel = null;
  }
}

代码示例来源:origin: org.jruby/jruby-complete

@Deprecated
public RubyIO(Ruby runtime, STDIO stdio) {
  super(runtime, runtime.getIO());
  RubyIO tmp = null;
  switch (stdio) {
    case IN:
      tmp = prepStdio(runtime, runtime.getIn(), Channels.newChannel(runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
      break;
    case OUT:
      tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
      break;
    case ERR:
      tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
      break;
  }
  this.openFile = tmp.openFile;
  tmp.openFile = null;
}

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

@Deprecated
public RubyIO(Ruby runtime, STDIO stdio) {
  super(runtime, runtime.getIO());
  RubyIO tmp = null;
  switch (stdio) {
    case IN:
      tmp = prepStdio(runtime, runtime.getIn(), Channels.newChannel(runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
      break;
    case OUT:
      tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
      break;
    case ERR:
      tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
      break;
  }
  this.openFile = tmp.openFile;
  tmp.openFile = null;
}

代码示例来源:origin: org.jruby.rack/jruby-rack

@SuppressWarnings("unchecked")
void doInitialize(final Ruby runtime) {
  setOut( runtime.getOut() );
  setErr( runtime.getErr() );
  rubyENV = runtime.getENV();
  compatVersion = runtime.getInstanceConfig().getCompatVersion();
}

代码示例来源:origin: org.jruby/jruby-complete

break;
case 1:
  fd = new ChannelFD(Channels.newChannel(runtime.getOut()), runtime.getPosix(), runtime.getFilenoUtil());
  break;
case 2:

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

break;
case 1:
  fd = new ChannelFD(Channels.newChannel(runtime.getOut()), runtime.getPosix(), runtime.getFilenoUtil());
  break;
case 2:

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

break;
case OUT:
  descriptor = new ChannelDescriptor(Channels.newChannel(runtime.getOut()), newModeFlags(runtime, ModeFlags.WRONLY | ModeFlags.APPEND), FileDescriptor.out);
  runtime.putFilenoMap(1, descriptor.getFileno());
  mainStream = ChannelStream.open(runtime, descriptor);

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

break;
case OUT:
  descriptor = new ChannelDescriptor(Channels.newChannel(runtime.getOut()), newModeFlags(runtime, ModeFlags.WRONLY | ModeFlags.APPEND), FileDescriptor.out);
  runtime.putFilenoMap(1, descriptor.getFileno());
  mainStream = ChannelStream.open(runtime, descriptor);

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

runtime, runtime.getIn(), new NativeDeviceChannel(0), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
stdout = RubyIO.prepStdio(
    runtime, runtime.getOut(), new NativeDeviceChannel(1), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
stderr = RubyIO.prepStdio(
    runtime, runtime.getErr(), new NativeDeviceChannel(2), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
    runtime, runtime.getIn(), prepareStdioChannel(runtime, STDIO.IN, runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
stdout = RubyIO.prepStdio(
    runtime, runtime.getOut(), prepareStdioChannel(runtime, STDIO.OUT, runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
stderr = RubyIO.prepStdio(
    runtime, runtime.getErr(), prepareStdioChannel(runtime, STDIO.ERR, runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");

代码示例来源:origin: org.jruby/jruby-complete

runtime, runtime.getIn(), new NativeDeviceChannel(0), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
stdout = RubyIO.prepStdio(
    runtime, runtime.getOut(), new NativeDeviceChannel(1), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
stderr = RubyIO.prepStdio(
    runtime, runtime.getErr(), new NativeDeviceChannel(2), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");
    runtime, runtime.getIn(), prepareStdioChannel(runtime, STDIO.IN, runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "<STDIN>");
stdout = RubyIO.prepStdio(
    runtime, runtime.getOut(), prepareStdioChannel(runtime, STDIO.OUT, runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "<STDOUT>");
stderr = RubyIO.prepStdio(
    runtime, runtime.getErr(), prepareStdioChannel(runtime, STDIO.ERR, runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "<STDERR>");

相关文章

微信公众号

最新文章

更多

Ruby类方法