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

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

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

Ruby.execRecursiveInternal介绍

暂无

代码示例

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

/**
 * Perform a recursive walk on the given object using the given function.
 *
 * Do not call this method directly unless you know you're within a call
 * to {@link Ruby#recursiveListOperation(java.util.concurrent.Callable) recursiveListOperation},
 * which will ensure the thread-local recursion tracking data structs are
 * cleared.
 *
 * MRI: rb_exec_recursive
 *
 * Calls func(obj, arg, recursive), where recursive is non-zero if the
 * current method is called recursively on obj
 *
 * @param func
 * @param obj
 * @return
 */
public IRubyObject execRecursive(RecursiveFunction func, IRubyObject obj) {
  if (!inRecursiveListOperation.get()) {
    throw newThreadError("BUG: execRecursive called outside recursiveListOperation");
  }
  return execRecursiveInternal(func, obj, null, false);
}

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

/**
 * Perform a recursive walk on the given object using the given function.
 * Treat this as the outermost call, cleaning up recursive structures.
 *
 * MRI: rb_exec_recursive_outer
 *
 * If recursion is detected on the current method and obj, the outermost
 * func will be called with (obj, arg, Qtrue). All inner func will be
 * short-circuited using throw.
 *
 * @param func
 * @param obj
 * @return
 */
public IRubyObject execRecursiveOuter(RecursiveFunction func, IRubyObject obj) {
  try {
    return execRecursiveInternal(func, obj, null, true);
  } finally {
    recursiveListClear();
  }
}

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

/**
 * Perform a recursive walk on the given object using the given function.
 * Treat this as the outermost call, cleaning up recursive structures.
 *
 * MRI: rb_exec_recursive_outer
 *
 * If recursion is detected on the current method and obj, the outermost
 * func will be called with (obj, arg, Qtrue). All inner func will be
 * short-circuited using throw.
 *
 * @param func
 * @param obj
 * @return
 */
public IRubyObject execRecursiveOuter(RecursiveFunction func, IRubyObject obj) {
  try {
    return execRecursiveInternal(func, obj, null, true);
  } finally {
    recursiveListClear();
  }
}

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

/**
 * Perform a recursive walk on the given object using the given function.
 *
 * Do not call this method directly unless you know you're within a call
 * to {@link Ruby#recursiveListOperation(java.util.concurrent.Callable) recursiveListOperation},
 * which will ensure the thread-local recursion tracking data structs are
 * cleared.
 *
 * MRI: rb_exec_recursive
 *
 * Calls func(obj, arg, recursive), where recursive is non-zero if the
 * current method is called recursively on obj
 *
 * @param func
 * @param obj
 * @return
 */
public IRubyObject execRecursive(RecursiveFunction func, IRubyObject obj) {
  if (!inRecursiveListOperation.get()) {
    throw newThreadError("BUG: execRecursive called outside recursiveListOperation");
  }
  return execRecursiveInternal(func, obj, null, false);
}

相关文章

微信公众号

最新文章

更多

Ruby类方法