本文整理了Java中org.jruby.Ruby.getCaches
方法的一些代码示例,展示了Ruby.getCaches
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ruby.getCaches
方法的具体详情如下:
包路径:org.jruby.Ruby
类名称:Ruby
方法名:getCaches
[英]Get the Caches management object.
[中]获取缓存管理对象。
代码示例来源:origin: org.jruby/jruby-core
public static Invalidator newConstantInvalidator(Ruby runtime) {
return new ConstantInvalidator(runtime.getCaches());
}
代码示例来源:origin: org.jruby/jruby-complete
public static Invalidator newConstantInvalidator(Ruby runtime) {
return new ConstantInvalidator(runtime.getCaches());
}
代码示例来源:origin: org.jruby/jruby-complete
public void invalidateCacheDescendants() {
LOG.debug("{} invalidating descendants", baseName);
getRuntime().getCaches().incrementMethodInvalidations();
if (includingHierarchies.isEmpty()) {
// it's only us; just invalidate directly
methodInvalidator.invalidate();
return;
}
List<Invalidator> invalidators = new ArrayList<Invalidator>();
invalidators.add(methodInvalidator);
synchronized (getRuntime().getHierarchyLock()) {
for (RubyClass includingHierarchy : includingHierarchies) {
includingHierarchy.addInvalidatorsAndFlush(invalidators);
}
}
methodInvalidator.invalidateAll(invalidators);
}
代码示例来源:origin: org.jruby/jruby-core
public void invalidateCacheDescendants() {
LOG.debug("{} invalidating descendants", baseName);
getRuntime().getCaches().incrementMethodInvalidations();
if (includingHierarchies.isEmpty()) {
// it's only us; just invalidate directly
methodInvalidator.invalidate();
return;
}
List<Invalidator> invalidators = new ArrayList<Invalidator>();
invalidators.add(methodInvalidator);
synchronized (getRuntime().getHierarchyLock()) {
for (RubyClass includingHierarchy : includingHierarchies) {
includingHierarchy.addInvalidatorsAndFlush(invalidators);
}
}
methodInvalidator.invalidateAll(invalidators);
}
代码示例来源:origin: org.jruby/jruby-complete
/**
* Provide stats on how many method and constant invalidations have occurred globally.
*
* This was added for Pry in https://github.com/jruby/jruby/issues/4384
*/
@JRubyMethod(name = "cache_stats", module = true)
public static IRubyObject cache_stats(ThreadContext context, IRubyObject self) {
Ruby runtime = context.runtime;
RubyHash stat = RubyHash.newHash(runtime);
stat.op_aset(context, runtime.newSymbol("method_invalidation_count"), runtime.newFixnum(runtime.getCaches().getMethodInvalidationCount()));
stat.op_aset(context, runtime.newSymbol("constant_invalidation_count"), runtime.newFixnum(runtime.getCaches().getConstantInvalidationCount()));
return stat;
}
代码示例来源:origin: org.jruby/jruby-core
/**
* Provide stats on how many method and constant invalidations have occurred globally.
*
* This was added for Pry in https://github.com/jruby/jruby/issues/4384
*/
@JRubyMethod(name = "cache_stats", module = true)
public static IRubyObject cache_stats(ThreadContext context, IRubyObject self) {
Ruby runtime = context.runtime;
RubyHash stat = RubyHash.newHash(runtime);
stat.op_aset(context, runtime.newSymbol("method_invalidation_count"), runtime.newFixnum(runtime.getCaches().getMethodInvalidationCount()));
stat.op_aset(context, runtime.newSymbol("constant_invalidation_count"), runtime.newFixnum(runtime.getCaches().getConstantInvalidationCount()));
return stat;
}
内容来源于网络,如有侵权,请联系作者删除!