Package javax.tools.diagnostics.runtime.java

Examples of javax.tools.diagnostics.runtime.java.JavaThread


    Iterator threadIterator=runtime.getThreads().iterator();
    
    List allThreads=new LinkedList();
   
    while(threadIterator.hasNext()) {
      JavaThread thread=(JavaThread) threadIterator.next();
      allThreads.add(thread);
    }
    return allThreads;
  }
View Full Code Here


  
  public void testThreadGroupMembership() throws CorruptDataException {
   
    List allThreads = getJavaRuntime().getThreads();
    JavaThread t1=getThread(allThreads, SetupJavaRuntimeThreads.DTFJ_TCK_T1);
   
   
  }
View Full Code Here

  }
  private JavaThread getThread(List allThreads, String threadname) throws CorruptDataException {
   
    Iterator i=allThreads.iterator();
    while(i.hasNext()) {
      JavaThread thread=(JavaThread) i.next();
      String name=thread.getName();
      if(name.equals(threadname)) return thread;
    }
    return null;
  }
View Full Code Here

   
    while (threads.hasNext()) {
      Object next = threads.next();
     
      if (next instanceof JavaThread) {
        JavaThread thread = (JavaThread) next;
       
        try {
          if (SetupJavaThread_getStackFrames.threadName.equals( thread.getName())) {
            contrivedThread = thread;
            break;
          }
        } catch (CorruptDataException e) {
          assertNotNull(e.getCorruptData());
View Full Code Here

  /**
   * This test applies only to JVMs whose thread roots only appear with the rest of the roots,
   * and not in JavaStackFrames because of conservative garbage collection.
   */
  public void testJavaThreadRoots() throws Exception {
    JavaThread thread = null;
   
    // Find the thread to match as a root source.
    Iterator threads = getJavaRuntime().getThreads().iterator();
    while(threads.hasNext()) {
      JavaThread candidateThread = (JavaThread) threads.next();
      if (setup.javaLocalRootsthreadName.equals(candidateThread.getName())) {
        thread = candidateThread;
        break;
      }
    }
   
View Full Code Here

  @Override
  public List<JavaThread> getEnterWaiters() {
    List<JavaThread> waitingThreads= new LinkedList<JavaThread>();
    for (Long threadID: waiters){
      JavaThread thread = model.getThread(threadID);
     
      try {
        if ((thread.getState() & JavaThread.STATE_IN_OBJECT_WAIT== 0) {
          waitingThreads.add(model.getThread(threadID));
        }
      } catch (CorruptDataException e) {
        e.printStackTrace();
      }
View Full Code Here

  @Override
  public List<JavaThread> getNotifyWaiters() {
    List<JavaThread> objectWaitThreads= new LinkedList<JavaThread>();
    for (Long threadID: waiters){
      JavaThread thread = model.getThread(threadID);
     
      try {
        if ((thread.getState() & JavaThread.STATE_IN_OBJECT_WAIT!= 0) {
          objectWaitThreads.add(model.getThread(threadID));
        }
      } catch (CorruptDataException e) {
        e.printStackTrace();
      }
View Full Code Here

          while(thds.hasNext()){
            Object tmpobj = thds.next();
            if (tmpobj instanceof CorruptData){
              //ignore this thread
            }else{
              JavaThread thd = (JavaThread) tmpobj;
              Iterator frames = thd.getStackFrames().iterator();
              while(frames.hasNext()){
                JavaStackFrame jStackFrame = (JavaStackFrame)frames.next();
                JavaLocation jLocation = jStackFrame.getLocation();
                JavaMethod jMethod = jLocation.getMethod();
                JavaClass jClass = jMethod.getDeclaringClass();
View Full Code Here

          while(thds.hasNext()){
            Object tmpobj = thds.next();
            if (tmpobj instanceof CorruptData){
              //ignore this thread
            }else{
              JavaThread thd = (JavaThread) tmpobj;
              Iterator frames = thd.getStackFrames().iterator();
              while(frames.hasNext()){
                JavaStackFrame jStackFrame = (JavaStackFrame)frames.next();
                JavaLocation jLocation = jStackFrame.getLocation();
                JavaMethod jMethod = jLocation.getMethod();
                JavaClass jClass = jMethod.getDeclaringClass();
View Full Code Here

              Object tmpobj = thds.next();
              if (tmpobj instanceof CorruptData){
                //ignore this thread
              }else{
                count++;
                JavaThread thd = (JavaThread)tmpobj;
                long hash = thd.getObject().getID().getAddress();
                logr.log(JDILogger.LEVEL_VERYVERBOSE, "Thread hash " + thd.getName() + " is " + hash); //$NON-NLS-1$ //$NON-NLS-2$
                addLongToVector(vctr, hash);
              }

            }
            addIntToVectorFront(vctr, count);
View Full Code Here

TOP

Related Classes of javax.tools.diagnostics.runtime.java.JavaThread

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.