|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jrockit.memleak.util.DummyObjectInfo
public class DummyObjectInfo
Dummy implementation of IObjectInfo.
| Field Summary |
|---|
| Fields inherited from interface com.jrockit.memleak.IObjectInfo |
|---|
EMPTY_ARRAY |
| Constructor Summary | |
|---|---|
DummyObjectInfo(java.lang.String name,
IClassInfo classInfo)
|
|
| Method Summary | ||
|---|---|---|
static DummyObjectInfo |
createNested(java.lang.String name,
int depth)
Create a dummy IObjectInfo with a dummy IClassInfo as
class, both with the display name name. |
|
IClassInfo |
getClassInfo()
|
|
|
getField(java.lang.String fieldName,
java.lang.Class<T> type,
Policy policy)
Get the actual primitive wrapper or object
representation of of the most visible field that has the name
fieldName and is assignable to the class type
as per IValue.isAssignableTo(Class) in the object represented by
this IObjectInfo. |
|
IObjectInfo |
getFieldReference(java.lang.String fieldName,
Policy policy)
Get the IObjectInfo corresponding to the value of the
most visible non-primitive field with the name
fieldName in the object represented by this
IObjectInfo. |
|
IFieldValue |
getFieldValue(java.lang.String fieldName,
java.lang.Class<?> type,
Policy policy)
Get the IFieldValue of the most visible field that has
the name fieldName and is assignable to the class
type as per IValue.isAssignableTo(Class) in the
object represented by this IObjectInfo. |
|
IFieldValue[] |
getFieldValues(Policy policy)
Get the values and names for all the fields in the object represented by this IObjectInfo. |
|
LimitedNumber |
getKeepAliveSize(long stopAt,
Policy policy)
Get the total size of all objects held on to by this object (the transitive closure). |
|
int |
getObjectId()
|
|
boolean |
isDiscarded()
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DummyObjectInfo(java.lang.String name,
IClassInfo classInfo)
name - classInfo - | Method Detail |
|---|
public static final DummyObjectInfo createNested(java.lang.String name,
int depth)
IObjectInfo with a dummy IClassInfo as
class, both with the display name name. The class will have
a class loader, also an IObjectInfo, which will have a class and
so forth, until depth dummy instances have been created.
Note that a similar effect could be produced by circular references, but
it isn't recommended since that wouldn't be possible in a real JVM. Also
someone might attempt to navigate this structure until the bootstrap
class loader, normally designated by null, is found. (Although that type
of navigation should stop once it sees anything implementing
IDummy.)
name - the display name to use for objects and classesdepth - the total number of dummy instances to create
IObjectInfo or null if depth is zero.public IClassInfo getClassInfo()
getClassInfo in interface IObjectInfoIClassInfo for the class of this object.public int getObjectId()
getObjectId in interface IObjectSpecifierpublic boolean isDiscarded()
isDiscarded in interface IObjectInfopublic IFieldValue[] getFieldValues(Policy policy)
IObjectInfoIObjectInfo.
Note that null may be returned, if the policy allows it.
getFieldValues in interface IObjectInfopolicy - the cache policy to use
IFieldValues representing the fields, or null
according to policy
public IFieldValue getFieldValue(java.lang.String fieldName,
java.lang.Class<?> type,
Policy policy)
throws GarbageCollectedException,
NoMatchingFieldException
IObjectInfoIFieldValue of the most visible field that has
the name fieldName and is assignable to the class
type as per IValue.isAssignableTo(Class) in the
object represented by this IObjectInfo.
The most visible field is defined from a Java source perspective
in that it normally would be the field that is in scope from within the
actual class. More specifically, starting from the actual class and
moving up the super class hierarchy, the first non-synthetic field with
fieldName and a matching type, is returned. If no such field
is found, the first synthetic field of that name and with a matching
type, found by looking in the same order, is returned. If no field with
that name and a matching type could be found at all,
NoMatchingFieldException is thrown.
getFieldValue in interface IObjectInfofieldName - the name of the fieldpolicy - the cache policy to use
IFieldValue, unless the value is currently unavailable
according to policy, in which case null is returned.
GarbageCollectedException - if the object has been garbage collected.
NoMatchingFieldException - if no field with the given name and a matching type could be
found
public <T> T getField(java.lang.String fieldName,
java.lang.Class<T> type,
Policy policy)
throws NoMatchingFieldException
IObjectInfoobject
representation of of the most visible field that has the name
fieldName and is assignable to the class type
as per IValue.isAssignableTo(Class) in the object represented by
this IObjectInfo.
The most visible field is defined from a Java source perspective
in that it normally would be the field that is in scope from within the
actual class. More specifically, starting from the actual class and
moving up the super class hierarchy, the value of the first non-synthetic
field with fieldName and a matching type, is returned. If no
such field is found, the value of the first synthetic field of that name
and with a matching type, found by looking in the same order, is
returned. If no field with that name and a matching type could be found
at all, NoMatchingFieldException is thrown.
getField in interface IObjectInfoT - implicitfieldName - the name of the fieldpolicy - the cache policy to use
T (that is, a primitive wrapper or an
IObjectInfo), or null
NoMatchingFieldException - if no field with the given name and a matching type could be
found
public IObjectInfo getFieldReference(java.lang.String fieldName,
Policy policy)
throws NoMatchingFieldException
IObjectInfoIObjectInfo corresponding to the value of the
most visible non-primitive field with the name
fieldName in the object represented by this
IObjectInfo.
The most visible field is defined from a Java source perspective
in that it normally would be the field that is in scope from within the
actual class. More specifically, starting from the actual class and
moving up the super class hierarchy, the first non-synthetic and
non-primitive field with fieldName is returned. If no such
field is found, the first synthetic non-primitive field of that name,
found by looking in the same order, is returned. If no non-primitive
field with that name could be found at all,
NoMatchingFieldException is thrown.
getFieldReference in interface IObjectInfofieldName - the name of the fieldpolicy - the cache policy to use
IObjectInfo representing the field, or null according
to policy
NoMatchingFieldException - if no non-primitive field with the given name could be found
public LimitedNumber getKeepAliveSize(long stopAt,
Policy policy)
IObjectInfostopAt >= 0 than counting will
stop if the total size is larger than stopAt.
Note that a cached value below stopAt will only be returned
if it is lower than the limit in effect when that value was originally
calculated. (That is, if it wasn't limited by the lower limit.)
getKeepAliveSize in interface IObjectInfostopAt - the limit in bytes for keep alive size calculation, see abovepolicy - the Policy to use
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||