referenceTypeId in jvmti
I'm implementing an agent using jvmti. I'm using the jdwp protocol to send and receive packets to and from a client. Many jdwp commands (see example below) utilize referenceTypeId (as well as objectId, methodId, etc). My question is this: Is there a way to get a referenceTypeId from the jvm using jvmti -- or is the referenceTypeId something that the agent is supposed to create and manage itself?
The following is from http://java.sun.com/j2se/1.5.0/docs/guide/jpda/jdwp-spec.html
referenceTypeID - Uniquely identifies a reference type in the target VM. It should not be assumed that for a particular class, the classObjectID and the referenceTypeID are the same. A particular reference type will be identified by exactly one ID in JDWP commands and replies throughout its lifetime A referenceTypeID is not reused to identify a different reference type, regardless of whether the referenced class has been unloaded.
And from the same document:
Object ids, reference type ids, field ids, method ids, and frame ids may be sized differently in different target VM implementations...
Reply Data of a JDWP Command that uses referenceTypeId (get All Classes)
--
-intn(number of reference types that follow)
--
repeated n times:
-byte(kind of following reference type)
-referenceTypeID (loaded reference type)
-string (the JNI signature of the loaded reference type)
-int (the current class status)
--

