热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

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

本文整理了Java中org.jruby.Ruby.getOut方法的一些代码示例,展示了Ruby.getOut的具体用法。这些代码示例主要来源

本文整理了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(), "");
break;
case OUT:
tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "");
break;
case ERR:
tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "");
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(), "");
break;
case OUT:
tmp = prepStdio(runtime, runtime.getOut(), Channels.newChannel(runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "");
break;
case ERR:
tmp = prepStdio(runtime, runtime.getErr(), Channels.newChannel(runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "");
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(), "");
stdout = RubyIO.prepStdio(
runtime, runtime.getOut(), new NativeDeviceChannel(1), OpenFile.WRITABLE, runtime.getIO(), "");
stderr = RubyIO.prepStdio(
runtime, runtime.getErr(), new NativeDeviceChannel(2), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "");
runtime, runtime.getIn(), prepareStdioChannel(runtime, STDIO.IN, runtime.getIn()), OpenFile.READABLE, runtime.getIO(), "");
stdout = RubyIO.prepStdio(
runtime, runtime.getOut(), prepareStdioChannel(runtime, STDIO.OUT, runtime.getOut()), OpenFile.WRITABLE, runtime.getIO(), "");
stderr = RubyIO.prepStdio(
runtime, runtime.getErr(), prepareStdioChannel(runtime, STDIO.ERR, runtime.getErr()), OpenFile.WRITABLE | OpenFile.SYNC, runtime.getIO(), "");

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

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

推荐阅读
author-avatar
真实的嘻嘻哈哈
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有