本文整理了Java中org.jruby.Ruby.getLocalJumpError
方法的一些代码示例,展示了Ruby.getLocalJumpError
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getLocalJumpError
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getLocalJumpError
暂无
代码示例来源:origin: org.jruby/jruby-complete
public RaiseException newLocalJumpError(RubyLocalJumpError.Reason reason, IRubyObject exitValue, String message) {
return new RubyLocalJumpError(this, getLocalJumpError(), message, reason, exitValue).toThrowable();
}
代码示例来源:origin: org.jruby/jruby-core
public RaiseException newLocalJumpError(RubyLocalJumpError.Reason reason, IRubyObject exitValue, String message) {
return new RubyLocalJumpError(this, getLocalJumpError(), message, reason, exitValue).toThrowable();
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public RaiseException newLocalJumpError(RubyLocalJumpError.Reason reason, IRubyObject exitValue, String message) {
return new RaiseException(new RubyLocalJumpError(this, getLocalJumpError(), message, reason, exitValue), true);
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public RaiseException newLocalJumpError(RubyLocalJumpError.Reason reason, IRubyObject exitValue, String message) {
return new RaiseException(new RubyLocalJumpError(this, getLocalJumpError(), message, reason, exitValue), true);
}
代码示例来源:origin: org.jruby/jruby-complete
public static String getLocalJumpTypeOrRethrow(RaiseException re) {
RubyException exception = re.getException();
Ruby runtime = exception.getRuntime();
if (runtime.getLocalJumpError().isInstance(exception)) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
IRubyObject reason = jumpError.reason();
return reason.asJavaString();
}
throw re;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
public static String getLocalJumpTypeOrRethrow(RaiseException re) {
RubyException exception = re.getException();
Ruby runtime = exception.getRuntime();
if (runtime.getLocalJumpError().isInstance(exception)) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
IRubyObject reason = jumpError.reason();
return reason.asJavaString();
}
throw re;
}
代码示例来源:origin: org.jruby/jruby-core
public static String getLocalJumpTypeOrRethrow(RaiseException re) {
RubyException exception = re.getException();
Ruby runtime = exception.getRuntime();
if (runtime.getLocalJumpError().isInstance(exception)) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
IRubyObject reason = jumpError.reason();
return reason.asJavaString();
}
throw re;
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
public static String getLocalJumpTypeOrRethrow(RaiseException re) {
RubyException exception = re.getException();
Ruby runtime = exception.getRuntime();
if (runtime.getLocalJumpError().isInstance(exception)) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
IRubyObject reason = jumpError.reason();
return reason.asJavaString();
}
throw re;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
private static IRubyObject exchangeWithFiber(ThreadContext context, FiberData currentFiberData, FiberData targetFiberData, IRubyObject val) {
targetFiberData.queue.push(context, val);
while (true) {
try {
IRubyObject result = currentFiberData.queue.pop(context);
if (result == NEVER) result = context.nil;
return result;
} catch (RaiseException re) {
// If we received a LJC we need to bubble it out
if (context.runtime.getLocalJumpError().isInstance(re.getException())) {
throw re;
}
// If we were trying to yield but our queue has been shut down,
// let the exception bubble out and (ideally) kill us.
if (currentFiberData.queue.isShutdown()) {
throw re;
}
// re-raise if the target fiber has been shut down
if (targetFiberData.queue.isShutdown()) {
throw re;
}
// Otherwise, we want to forward the exception to the target fiber
// since it has the ball
targetFiberData.fiber.get().thread.raise(re.getException());
}
}
}
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
break loop;
} catch (RaiseException re) {
if (runtime.getLocalJumpError().isInstance(re.getException())) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
break loop;
} catch (RaiseException re) {
if (runtime.getLocalJumpError().isInstance(re.getException())) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
代码示例来源:origin: org.jruby/jruby-complete
if (context.runtime.getLocalJumpError().isInstance(re.getException())) {
throw re;
代码示例来源:origin: org.jruby/jruby-core
if (context.runtime.getLocalJumpError().isInstance(re.getException())) {
throw re;
代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby
/**
* If it's Redo, Next, or Break, rethrow it as a normal exception for while to handle
* @param re
* @param context
*/
public static Throwable unwrapRedoNextBreakOrJustLocalJump(RaiseException re, ThreadContext context) {
RubyException exception = re.getException();
if (context.runtime.getLocalJumpError().isInstance(exception)) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
switch (jumpError.getReason()) {
case REDO:
return JumpException.REDO_JUMP;
case NEXT:
return new JumpException.NextJump(jumpError.exit_value());
case BREAK:
return new JumpException.BreakJump(context.getFrameJumpTarget(), jumpError.exit_value());
}
}
return re;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
/**
* If it's Redo, Next, or Break, rethrow it as a normal exception for while to handle
* @param re
* @param context
*/
public static Throwable unwrapRedoNextBreakOrJustLocalJump(RaiseException re, ThreadContext context) {
RubyException exception = re.getException();
if (context.runtime.getLocalJumpError().isInstance(exception)) {
RubyLocalJumpError jumpError = (RubyLocalJumpError)re.getException();
switch (jumpError.getReason()) {
case REDO:
return JumpException.REDO_JUMP;
case NEXT:
if (jumpError.exit_value().isNil()) throw JumpException.NEXT_JUMP;
return new JumpException.NextJump(jumpError.exit_value());
case BREAK:
return new JumpException.BreakJump(context.getFrameJumpTarget(), jumpError.exit_value());
}
}
return re;
}
内容来源于网络,如有侵权,请联系作者删除!