Examples of JClassLoader


Examples of org.apache.kato.jvmti.javaruntime.model.JClassLoader

      JClass interfaceC = nreadClass(interfaceRef);
      c.addInterface(interfaceC);
    }

    {
      JClassLoader jcl = nreadClassLoader(classLoaderRef);
      c.classloader = jcl;
      try {
        log.log(Level.FINEST, "Class loader : "
            + c.getClassLoader().getObject() + " for " + c.getName());
      } catch (CorruptDataException e) {
View Full Code Here

Examples of org.apache.kato.jvmti.javaruntime.model.JClassLoader

   * @param position position of CJVMTI_CLASSLOADER record.
   * @return CClassLoader
   * @throws IOException
   */
  private JClassLoader nreadClassLoader(long position) throws IOException {
    JClassLoader jcl = model.getLoader(position);
   
    // We've already processed this classloader.
    if (jcl != null) {
      return jcl;
    }
   
    // This is important - otherwise other classes might try and load this.

   
    variablesIn.seek(position);
    short tag = variablesIn.readByte();
    if (tag != CJVMTI_CLASSLOADER) {
      throw new IOException("Missing CJVMTI_CLASSLOADER tag, got "+tag);
    }
   
    long loaderObject = variablesIn.readLong();
    int classesCount = variablesIn.readInt();

    // Reuse preexisiting system class laoder if this is what we are.
    // This is necessary for artificially generated types.
    if (loaderObject == CJVMTI_NULL_OBJECT) {
      jcl = model.getSystemClassLoader();
    } else {
      jcl = new JClassLoader();
    }
    // Store loader.
    model.putLoader(position, jcl );
   
    // Read array of class references.
    // This avoids seeking even more than we do already.
    long[] classesRef = new long[classesCount];
    for (int i=0; i < classesCount; i++) {
      classesRef[i] = variablesIn.readLong();
    }
   
    jcl.obj = nreadObject(loaderObject);
   
    // add all of the classes loaded by this classloader.
    for (int i=0; i < classesCount; i++) {
      long classPos = classesRef[i];
     
      if (classPos != CJVMTI_NULL_OBJECT) {
        jcl.addClass(nreadClass(classPos));
      }
    }   
   
    return jcl;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.