当前位置: 首页>>代码示例>>Java>>正文


Java OQLEngine类代码示例

本文整理汇总了Java中com.sun.tools.hat.internal.oql.OQLEngine的典型用法代码示例。如果您正苦于以下问题:Java OQLEngine类的具体用法?Java OQLEngine怎么用?Java OQLEngine使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OQLEngine类属于com.sun.tools.hat.internal.oql包,在下文中一共展示了OQLEngine类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import com.sun.tools.hat.internal.oql.OQLEngine; //导入依赖的package包/类
public static void main(String[] args) throws IOException, OQLException {
    final Snapshot snapshot = new NIOHeapLoader().load("C:/Projects/eclipse-mat/heap.bin");
//    Snapshot snapshot = new HeapLoader().load("C:/Projects/eclipse-mat/heap.bin");

    OQLEngine oqlEngine = new OQLEngine(snapshot);
    CountingVisitor counter = new CountingVisitor();
    ObjectVisitor inspector = new InspectingVisitor(oqlEngine, snapshot,
        new JavaHeapObjectCallback() {
          @Override public void run(JavaHeapObject obj, Accessor accessor) throws Exception {
            if (obj.toString().contains("java.lang.Thread")) {
              System.out.println("It is a thread!!");
              System.out.println("NAME=" + accessor.asString("name", obj));
              Map<String, JavaThing> fields = accessor.fields(obj);
              for (String k : fields.keySet()) {
                System.out.println(k + " = " + fields.get(k));
              }
            }
          }
        }
    );

    ObjectVisitor compositeVisitor = new CompositeVisitor(counter, inspector);
    oqlEngine.executeQuery("select t from java.lang.Thread t", compositeVisitor);
    if (counter.getCount() > 6) System.out.println("Too many threads!!!");
    System.out.println(counter.getCount());
  }
 
开发者ID:asengupta,项目名称:MuchHeap,代码行数:27,代码来源:Main.java

示例2: output

import com.sun.tools.hat.internal.oql.OQLEngine; //导入依赖的package包/类
private void output(Enumeration iterator, OQLEngine engine) throws Exception {
  while (iterator.hasMoreElements()) {
    Object o = iterator.nextElement();
    JavaHeapObject unwrapped = (JavaHeapObject) engine.call("unwrapJavaObject", new Object[]{o});
    System.out.println(o);
  }
}
 
开发者ID:asengupta,项目名称:MuchHeap,代码行数:8,代码来源:InspectingVisitor.java

示例3: HttpReader

import com.sun.tools.hat.internal.oql.OQLEngine; //导入依赖的package包/类
public HttpReader (Socket s, Snapshot snapshot, OQLEngine engine) {
    this.socket = s;
    this.snapshot = snapshot;
    this.engine = engine;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:HttpReader.java

示例4: setModel

import com.sun.tools.hat.internal.oql.OQLEngine; //导入依赖的package包/类
public void setModel(Snapshot ss) {
    this.snapshot = ss;
    if (OQLEngine.isOQLSupported()) {
        this.engine = new OQLEngine(ss);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:7,代码来源:QueryListener.java

示例5: InspectingVisitor

import com.sun.tools.hat.internal.oql.OQLEngine; //导入依赖的package包/类
public InspectingVisitor(OQLEngine engine, Snapshot snapshot, JavaHeapObjectCallback callback) {
  this.engine = engine;
  this.snapshot = snapshot;
  this.callback = callback;
}
 
开发者ID:asengupta,项目名称:MuchHeap,代码行数:6,代码来源:InspectingVisitor.java

示例6: Accessor

import com.sun.tools.hat.internal.oql.OQLEngine; //导入依赖的package包/类
public Accessor(OQLEngine engine) {
  this.engine = engine;
}
 
开发者ID:asengupta,项目名称:MuchHeap,代码行数:4,代码来源:Accessor.java


注:本文中的com.sun.tools.hat.internal.oql.OQLEngine类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。