Class ClassLoaderImpl

  • All Implemented Interfaces:
    Serializable, IClassLoader, IInstance, IObject

    public class ClassLoaderImpl
    extends InstanceImpl
    implements IClassLoader
    Implementation of a Java object representing a java.lang.ClassLoader object. As well as standard object information it contains information about the class loader and summary details about classes loaded by this class loader.
    See Also:
    Serialized Form
    No Extend:
    • Constructor Detail

      • ClassLoaderImpl

        public ClassLoaderImpl​(int objectId,
                               long address,
                               ClassImpl clazz,
                               List<Field> fields)
        Constructs a class loader object.
        Parameters:
        objectId - the object id
        address - the actual address of the object
        clazz - its type
        fields - the fields of the object
    • Method Detail

      • getClassSpecificName

        public String getClassSpecificName()
        Description copied from interface: IObject
        Get class specific name of this object which depends on the availability of the appropriate name resolver, e.g. for a String the value of the char[].
        Specified by:
        getClassSpecificName in interface IObject
        Overrides:
        getClassSpecificName in class AbstractObjectImpl
        Returns:
        class specific name of the given snapshot object or null if it can't be resolved
      • getRetainedHeapSizeOfObjects

        public long getRetainedHeapSizeOfObjects​(boolean calculateIfNotAvailable,
                                                 boolean calculateMinRetainedSize,
                                                 IProgressListener listener)
                                          throws SnapshotException
        Description copied from interface: IClassLoader
        Returns the retained size of all objects and classes loaded by this class loader.
        Specified by:
        getRetainedHeapSizeOfObjects in interface IClassLoader
        Parameters:
        calculateIfNotAvailable - if false only return a cached version of the size
        calculateMinRetainedSize - if true then when calculating use an approximation
        listener - to indicate progress and errors
        Returns:
        the retained size, negative if approximate
        Throws:
        SnapshotException
      • doGetDefinedClasses

        public static final List<IClass> doGetDefinedClasses​(ISnapshot dump,
                                                             int classLoaderId)
                                                      throws SnapshotException
        Gets the classes defined by a given loader
        Parameters:
        dump - the snapshot
        classLoaderId - the class loader to look for
        Returns:
        a list of classes
        Throws:
        SnapshotException
      • doGetRetainedHeapSizeOfObjects

        public static final long doGetRetainedHeapSizeOfObjects​(ISnapshot dump,
                                                                int classLoaderId,
                                                                boolean calculateIfNotAvailable,
                                                                boolean calculateMinRetainedSize,
                                                                IProgressListener listener)
                                                         throws SnapshotException
        Calculates the retained size of all classes and instances of the class loaded by a class loader.
        Parameters:
        dump - the snapshot
        classLoaderId - the class loader if
        calculateIfNotAvailable - true if to skip calculations if not already done
        calculateMinRetainedSize - true if to make an approximate calculation
        listener - to indicate progress, errors and to cancel
        Returns:
        the size, negative if approximate
        Throws:
        SnapshotException