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

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

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

Ruby.hasEventHooks介绍

暂无

代码示例

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

private static void methodPostTrace(Ruby runtime, ThreadContext context, String name, RubyModule implClass) {
  if (runtime.hasEventHooks()) context.trace(RubyEvent.RETURN, name, implClass);
}

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

private static void methodPreTrace(Ruby runtime, ThreadContext context, String name, RubyModule implClass) {
  if (runtime.hasEventHooks()) context.trace(RubyEvent.CALL, name, implClass);
}

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

private static void methodPreTrace(Ruby runtime, ThreadContext context, String name, RubyModule implClass) {
  if (runtime.hasEventHooks()) context.trace(RubyEvent.CALL, name, implClass);
}

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

private static void methodPostTrace(Ruby runtime, ThreadContext context, String name, RubyModule implClass) {
    if (runtime.hasEventHooks()) context.trace(RubyEvent.RETURN, name, implClass);
  }
}

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

private static void methodPostTrace(Ruby runtime, ThreadContext context, String name, RubyModule implClass) {
    if (runtime.hasEventHooks()) context.trace(RubyEvent.RETURN, name, implClass);
  }
}

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

protected void post(Ruby runtime, ThreadContext context, String name) {
  if (runtime.hasEventHooks()) traceReturn(context, runtime, name);
  
  callConfig.post(context);
}

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

protected void post(Ruby runtime, ThreadContext context, String name) {
  if (runtime.hasEventHooks()) traceReturn(context, runtime, name);
  
  callConfig.post(context);
}

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

private static void blockPostTrace(Ruby runtime, ThreadContext context, String name, RubyModule implClass) {
  if (runtime.hasEventHooks() && runtime.is2_0()) context.trace(RubyEvent.B_RETURN, name, implClass);
}

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

@JIT
public static void callTrace(ThreadContext context, RubyEvent event, String name, String filename, int line) {
  if (context.runtime.hasEventHooks()) {
    // FIXME: Try and statically generate END linenumber instead of hacking it.
    int linenumber = line == -1 ? context.getLine()+1 : line;
    context.trace(event, name, context.getFrameKlazz(), filename, linenumber);
  }
}

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

@JIT
public static void callTrace(ThreadContext context, RubyEvent event, String name, String filename, int line) {
  if (context.runtime.hasEventHooks()) {
    // FIXME: Try and statically generate END linenumber instead of hacking it.
    int linenumber = line == -1 ? context.getLine()+1 : line;
    context.trace(event, name, context.getFrameKlazz(), filename, linenumber);
  }
}

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

@Override
public IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
  ISourcePosition position = getPosition();
  // something in here is used to build up ruby stack trace...
  context.setLine(position.getLine());
  if (runtime.hasEventHooks()) {
    ASTInterpreter.callTraceFunction(runtime, context, RubyEvent.LINE);
  }
  // TODO: do above but not below for additional newline nodes
  return nextNode.interpret(runtime, context, self, aBlock);
}

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

private static void doCallEventHook(final ThreadContext context) {
  if (context.runtime.hasEventHooks()) {
    context.runtime.callEventHooks(context, RubyEvent.RAISE, context.getFile(), context.getLine(), context.getFrameName(), context.getFrameKlazz());
  }
}

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

private void doCallEventHook(ThreadContext context) {
  if (context.runtime.hasEventHooks()) {
    context.runtime.callEventHooks(context, RubyEvent.RAISE, context.getFile(), context.getLine(), context.getFrameName(), context.getFrameKlazz());
  }
}

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

protected void pre(ThreadContext context, IRubyObject self, String name, Block block, int argsLength) {
  Ruby runtime = context.runtime;
  callConfig.pre(context, self, getImplementationClass(), name, block, staticScope);
  getArity().checkArity(runtime, argsLength);
  
  if (runtime.hasEventHooks()) traceCall(context, runtime, name);
}

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

private void doCallEventHook(ThreadContext context) {
  if (context.runtime.hasEventHooks()) {
    context.runtime.callEventHooks(context, RubyEvent.RAISE, context.getFile(), context.getLine(), context.getFrameName(), context.getFrameKlazz());
  }
}

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

private static void doCallEventHook(final ThreadContext context) {
  if (context.runtime.hasEventHooks()) {
    context.runtime.callEventHooks(context, RubyEvent.RAISE, context.getFile(), context.getLine(), context.getFrameName(), context.getFrameKlazz());
  }
}

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

protected void pre(ThreadContext context, IRubyObject self, String name, Block block, int argsLength) {
  Ruby runtime = context.runtime;
  callConfig.pre(context, self, getImplementationClass(), name, block, staticScope);
  getArity().checkArity(runtime, argsLength);
  
  if (runtime.hasEventHooks()) traceCall(context, runtime, name);
}

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

@Override
public IRubyObject interpret(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) {
  ISourcePosition position = getPosition();
  // something in here is used to build up ruby stack trace...
  context.setLine(position.getLine());
  if (runtime.hasEventHooks()) {
    ASTInterpreter.callTraceFunction(runtime, context, RubyEvent.LINE);
  }
  // TODO: do above but not below for additional newline nodes
  return nextNode.interpret(runtime, context, self, aBlock);
}

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

public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) {
  assert args != null;
  Ruby runtime = context.runtime;
  
  if (runtime.hasEventHooks()) {
    runtime.callEventHooks(context, RubyEvent.C_CALL, context.getFile(), context.getLine(), name, getImplementationClass());
    try {
      return callback.execute(self, args, block);
    } finally {
      runtime.callEventHooks(context, RubyEvent.C_RETURN, context.getFile(), context.getLine(), name, getImplementationClass());
    }
  }
  
  return callback.execute(self, args, block);
}

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

public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule klazz, String name, IRubyObject[] args, Block block) {
  assert args != null;
  Ruby runtime = context.runtime;
  
  if (runtime.hasEventHooks()) {
    runtime.callEventHooks(context, RubyEvent.C_CALL, context.getFile(), context.getLine(), name, getImplementationClass());
    try {
      return callback.execute(self, args, block);
    } finally {
      runtime.callEventHooks(context, RubyEvent.C_RETURN, context.getFile(), context.getLine(), name, getImplementationClass());
    }
  }
  
  return callback.execute(self, args, block);
}

相关文章

Ruby类方法