Hi,
Is there a way by which I can get a reference to any object in JVM?
OR
Is there way I can get reference to all the active object instances that are currently available in the JVM ?
OR
Is there a way I can get a reference of all the objects active of a given class in JVM?
For Example :
---------------------
class A {
static void main(
String args[])
{
String str = new String("Test");
}
}
class FindAObject {
static void main(String args[])
{
String strObjFound = (String) getReferenceOfObject("str");
}
Object getReference(String objName)
{
/*Steps/API call to get reference to "str" object of Class A*/;
}
}
Here I am assuming that both the classes A and FindObject are active in JVM at a given time. Its really not important to find object by name ... Any other way to find objects will do.
Thanks,
Vinayak