Package javax.tools.diagnostics.runtime.java

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


  }

  /** Tests whether all the system classes are correctly reported as roots */
  // need to ignore primitive types
  private boolean checkSystemClasses(Map rootsCheckList) {
    JavaClassLoader systemClassLoader = getBootClassLoader();
    Iterator systemClasses = systemClassLoader.getDefinedClasses().iterator();
    boolean passed = true;
    String systemClassName = null;
    while (systemClasses.hasNext()) {
      Object next = systemClasses.next();
      if (next instanceof CorruptData) {
View Full Code Here


        {
          JavaRuntime javaRT = (JavaRuntime) runTimesIt.next( );
          Iterator classLoaders = javaRT.getJavaClassLoaders().iterator();
          while (classLoaders.hasNext()){

            JavaClassLoader javaCL = (JavaClassLoader)classLoaders.next();
            Iterator javaClasses = javaCL.getDefinedClasses().iterator();

            while (javaClasses.hasNext()){
              JavaClass javaClass = (JavaClass)javaClasses.next();

              classes.put(javaClass.getID().getAddress(), javaClass);
View Full Code Here

      {
        JavaRuntime jr = (JavaRuntime)itJavaRuntime.next();
        Iterator itJavaClassLoader = jr.getJavaClassLoaders().iterator();
        while (itJavaClassLoader.hasNext())
        {
          JavaClassLoader jcl = (JavaClassLoader)itJavaClassLoader.next();
          Iterator itJavaClass = jcl.getDefinedClasses().iterator();
         
          while (itJavaClass.hasNext())
          {
            JavaClass jc = (JavaClass)itJavaClass.next();
            Iterator itJavaMethod = jc.getDeclaredMethods().iterator();
View Full Code Here

        _numberOfErrors++;
        reportError("CorruptData found in classloader list at address: " + ((CorruptData)potential).getAddress(), null);
        continue ITERATING_LOADERS;
      }
     
      JavaClassLoader thisClassLoader = (JavaClassLoader)potential;
     
      Iterator classesIt = thisClassLoader.getDefinedClasses().iterator();
     
ITERATING_CLASSES:while(classesIt.hasNext()) {
        potential = classesIt.next();
       
        numberOfClasses++;
       
        try {
         
          if(potential instanceof CorruptData) {
            _numberOfErrors++;
            reportError("CorruptData found in class list for classloader "
                + Long.toHexString(thisClassLoader.getObject().getID().getAddress())
                + " at address: " + ((CorruptData)potential).getAddress(), null);
            continue ITERATING_CLASSES;
          }

          JavaClass thisJavaClass = (JavaClass)potential;
View Full Code Here

      addStaticReferences(thisJavaClass, references);
     
      addProtectionDomainReference(thisJavaClass,references);
     
      //Classloader
      JavaClassLoader loader = thisJavaClass.getClassLoader();
     
      if(loader != null) {
        JavaObject loaderObject = loader.getObject();
        if(loaderObject != null) {
          references.add(new Long(loaderObject.getID().getAddress()));
        } else {
          reportError("Null loader object returned for class: " + thisJavaClass.getName() + "(" + thisJavaClass.getID() + ")",null);
          _numberOfErrors++;
View Full Code Here

    for (Object nextLoader : classLoaders) {     
      if (nextLoader instanceof CorruptData) {
        continue;
      }

      JavaClassLoader loader = (JavaClassLoader) nextLoader;

      List classes = loader.getDefinedClasses();

      for (Object nextClazz : classes) {

        if (nextClazz instanceof CorruptData) {
          continue;
View Full Code Here

    for (Object nextLoader : classLoaders) {     
      if (nextLoader instanceof CorruptData) {
        continue;
      }
     
      JavaClassLoader loader = (JavaClassLoader) nextLoader;
     
      List classes = loader.getDefinedClasses();
     
      for (Object nextClazz : classes) {
       
        if (nextClazz instanceof CorruptData) {
          continue;
View Full Code Here

    boolean found = false;
    JavaClass jc = null;
   
    while (itJavaClassLoader.hasNext() && !found)
    {
      JavaClassLoader jcl = (JavaClassLoader)itJavaClassLoader.next();
      Iterator itJavaClass = jcl.getDefinedClasses().iterator();
      while (itJavaClass.hasNext() && !found)
      {
        jc = (JavaClass)itJavaClass.next();
        String currClassName;
View Full Code Here

    sb.append("instance size = " + datum.getSize());
*/
   
    String classLoaderInfo;
    try{
      JavaClassLoader jClassLoader = jc.getClassLoader();
      classLoaderInfo = "0x" + Long.toHexString(jClassLoader.getObject().getJavaClass().getID().getAddress());
    }catch (CorruptDataException cde){
      classLoaderInfo = cdeInfo;
    }
    out.print(spaces);
    out.print("\n\t");
View Full Code Here

    Map javaClasses = new HashMap();
    Iterator itClassLoader = jr.getJavaClassLoaders().iterator();
   
    // create Map of all classes in this JavaRuntime's class loaders
    while (itClassLoader.hasNext()) {
      JavaClassLoader jcl = (JavaClassLoader)itClassLoader.next();
     
      // Check for any corrupt data for this classloader
      Iterator itCache = jcl.getCachedClasses().iterator();
      while (itCache.hasNext()) {
        Object next = itCache.next();
        if (next instanceof CorruptData){
          // Warn the user that the classloader data is corrupt
          try {
            long jclAddress = jcl.getObject().getID().getAddress();
            out.print("\t classloader ID: " + Utils.toHex(jclAddress) + " " + Exceptions.getCorruptDataExceptionString() + "\n");
          } catch (CorruptDataException e) {
            out.print("\t classloader ID: <unknown> " + Exceptions.getCorruptDataExceptionString() + "\n");
          }
          break;
        }
      }
     
      Iterator itClass = jcl.getDefinedClasses().iterator();
      while (itClass.hasNext()) {
        javaClasses.put((JavaClass)itClass.next(), new Datum());
      }
    }
   
View Full Code Here

TOP

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

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.