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

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

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

Ruby.addInternalFinalizer介绍

暂无

代码示例

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

  1. private ChannelStream(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) {
  2. this.runtime = runtime;
  3. this.descriptor = descriptor;
  4. this.modes = descriptor.getOriginalModes();
  5. buffer = ByteBuffer.allocate(BUFSIZE);
  6. buffer.flip();
  7. this.reading = true;
  8. this.autoclose = autoclose;
  9. runtime.addInternalFinalizer(this);
  10. }

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

  1. private ChannelStream(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) {
  2. this.runtime = runtime;
  3. this.descriptor = descriptor;
  4. this.modes = descriptor.getOriginalModes();
  5. buffer = ByteBuffer.allocate(BUFSIZE);
  6. buffer.flip();
  7. this.reading = true;
  8. this.autoclose = autoclose;
  9. runtime.addInternalFinalizer(this);
  10. }

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

  1. private ChannelStream(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) {
  2. this.runtime = runtime;
  3. this.descriptor = descriptor;
  4. this.modes = descriptor.getOriginalModes();
  5. buffer = ByteBuffer.allocate(BUFSIZE);
  6. buffer.flip();
  7. this.reading = true;
  8. this.autoclose = autoclose;
  9. runtime.addInternalFinalizer(this);
  10. }

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

  1. private ChannelStream(Ruby runtime, ChannelDescriptor descriptor, boolean autoclose) {
  2. this.runtime = runtime;
  3. this.descriptor = descriptor;
  4. this.modes = descriptor.getOriginalModes();
  5. buffer = ByteBuffer.allocate(BUFSIZE);
  6. buffer.flip();
  7. this.reading = true;
  8. this.autoclose = autoclose;
  9. runtime.addInternalFinalizer(this);
  10. }

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

  1. private IRubyObject initializeCommon(ThreadContext context, IRubyObject[] args) {
  2. BlockCallback body = new TempfileCallback();
  3. // #create and #make_tmpname come from Dir::Tmpname, included into
  4. // tempfile in lib/ruby/stdlib/tempfile.rb. We use create here to
  5. // match filename algorithm and allow them to be overridden.
  6. callMethod(context, "create", args, CallBlock19.newCallClosure(this, getMetaClass(), Signature.OPTIONAL, body, context));
  7. // GH#1905: don't use JDK's deleteOnExit because it grows a set without bounds
  8. context.runtime.addInternalFinalizer(Tempfile.this);
  9. return context.nil;
  10. }

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

  1. private IRubyObject initializeCommon(ThreadContext context, IRubyObject[] args) {
  2. BlockCallback body = new TempfileCallback();
  3. // #create and #make_tmpname come from Dir::Tmpname, included into
  4. // tempfile in lib/ruby/stdlib/tempfile.rb. We use create here to
  5. // match filename algorithm and allow them to be overridden.
  6. callMethod(context, "create", args, CallBlock19.newCallClosure(this, getMetaClass(), Signature.OPTIONAL, body, context));
  7. // GH#1905: don't use JDK's deleteOnExit because it grows a set without bounds
  8. context.runtime.addInternalFinalizer(Tempfile.this);
  9. return context.nil;
  10. }

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

  1. public final OpenFile MakeOpenFile() {
  2. Ruby runtime = getRuntime();
  3. if (openFile != null) {
  4. rbIoClose(runtime.getCurrentContext());
  5. rb_io_fptr_finalize(runtime, openFile);
  6. openFile = null;
  7. }
  8. openFile = new OpenFile(runtime.getNil());
  9. runtime.addInternalFinalizer(openFile);
  10. return openFile;
  11. }

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

  1. public final OpenFile MakeOpenFile() {
  2. Ruby runtime = getRuntime();
  3. if (openFile != null) {
  4. rbIoClose(runtime.getCurrentContext());
  5. rb_io_fptr_finalize(runtime, openFile);
  6. openFile = null;
  7. }
  8. openFile = new OpenFile(runtime.getNil());
  9. runtime.addInternalFinalizer(openFile);
  10. return openFile;
  11. }

相关文章

Ruby类方法