You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-spec@incubator.apache.org by Stuart Monteith <st...@stoo.me.uk> on 2009/04/08 15:50:01 UTC

Examples to help discussions

Hi,
    In order to ground our discussions I'd like for there to be examples 
for the points we are discussing. I've constructed an example that shows 
how you would print out the contents of a JVM heap using the API. That 
way we have a small piece of code that demonstrates an application of 
the API in its full horror.

I've put it on the Wiki at 
http://cwiki.apache.org/confluence/display/KATO/Object+Fields+example
And in the repository under 
https://svn.apache.org/repos/asf/incubator/kato/trunk/org.apache.kato.example/src/org/apache/kato/example/

The example has been put in two places as not everyone will be able to 
look in the repository.

Please ask me questions about any of it. I'd like to update the example 
as the discussions continue, and I'd think it might be useful to use 
some snippets from the example to use as examples of how things are done 
just now, and what they would look like if the API was different.

The sample just touches JavaObject, JavaClass, JavaHeap and JavaField - 
I wouldn't mind writing more examples if people would like them.

Regards,
    Stuart

P.S. Here is some output from an actual run on the example:

JavaObject @ 0x10079f00
    [Ljava/util/Hashtable$Entry;[32] = {
        null,
        null,
        null,
        java/util/Hashtable$Entry @ 0x100c0818,
        null,
        null,
        java/util/Hashtable$Entry @ 0x100c07f8,
        null,
        null,
        java/util/Hashtable$Entry @ 0x100c0738,
        java/util/Hashtable$Entry @ 0x100c0698,
        java/util/Hashtable$Entry @ 0x100c0718,
        java/util/Hashtable$Entry @ 0x100c0798,
        null,
        java/util/Hashtable$Entry @ 0x100c0678,
        null,
        java/util/Hashtable$Entry @ 0x100c07d8,
        null,
        null,
        null,
        null,
        null,
        null,
        null,
        java/util/Hashtable$Entry @ 0x100c07b8,
        java/util/Hashtable$Entry @ 0x100c06b8,
        null,
        null,
        null,
        java/util/Hashtable$Entry @ 0x100c06d8,
        null,
        java/util/Hashtable$Entry @ 0x100c0778,
    };
JavaObject @ 0x10079f90
    java/util/Hashtable:
      [Ljava/util/Hashtable$Entry; table = [Ljava/util/Hashtable$Entry;: 
@ 0x10079f00
      I count = 15
      I threshold = 24
      F loadFactor = 0.75
      I modCount = 15
      Ljava/util/Set; keySet = <null reference>
      Ljava/util/Set; entrySet = <null reference>
      Ljava/util/Collection; values = <null reference>
      java/util/Dictionary:
        java/lang/Object: