本文整理了Java中org.jruby.Ruby.hasEventHooks
方法的一些代码示例,展示了Ruby.hasEventHooks
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.hasEventHooks
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!