Package org.eclipse.mat.parser.model
Class ClassLoaderImpl
- java.lang.Object
-
- org.eclipse.mat.parser.model.AbstractObjectImpl
-
- org.eclipse.mat.parser.model.InstanceImpl
-
- org.eclipse.mat.parser.model.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:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.mat.snapshot.model.IObject
IObject.Type
-
-
Constructor Summary
Constructors Constructor Description ClassLoaderImpl(int objectId, long address, ClassImpl clazz, List<Field> fields)
Constructs a class loader object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<IClass>
doGetDefinedClasses(ISnapshot dump, int classLoaderId)
Gets the classes defined by a given loaderstatic long
doGetRetainedHeapSizeOfObjects(ISnapshot dump, int classLoaderId, boolean calculateIfNotAvailable, boolean calculateMinRetainedSize, IProgressListener listener)
Calculates the retained size of all classes and instances of the class loaded by a class loader.String
getClassSpecificName()
Get class specific name of this object which depends on the availability of the appropriate name resolver, e.g.List<IClass>
getDefinedClasses()
Returns the classes defined by this class loader instance.long
getRetainedHeapSizeOfObjects(boolean calculateIfNotAvailable, boolean calculateMinRetainedSize, IProgressListener listener)
Returns the retained size of all objects and classes loaded by this class loader.-
Methods inherited from class org.eclipse.mat.parser.model.InstanceImpl
getField, getFields, getObjectAddress, getObjectId, getOutboundReferences, getReferences, getUsedHeapSize
-
Methods inherited from class org.eclipse.mat.parser.model.AbstractObjectImpl
equals, getClassAddress, getClassId, getClazz, getComparatorForClassSpecificName, getComparatorForTechnicalName, getComparatorForUsedHeapSize, getDisplayName, getGCRootInfo, getRetainedHeapSize, getSnapshot, getTechnicalName, hashCode, resolveValue, setClassInstance, setObjectAddress, setObjectId, setSnapshot, toString
-
Methods inherited from interface org.eclipse.mat.snapshot.model.IObject
getClazz, getDisplayName, getGCRootInfo, getObjectAddress, getObjectId, getOutboundReferences, getRetainedHeapSize, getSnapshot, getTechnicalName, getUsedHeapSize, resolveValue
-
-
-
-
Field Detail
-
NO_LABEL
public static final String NO_LABEL
- See Also:
- Constant Field Values
-
-
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 interfaceIObject
- Overrides:
getClassSpecificName
in classAbstractObjectImpl
- Returns:
- class specific name of the given snapshot object or null if it can't be resolved
-
getDefinedClasses
public List<IClass> getDefinedClasses() throws SnapshotException
Description copied from interface:IClassLoader
Returns the classes defined by this class loader instance.- Specified by:
getDefinedClasses
in interfaceIClassLoader
- Throws:
SnapshotException
-
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 interfaceIClassLoader
- Parameters:
calculateIfNotAvailable
- if false only return a cached version of the sizecalculateMinRetainedSize
- if true then when calculating use an approximationlistener
- 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 snapshotclassLoaderId
- 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 snapshotclassLoaderId
- the class loader ifcalculateIfNotAvailable
- true if to skip calculations if not already donecalculateMinRetainedSize
- true if to make an approximate calculationlistener
- to indicate progress, errors and to cancel- Returns:
- the size, negative if approximate
- Throws:
SnapshotException
-
-