com.jrockit.memleak
Interface IClassInfo

All Superinterfaces:
IAccessibleInfo, IClassRef, INamedType, ITypeSpecifier
All Known Implementing Classes:
ClassInfo, DummyClassInfo, NameMappingCacheFactory.ClassInfoR26

public interface IClassInfo
extends IClassRef, INamedType, IAccessibleInfo

Representation of a class, including its name, ID, class loader ID, and various other meta data that cannot reasonably change during the lifetime of a JVM. (If a JVM supports a class redefinition, typically through a debugger interface, that would violate these constraints, a new IClassInfo would likely need to be created.)

Author:
Markus Persson

Field Summary
static int ANNOTATION
          The int modifier value set for annotation types.
static java.lang.String CLASS_TYPE_NAME
          The internal "type name" for the special class java.lang.Class, often useful when implementing the IMemLeak interface.
static IClassInfo[] EMPTY_ARRAY
          An empty IClassInfo array.
static int ENUM
          The int value representing the enum modifier.
 
Fields inherited from interface com.jrockit.memleak.IAccessibleInfo
SYNTHETIC, UNKNOWN_MODIFIERS
 
Method Summary
 IObjectInfo getClassLoaderInfo(Policy policy)
          Get the class loader of this class, or null if it is the boot class loader.
 IObjectSpecifier getClassLoaderSpec()
          Get the class loader of this class, or null if it is the boot class loader.
 IObjectInfo getClassObjectInfo(Policy policy)
          For implementations with Feature.CLASS_IDS_ARE_OBJECT_IDS this should never return null (when called with a blocking policy).
 IObjectSpecifier getClassObjectSpec()
          For implementations with Feature.CLASS_IDS_ARE_OBJECT_IDS this should never return null.
 java.lang.String getName()
          Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this IClassInfo object.
 int getNumDeclaredStaticFields()
           
 int getNumInstanceFields()
           
 java.lang.String getSourceFileName()
          Returns the name of the source file for this class.
 boolean isArrayClass()
           
 boolean isDiscarded()
           
 
Methods inherited from interface com.jrockit.memleak.IClassRef
getClassId
 
Methods inherited from interface com.jrockit.memleak.ITypeSpecifier
select
 
Methods inherited from interface com.jrockit.memleak.IAccessibleInfo
getModifiers
 

Field Detail

ANNOTATION

static final int ANNOTATION
The int modifier value set for annotation types. (Made public here, since it isn't elsewhere.)

See Also:
Modifier, Class, Constant Field Values

ENUM

static final int ENUM
The int value representing the enum modifier. (Made public here, since it isn't elsewhere.)

See Also:
Modifier, Class, Constant Field Values

CLASS_TYPE_NAME

static final java.lang.String CLASS_TYPE_NAME
The internal "type name" for the special class java.lang.Class, often useful when implementing the IMemLeak interface.

FIXME: Clean up comment!

See Also:
Constant Field Values

EMPTY_ARRAY

static final IClassInfo[] EMPTY_ARRAY
An empty IClassInfo array.

Method Detail

getName

java.lang.String getName()
Returns the name of the entity (class, interface, array class, primitive type, or void) represented by this IClassInfo object.

Specified by:
getName in interface INamedType
Returns:
the name of the class represented by this IClassInfo object.
See Also:
Class.getName()

isArrayClass

boolean isArrayClass()
Returns:
true of this is an array class, false otherwise.

getClassLoaderSpec

IObjectSpecifier getClassLoaderSpec()
Get the class loader of this class, or null if it is the boot class loader. Implementations without Feature.CLASS_LOADERS may also return null.

Returns:
Returns the IObjectSpecifier of the class loader that loaded this class.

getClassLoaderInfo

IObjectInfo getClassLoaderInfo(Policy policy)
                               throws GarbageCollectedException
Get the class loader of this class, or null if it is the boot class loader. Null may also be returned if the value is not yet available, according to policy. Finally, implementations without Feature.CLASS_LOADERS may also return null.

Parameters:
policy -
Returns:
Returns the IObjectInfo of the class loader that loaded this class, or null.
Throws:
GarbageCollectedException

getClassObjectSpec

IObjectSpecifier getClassObjectSpec()
For implementations with Feature.CLASS_IDS_ARE_OBJECT_IDS this should never return null. Other implementations might.

Returns:
Returns the IObjectSpecifier of the Class instance that corresponds to this class, or null.

getClassObjectInfo

IObjectInfo getClassObjectInfo(Policy policy)
                               throws GarbageCollectedException
For implementations with Feature.CLASS_IDS_ARE_OBJECT_IDS this should never return null (when called with a blocking policy). Other implementations might.

Parameters:
policy -
Returns:
Returns the IObjectInfo of the Class instance that corresponds to this class, or null.
Throws:
GarbageCollectedException

getSourceFileName

java.lang.String getSourceFileName()
Returns the name of the source file for this class. Generally, this corresponds to the SourceFile attribute of the relevant class file (as per The Java Virtual Machine Specification, Section 4.7.7).

Returns:
the name of the source file, or null if this information is unavailable.

getNumDeclaredStaticFields

int getNumDeclaredStaticFields()
Returns:
the number of declared static fields in this class.

getNumInstanceFields

int getNumInstanceFields()
Returns:
the number of instance fields, including all inherited instance fields from super classes.

isDiscarded

boolean isDiscarded()
Returns:
true iff the class is known to have been garbage collected.


Copyright © 1999, 2011, Oracle and/or its affiliates. All rights reserved.