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

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

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

Ruby.tearDown介绍

[英]Make sure Kernel#at_exit procs get invoked on runtime shutdown. This method needs to be explicitly called to work properly. I thought about using finalize(), but that did not work and I am not sure the runtime will be at a state to run procs by the time Ruby is going away. This method can contain any other things that need to be cleaned up at shutdown.
[中]确保在运行时关闭时调用内核#at_exit procs。需要显式调用此方法才能正常工作。我曾考虑过使用finalize(),但这不起作用,而且我不确定Ruby离开时运行时是否处于运行procs的状态。此方法可以包含在关机时需要清理的任何其他内容。

代码示例

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

/**
 * Make sure Kernel#at_exit procs get invoked on runtime shutdown.
 * This method needs to be explicitly called to work properly.
 * I thought about using finalize(), but that did not work and I
 * am not sure the runtime will be at a state to run procs by the
 * time Ruby is going away.  This method can contain any other
 * things that need to be cleaned up at shutdown.
 */
public void tearDown() {
  tearDown(true);
}

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

/**
 * Dispose of the runtime you initialized.
 *
 * @param runtime to be disposed of
 */
public static void terminate(Ruby runtime) {
  runtime.tearDown();
}

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

/**
 * Make sure Kernel#at_exit procs get invoked on runtime shutdown.
 * This method needs to be explicitly called to work properly.
 * I thought about using finalize(), but that did not work and I
 * am not sure the runtime will be at a state to run procs by the
 * time Ruby is going away.  This method can contain any other
 * things that need to be cleaned up at shutdown.
 */
public void tearDown() {
  tearDown(true);
}

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

/**
 * Dispose of the runtime you initialized.
 *
 * @param runtime to be disposed of
 */
public static void terminate(Ruby runtime) {
  runtime.tearDown();
}

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

/**
 * Make sure Kernel#at_exit procs getService invoked on runtime shutdown.
 * This method needs to be explicitly called to work properly.
 * I thought about using finalize(), but that did not work and I
 * am not sure the runtime will be at a state to run procs by the
 * time Ruby is going away.  This method can contain any other
 * things that need to be cleaned up at shutdown.
 */
public void tearDown() {
  tearDown(true);
}

代码示例来源:origin: asciidoctor/asciidoctorj

@Override
public void shutdown() {
  this.rubyRuntime.tearDown();
}

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

/**
 * Make sure Kernel#at_exit procs getService invoked on runtime shutdown.
 * This method needs to be explicitly called to work properly.
 * I thought about using finalize(), but that did not work and I
 * am not sure the runtime will be at a state to run procs by the
 * time Ruby is going away.  This method can contain any other
 * things that need to be cleaned up at shutdown.
 */
public void tearDown() {
  tearDown(true);
}

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

/**
 * Dispose of the runtime you initialized.
 * 
 * @param runtime to be disposed of
 */
public static void terminate(Ruby runtime) {
  runtime.tearDown();
}

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

/**
 * Dispose of the runtime you initialized.
 * 
 * @param runtime to be disposed of
 */
public static void terminate(Ruby runtime) {
  runtime.tearDown();
}

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

@Override
public void destroy() {
  runtime.tearDown(false);
}

代码示例来源:origin: org.asciidoctor/asciidoctorj

@Override
public void shutdown() {
  this.rubyRuntime.tearDown();
}

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

public void run() {
    if (didTeardown.compareAndSet(false, true)) {
      runtime.tearDown();
    }
  }
});

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

public void run() {
    if (didTeardown.compareAndSet(false, true)) {
      runtime.tearDown();
    }
  }
});

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

public void run() {
    if (didTeardown.compareAndSet(false, true)) {
      runtime.tearDown();
    }
  }
});

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

public void run() {
    if (didTeardown.compareAndSet(false, true)) {
      runtime.tearDown();
    }
  }
});

代码示例来源:origin: twineworks/ruby-for-pentaho-kettle

private void forceStopRubyThreads() {
 // if the container is disposed already, bail out
 if (data.container == null) return;
 // try to kill all threads once
 if (!data.forcedHalt) {
  data.forcedHalt = true;
 } else {
  return;
 }
 if (data.runtime != null) {
  RubyThread[] threads = data.runtime.getThreadService().getActiveRubyThreads();
  for (int i = 0; i < threads.length; i++) {
   try {
    threads[i].kill();
   } catch (ThreadKill e) {
   }
  }
  data.runtime.tearDown();
 }
}

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

/**
 * Cleanly shut down this ScriptingContainer and any JRuby resources it holds.
 * All ScriptingContainer instances should be terminated when you are done with
 * them, rather then leaving them for GC to finalize.
 *
 * @since JRuby 1.5.0
 */
public void terminate() {
  if (getProvider().isRuntimeInitialized()) getProvider().getRuntime().tearDown(false);
  getProvider().terminate();
}

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

/**
 * Cleanly shut down this ScriptingContainer and any JRuby resources it holds.
 * All ScriptingContainer instances should be terminated when you are done with
 * them, rather then leaving them for GC to finalize.
 *
 * @since JRuby 1.5.0
 */
public void terminate() {
  if (getProvider().isRuntimeInitialized()) getProvider().getRuntime().tearDown(false);
  getProvider().terminate();
}

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

/**
 * Cleanly shut down this ScriptingContainer and any JRuby resources it holds.
 * All ScriptingContainer instances should be terminated when you are done with
 * them, rather then leaving them for GC to finalize.
 *
 * @since JRuby 1.5.0
 */
public void terminate() {
  LocalContextProvider provider = getProvider();
  if (provider.isRuntimeInitialized()) {
    provider.getRuntime().tearDown(false);
    provider.getRuntime().releaseClassLoader();
  }
  provider.terminate();
}

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

/**
 * Cleanly shut down this ScriptingContainer and any JRuby resources it holds.
 * All ScriptingContainer instances should be terminated when you are done with
 * them, rather then leaving them for GC to finalize.
 *
 * @since JRuby 1.5.0
 */
public void terminate() {
  LocalContextProvider provider = getProvider();
  if (provider.isRuntimeInitialized()) {
    provider.getRuntime().tearDown(false);
    provider.getRuntime().releaseClassLoader();
  }
  provider.terminate();
}

相关文章

微信公众号

最新文章

更多

Ruby类方法