You are viewing a plain text version of this content. The canonical link for it is here.
Posted to kato-commits@incubator.apache.org by cc...@apache.org on 2009/03/16 16:41:14 UTC

svn commit: r754939 [2/2] - in /incubator/kato/trunk/import/org.apache.kato.api: ./ .settings/ META-INF/ schema/ src/ src/com/ src/com/ibm/ src/com/ibm/dtfj/ src/com/ibm/dtfj/image/ src/com/ibm/dtfj/java/ src/com/ibm/dtfj/runtime/ testsrc/ testsrc/test...

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/image/MemoryAccessException.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/image/MemoryAccessException.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/image/MemoryAccessException.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/image/MemoryAccessException.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.image;
+
+/**
+ * Indicates that an attempt was made to access memory which is not included within the image
+ */
+public class MemoryAccessException extends DTFJException {
+    
+	private static final long serialVersionUID = 8883829684484518525L;
+
+	private ImagePointer badPointer;
+    
+    /**
+     * Build exception for the given location and description 
+     * @param badPointer		the location which caused the access exception
+     * @param description		text description
+     */
+    public MemoryAccessException(ImagePointer badPointer, String description) {
+        super(description);
+        this.badPointer = badPointer;
+    }
+    
+    /**
+     * Build exception for the given location and description 
+     * @param badPointer		the location which caused the access exception
+     */
+    public MemoryAccessException(ImagePointer badPointer) {
+        super();
+        this.badPointer = badPointer;
+    }
+    
+    /**
+     * Get a pointer into the image where the access failed.
+     * @return The pointer into the image where the access failed
+     */
+    public ImagePointer getPointer() {
+    	return badPointer;
+    }
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClass.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClass.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClass.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClass.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.ImagePointer;
+
+/**
+ * Represents a Java class.
+ * 
+ */
+public interface JavaClass {
+
+    /**
+     * Fetch the java.lang.Class object associated with this class.
+     * <p>
+     * In some implementations this may be null if no object has been
+     * created to represent this class, or if the class is synthetic.
+     * 
+     * @return the java.lang.Class object associated with this class 
+     * @throws CorruptDataException 
+     * 
+     * @see #getID()
+     */
+    JavaObject getObject() throws CorruptDataException; 
+
+    /**
+     * Fetch the class loader associated with this class. Classes defined in
+     * the bootstrap class loader (including classes representing primitive 
+     * types or void) will always return a JavaClassLoader representing the
+     * bootstrap class loader. This asymmetry with 
+     * java.lang.Class#getClassLoader() is intentional.
+     * 
+     * @throws CorruptDataException if the class loader for this class cannot
+     * be found (a class cannot exist without a loader so this implies corruption)
+     * 
+     * @return the JavaClassLoader in which this class was defined
+     */
+    JavaClassLoader getClassLoader() throws CorruptDataException;
+    
+    /**
+     * Get the name of the class.
+     * 
+     * @return the name of the class in the form: "full/package/class$innerclass"
+     * @throws CorruptDataException 
+     */
+    String getName() throws CorruptDataException;
+    
+    /**
+     * Get the immediate superclass of this class.
+     * 
+     * @return the immediate superclass of this class, or null if this
+     * class has no superclass. For interfaces, Object, primitive types 
+     * and void null is always returned.
+     * @throws CorruptDataException 
+     */
+    JavaClass getSuperclass() throws CorruptDataException;
+    
+    
+    /**
+     * Get the set of names of interfaces directly implemented by this class.
+     * @return an iterator over the collection of the names of interfaces 
+     * directly implemented by this class. Some JVM implementations may
+     * choose to load interfaces lazily, so only the names are returned.
+     * The JavaClass objects may be found through the defining class loader.
+     * 
+     * @see java.lang.String
+     * @see JavaClassLoader#findClass(String)
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getInterfaces();
+    
+    /**
+     * Return the Java language modifiers for this class. 
+     * <p>
+     * The modifiers are defined by the JVM Specification.
+     * <p>
+     * Note that, for inner classes, the actual modifiers are returned, not 
+     * the synthetic modifiers. For instance, a class will never have its
+     * 'protected' modifier set, even if the inner class was a protected
+     * member, since 'protected' is not a legal modifier for a class file.
+     * 
+     * @return the modifiers for this class
+     * @throws CorruptDataException 
+     */
+    int getModifiers() throws CorruptDataException;
+    
+    /**
+     * Is this an array class ?
+     * @return true if this class is an array class
+     * @throws CorruptDataException 
+     */
+    boolean isArray() throws CorruptDataException;
+    
+    /**
+     * For array classes, returns a JavaClass representing the component type of this array class.
+     *
+     * @return a JavaClass representing the component type of this array class
+     * @throws CorruptDataException 
+     * @exception java.lang.IllegalArgumentException if this JavaClass does not represent an array class
+     */
+    JavaClass getComponentType() throws CorruptDataException;
+    
+    /**
+     * Get the set of fields declared in this class. 
+     * 
+     * @return an iterator over the collection of fields declared
+     * in this class. 
+     * 
+     * @see JavaField
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getDeclaredFields();
+    
+    /**
+     * Get the set of methods declared in this class. 
+     * @return an iterator over the collection of methods declared
+     * in this class.
+     * 
+     * @see JavaMethod
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getDeclaredMethods();
+    
+    /**
+     * Java classes may refer to other classes and to String objects via 
+     * the class's constant pool. These references are followed by the 
+     * garbage collector, forming edges on the graph of reachable objects.
+     * This getConstantPoolReferences() may be used to determine which
+     * objects are referred to by the receiver's constant pool.
+     * <p>
+     * Although Java VMs typically permit only Class and String 
+     * objects in the constant pool, some esoteric or future virtual 
+     * machines may permit other types of objects to occur in the constant 
+     * pool. This API imposes no restrictions on the types of JavaObjects 
+     * which might be included in the Iterator.
+     * <p>
+     * No assumption should be made about the order in which constant 
+     * pool references are returned.
+     * <p>
+     * Classes may also refer to objects through static variables.
+     * These may be found with the getDeclaredFields() API. Objects
+     * referenced by static variables are not returned by 
+     * getConstantPoolReferences() unless the object is also referenced
+     * by the constant pool.
+     * 
+     * @return an iterator over the collection of JavaObjects which
+     * are referred to by the constant pool of this class
+     * 
+     * @see JavaObject
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getConstantPoolReferences();
+    
+    /**
+     * The ID of a class is a pointer to a section of memory which identifies
+     * the class. The contents of this memory are implementation defined.
+     * <p>
+     * In some implementations getID() and getObject().getID() may return the
+     * same value. This implies that the class object is also the primary
+     * internal representation of the class. DTFJ users should not rely on this
+     * behaviour.
+     * <p>
+     * In some implementations, getID() may return null for some classes.
+     * This indicates that the class is a synthetic class which has been 
+     * constructed for DTFJ purposes only. The class has no physical 
+     * representation in the VM.
+     * 
+     * @return a pointer to the class
+     */
+	ImagePointer getID();
+	
+	/**
+	 * Get the set of references from this class.
+	 *
+	 * @return an iterator of JavaReferences
+	 *
+	 * @see com.ibm.dtfj.java.JavaReference
+	 * @see com.ibm.dtfj.image.CorruptData
+	 */
+	Iterator getReferences();
+    
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same Java Class in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClassLoader.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClassLoader.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaClassLoader.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+
+/**
+ * Represents an internal ClassLoader structure within a Java VM instance.
+ * For most ClassLoaders there is a corresponding java.lang.ClassLoader
+ * instance within with JavaRuntime. For primordial class loaders such as
+ * the bootstrap class loader, there may or may not be a corresponding
+ * java.lang.ClassLoader instance.
+ * 
+ * Since Java does not define any strict inheritance structure between
+ * class loaders, there are no APIs for inspecting 'child' or 'parent'
+ * class loaders. This information may be inferred by inspecting the
+ * corresponding java.lang.ClassLoader instance
+ * 
+ * @see java.lang.ClassLoader
+ */
+public interface JavaClassLoader {
+
+    /**
+     * Get the set of classes which are defined in this JavaClassLoader. 
+     * @return an iterator over the collection of classes which are defined
+     * in this JavaClassLoader 
+     * 
+     * @see JavaClass
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getDefinedClasses();
+    
+    /**
+     * When a ClassLoader successfully delegates a findClass() request to
+     * another ClassLoader, the result of the delegation must be cached within
+     * the internal structure so that the VM does not make repeated requests
+     * for the same class.
+     * 
+     * @return an iterator over the collection of classes which are defined
+     * in this JavaClassLoader <i>or</i> which were found by delegation to
+     * other JavaClassLoaders
+     * 
+     * @see JavaClass
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getCachedClasses();
+    
+    /**
+     * Find a named class within this class loader. The class may have been
+     * defined in this class loader, or this class loader may have delegated
+     * the load to another class loader and cached the result.
+     * 
+     * @param name of the class to find. Packages should be separated by
+     * '/' instead of '.'
+     * @return the JavaClass instance, or null if it is not found
+     * @throws CorruptDataException 
+     */
+    JavaClass findClass(String name) throws CorruptDataException;
+    
+    /**
+     * Get the java.lang.ClassLoader instance associated with this class loader.
+     * @return a JavaObject representing the java.lang.ClassLoader instance
+     * associated with this class loader, or null if there is no Java class
+     * loader associated with this low-level class loader.
+     * @throws CorruptDataException 
+     * 
+     * @see JavaObject
+     * @see ClassLoader
+     */
+    JavaObject getObject() throws CorruptDataException;
+    
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same Java Class Loader in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaField.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaField.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaField.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaField.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.MemoryAccessException;
+
+/**
+ * Represents a field declaration.
+ * It is modelled on java.lang.reflect.Field
+ */
+public interface JavaField extends JavaMember {
+
+    /**
+     * Get the contents of an Object field
+     * @param object to fetch the field from. Ignored for static
+     * fields.
+     * 
+     * @return a JavaObject instance for reference type fields,
+     * an instance of a subclass of Number, Boolean, or Character 
+     * for primitive fields, or null for null reference fields.
+     * <p>
+     * This field must be declared in the object's class or in a superclass
+     * <p>
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field
+     *
+     * @see JavaObject
+     * @see Byte
+     * @see Double
+     * @see Float
+     * @see Integer
+     * @see Long
+     * @see Short
+     * @see Character
+     * @see Boolean
+     */
+    Object get(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a boolean field
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to boolean
+     */
+    boolean getBoolean(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a byte field
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to byte
+     */
+    byte getByte(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a char field
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to char
+     */
+    char getChar(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a double field or of another primitive field whose type is convertible to double via a widening conversion. 
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to double via a widening conversion
+     */
+    double getDouble(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a float field or of another primitive field whose type is convertible to float via a widening conversion. 
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents 
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to float via a widening conversion
+     */
+    float getFloat(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of an int field or of another primitive field whose type is convertible to int via a widening conversion.
+     * @return the field contents
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to int via a widening conversion.
+     */
+    int getInt(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a long field or of another primitive field whose type is convertible to long via a widening conversion.
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to long via a widening conversion.
+     */
+    long getLong(JavaObject object) throws CorruptDataException, MemoryAccessException;
+
+    /**
+     * Get the contents of a short field or of another primitive field whose type is convertible to short via a widening conversion.
+     * @param  object to fetch the field from. Ignored for static fields.
+     * @return the field contents 
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * @throws NullPointerException if the field is an instance field, and object is null
+     * @throws IllegalArgumentException if the specified object is not appropriate for
+     * this field, or if the type of the field cannot be converted to short via a widening conversion.
+     */
+    short getShort(JavaObject object) throws CorruptDataException, MemoryAccessException;
+    
+    /**
+     * Get the contents of a string field
+     * @param object to fetch the field from. Ignored for static fields.
+     * 
+     * @return a String representing the value of the String field.  Note that the instance
+     * returned can be null if the field was null in object.
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * 
+     * @throws IllegalArgumentException if the specified field is not a String
+     * @throws NullPointerException if the field is an instance field, and object is null
+     */
+    String getString(JavaObject object) throws CorruptDataException, MemoryAccessException;
+    
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same Java Field in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaHeap.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaHeap.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaHeap.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaHeap.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,59 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+/**
+ * Represents a heap of managed objects. There may be multiple heaps
+ * within a JVM, for instance a generational heap and a class heap.
+ * Additionally, heaps may consist of non-contiguous memory regions.
+ * 
+ */
+public interface JavaHeap {
+    
+    /**
+     * Get the set of contiguous memory regions which form this heap. 
+     * @return an iterator over the collection of contiguous memory regions
+     * which form this heap
+     * 
+     * @see com.ibm.dtfj.image.ImageSection
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getSections();
+    
+    /**
+     * Get a brief textual description of this heap.
+     * @return a brief textual description of this heap
+     */
+    String getName();
+    
+    /**
+     * Get the set of objects which are stored in this heap.
+     * 
+     * @return an iterator over the collection of objects which
+     * are stored in this heap
+     * 
+     * @see JavaObject
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getObjects();
+    
+	/**
+	 * @param obj
+	 * @return true if the given object refers to the same Java Heap in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaLocation.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaLocation.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaLocation.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaLocation.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.ImagePointer;
+
+/**
+ * Represents a point of execution within a Java method
+ * 
+ */
+public interface JavaLocation {
+	
+	/**
+	 * Fetches the absolute address of the code which this location represents.
+	 * This pointer will be contained within one of the segments returned by
+	 * getBytecodeSections() or getCompiledSections() of the method returned by
+	 * getMethod().
+	 * <p>
+	 * null may be returned, particularly for methods with no bytecode or 
+	 * compiled sections (e.g. some native methods)
+	 * <p>
+	 * Although an offset into the method may be calculated using this 
+	 * pointer, caution should be exercised in attempting to map this offset to
+	 * an offset within the original class file. Various transformations may
+	 * have been applied to the bytecodes by the VM or other agents which may
+	 * make the offset difficult to interpret.
+	 * <p>
+	 * For native methods, the address may be meaningless.
+	 * 
+	 * @return the address in memory of the managed code
+	 * @throws CorruptDataException 
+	 */
+	ImagePointer getAddress() throws CorruptDataException;
+	
+	/**
+	 * Get the line number.
+	 * 
+	 * @return the line number, if available, or throws DataUnavailable if it is not available
+	 * Line numbers are counted from 1  
+	 * 
+	 * @throws DataUnavailable if the line number data is not available for this location
+	 * @throws CorruptDataException 
+	 */
+	int getLineNumber() throws DataUnavailable, CorruptDataException;
+	
+	/**
+	 * Get the source file name.
+	 * @return the name of the source file, if available, or throws DataUnavailable if it is
+	 * not available
+	 * 
+	 * @throws DataUnavailable if the source file name is unavailable in the core
+	 * @throws CorruptDataException 
+	 */
+	String getFilename() throws DataUnavailable, CorruptDataException;
+	
+	/**
+	 * Get the compilation level for this location. This is an implementation 
+	 * defined number indicating the level at which the current location was 
+	 * compiled. 0 indicates interpreted. Any positive number indicates some 
+	 * level of JIT compilation. Typically, higher numbers indicate more 
+	 * aggressive compilation strategies
+	 * <p>
+	 * For native methods, a non-zero compilation level indicates that some
+	 * level of JIT compilation has been applied to the native call (e.g. a
+	 * custom native call stub). To determine if the method is native, use
+	 * getMethod().getModifiers().
+	 * 
+	 * @return the compilation level 
+	 * @throws CorruptDataException 
+	 */
+	int getCompilationLevel() throws CorruptDataException;
+	
+	/**
+	 * Get the method which contains the point of execution.
+	 * @return the method which contains the point of execution
+	 * @throws CorruptDataException 
+	 */
+	JavaMethod getMethod() throws CorruptDataException;
+	
+	/**
+	 * @return A string representing the location as it would be seen in a Java stack trace
+	 */
+	public String toString();
+	
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same Java Location in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMember.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMember.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMember.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMember.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+
+/**
+ * Abstract interface which both JavaField and JavaMethod inherit from.
+ * It defines APIs which are common to both types of members.
+ * It is modelled on java.lang.reflect.Member
+ */
+public interface JavaMember {
+
+	/**
+	 * Get the set of modifiers for this field or method - a set of bits
+	 * 
+	 * @return the modifiers for this field or method. The values for the constants representing
+     * the modifiers can be obtained from java.lang.reflect.Modifier.
+	 * @throws CorruptDataException 
+     *
+     */
+    int getModifiers()  throws CorruptDataException;
+
+    /**
+     * Get the class which declares this field or method
+     * @return the JavaClass which declared this field or method
+     * @throws CorruptDataException 
+     * @throws DataUnavailable 
+     */
+    JavaClass getDeclaringClass() throws CorruptDataException, DataUnavailable;
+    
+    /**
+     * Get the name of the field or method
+     * @return the name of the field or method
+     * @throws CorruptDataException 
+     */
+    String getName()  throws CorruptDataException;
+    
+    /**
+     * Get the signature of the field or method
+     * @return the signature of the field or method.
+     * e.g. "(Ljava/lang/String;)V"
+     * @throws CorruptDataException 
+     */
+    String getSignature()  throws CorruptDataException;
+    
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same Java Member in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMethod.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMethod.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMethod.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMethod.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+/**
+ * Represents a method or constructor in a class
+ */
+public interface JavaMethod extends JavaMember {
+
+    /**
+     * Get the set of ImageSections containing the bytecode of this method.
+     * <br>
+     * Each ImageSection contains data (usually bytecodes) used
+     * in executing this method in interpreted mode. 
+     * <p>
+     * The collection may be empty for native methods, or
+     * pre-compiled methods.
+     * <p>
+     * Typically, the collection will contain no more than one
+     * section, but this is not guaranteed. 
+     * 
+     * @return an iterator over a collection of ImageSections.
+     * 
+     * 
+     * @see com.ibm.dtfj.image.ImageSection
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getBytecodeSections();
+
+    /**
+     * Get the set of ImageSections containing the compiled code of this method.
+     * <br>
+     * Each ImageSection contains data (usually executable code) used
+     * in executing this method in compiled mode.
+     * 
+     * @return an iterator over a collection of ImageSections.
+     * 
+     * @see com.ibm.dtfj.image.ImageSection
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getCompiledSections();
+    
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same JavaMethod in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMonitor.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMonitor.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMonitor.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaMonitor.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.ImagePointer;
+
+
+/**
+ * Represents a monitor, either an object monitor or a raw monitor.
+ */
+public interface JavaMonitor {
+    
+    /**
+     * Get the object associated with this monitor.
+     * @return the object associated with this monitor, or null if this is a raw monitor or a valid object could not be retrieved.
+     */
+    JavaObject getObject();
+
+    /**
+     * Note that the name of a JavaMonitor is not necessarily meaningful but is provided here as it is 
+     * usually present in the running VM.  If there is no name for the monitor a synthetic name will be
+     * created by DTFJ.
+     * 
+     * @return the name of the monitor (never null)
+     * @throws CorruptDataException 
+     */
+    String getName() throws CorruptDataException;
+    
+    /**
+     * Get the thread which currently owns the monitor
+     * @return the owner of the monitor, or null if the monitor is unowned
+     * @throws CorruptDataException 
+     */
+    JavaThread getOwner() throws CorruptDataException;
+    
+    /**
+     * Get the set of threads waiting to enter the monitor
+     * @return an iterator over the collection of threads waiting to enter this monitor
+     * 
+     * @see JavaThread
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getEnterWaiters();
+    
+    /**
+     * Get the set of threads waiting to be notified on the monitor (in the Object.wait method)
+     * @return an iterator over the collection of threads waiting to be notified on
+     * this monitor
+     * 
+     * @see JavaThread
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getNotifyWaiters();
+    
+    /**
+     * Get the identifier for this monitor
+     * @return The pointer which uniquely identifies this monitor in memory.
+     */
+    ImagePointer getID();
+    
+	/**
+	 * @param obj
+	 * @return true if the given object refers to the same Java Monitor in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaObject.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaObject.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaObject.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaObject.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,174 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.ImagePointer;
+import com.ibm.dtfj.image.ImageSection;
+import com.ibm.dtfj.image.MemoryAccessException;
+
+/**
+ * Represents a Java object
+ */
+public interface JavaObject {
+    
+    /**
+     * Get the JavaClass instance which represents the class of this object.
+     * @return the JavaClass instance which represents the class of this object
+     * @throws CorruptDataException 
+     */
+    JavaClass getJavaClass() throws CorruptDataException;
+    
+    /**
+     * Is this object an array ?
+     * @return true if the receiver represents an instance of an array, or
+     * false otherwise
+     * @throws CorruptDataException 
+     */
+    boolean isArray()  throws CorruptDataException;
+    
+    /**
+     * Get the number of elements in this array.
+     * @return the number of elements in this array
+     * <p>
+     * @throws CorruptDataException 
+     * @exception IllegalArgumentException if the receiver is not an array
+     */
+    int getArraySize() throws CorruptDataException;
+    
+    /**
+     * Copies data from the image array into a local Java array.
+     * The dst object must be an array of the appropriate type --
+     * a base type array for base types, or a JavaObject array
+     * for reference arrays. 
+     *  
+     * @param srcStart index in the receiver to start copying from
+     * @param dst the destination array
+     * @param dstStart index in the destination array to start copying into
+     * @param length the number of elements to be copied
+     * @throws CorruptDataException 
+     * @throws MemoryAccessException 
+     * 
+     * @exception NullPointerException if dst is null
+     * @exception IllegalArgumentException if the receiver is not an array,
+     * or if dst is not an array of the appropriate type
+     * @exception IndexOutOfBoundsException if srcStart, dstStart, or length
+     * are out of bounds in either the receiver or the destination array
+     */
+    void arraycopy(int srcStart, Object dst, int dstStart, int length)  throws CorruptDataException, MemoryAccessException;
+    
+    /**
+     * Get the number of bytes of memory occupied by this object.
+     * @return the number of bytes of memory occupied by this object. The
+     * memory may not necessarily be contiguous
+     * @throws CorruptDataException 
+     */
+    long getSize()  throws CorruptDataException;
+    
+    /**
+     * Fetch the basic hash code for the object. This is the hash code which
+     * would be returned if a Java thread had requested it. Typically the hash 
+     * code is based on the address of an object, and may change if the object
+     * is moved by a garbage collect cycle.
+     * 
+     * @return the basic hash code of the object in the image.
+     * 
+     * @see #getPersistentHashcode()
+     * 
+     * @exception DataUnavailable if the hash code cannot be determined
+     * @throws CorruptDataException 
+     */
+    long getHashcode() throws DataUnavailable, CorruptDataException;
+    
+    /**
+     * Fetch the basic hash code of the object in the image. This hash code
+     * is guaranteed to be persistent between multiple snapshots of the same Image.
+     * If the hash code cannot be determined, or if the hash code for this object
+     * could change between snapshots, an exception is thrown.
+     * <p>
+     * <i>If the VM uses a 'hasBeenHashed' bit, the value of this bit can be
+     * inferred by calling getPersistentHashcode(). If the persistent hash code
+     * is not available, then the 'hasBeenHashed' bit has not been set, and the
+     * hash of the object could change if the object moves between snapshots</i>
+     * 
+     * @return the basic hash code of the object in the image
+     * 
+     * @see #getHashcode()
+     * 
+     * @exception DataUnavailable if a hash code cannot be determined, or if the
+     * hash code could change between successive snapshots
+     * @throws CorruptDataException 
+     */
+    long getPersistentHashcode() throws DataUnavailable, CorruptDataException;
+    
+    /**
+     * The ID of an object is a unique address is memory which identifies the object.
+     * The data at this memory is implementation defined. The object may be 
+     * non-contiguous. Portions of the object may appear below or above this address.
+     * 
+     * @return the runtime-wide unique identifier for the object
+     */
+	ImagePointer getID();
+	
+    /**
+     * An object is represented in the Java runtime by one or more regions of memory.
+     * These include the object's header and the data in the object.
+     *
+     * In certain allocation strategies, an object's header and data may be allocated 
+     * contiguously. In this case, this method may return an iterator for a single
+     * section.
+     * 
+     * In other schemes, the header may be separate from the data or the data may be
+     * broken up into multiple regions. Additionally, this function does not guarantee
+     * that the memory used by this object is not also shared by one or more other
+     * objects.
+     * 
+     * Callers should not make any assumptions about the contents of the memory. 
+     * 
+     * @return a collection of sections that make up this object
+     * 
+     * @see ImageSection
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getSections();
+    
+	/**
+	 * Get the set of references from this object.
+	 *
+	 * @return an iterator of JavaReferences
+	 * @see com.ibm.dtfj.java.JavaReference
+	 *
+	 * @see com.ibm.dtfj.image.CorruptData
+	 */
+	Iterator getReferences();
+    
+    /**
+     * Gets the heap where this object is located.
+     * @return	the <code>JavaHeap</code> instance representing the heap where this object is stored in memory.
+     * @throws 	CorruptDataException	if the heap information for this object is corrupt.
+     * @throws 	DataUnavailable			if the heap information for this object is not available.
+     * @see 	com.ibm.dtfj.java.JavaHeap
+     */
+    JavaHeap getHeap() throws CorruptDataException, DataUnavailable;
+	
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same Java Object in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaReference.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaReference.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaReference.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaReference.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+
+/**
+ * Represents a Java reference.
+ */
+public interface JavaReference
+{
+    
+	/** Unknown heap root type */
+    int HEAP_ROOT_UNKNOWN      = 0;
+    /** JNI global reference heap root */
+    int HEAP_ROOT_JNI_GLOBAL   = 1;
+    /** System class heap root */
+    int HEAP_ROOT_SYSTEM_CLASS = 2;
+    /** Monitor heap root */
+    int HEAP_ROOT_MONITOR      = 3;
+    /** Stack local heap root */
+    int HEAP_ROOT_STACK_LOCAL  = 4;
+    /** JNI local reference heap root */
+    int HEAP_ROOT_JNI_LOCAL    = 5;
+    /** Thread heap root */
+    int HEAP_ROOT_THREAD       = 6;
+    /** Other heap root type */
+    int HEAP_ROOT_OTHER        = 7;
+    /** Finalizable object heap root */
+    int HEAP_ROOT_FINALIZABLE_OBJ = 8;
+    /** Unfinalized object heap root */
+    int HEAP_ROOT_UNFINALIZED_OBJ = 9;
+    /** Classloader heap root */
+    int HEAP_ROOT_CLASSLOADER = 10;
+    /** Stringtable heap root */
+    int HEAP_ROOT_STRINGTABLE = 11;
+    
+
+     /** Unknown reference type */
+    int REFERENCE_UNKNOWN           = 0;
+    /** Reference from an object to its class */ 
+    int REFERENCE_CLASS             = 1;  // 
+    /** Reference from an object to the value of one of its instance fields */
+    int REFERENCE_FIELD             = 2;  
+    /** Reference from an array to one of its elements */
+    int REFERENCE_ARRAY_ELEMENT     = 3;
+    /** Reference from a class to its class loader */
+    int REFERENCE_CLASS_LOADER      = 4;
+    /** Reference from a class to its signers array */
+    int REFERENCE_SIGNERS           = 5;
+    /** Reference from a class to its protection domain */
+    int REFERENCE_PROTECTION_DOMAIN = 6;
+    /** Reference from a class to one of its interfaces */
+    int REFERENCE_INTERFACE         = 7;
+    /** Reference from a class to the value of one of its static fields */
+    int REFERENCE_STATIC_FIELD      = 8; 
+    /** Reference from a class to a resolved entry in the constant pool */
+    int REFERENCE_CONSTANT_POOL     = 9;
+    /** Reference from a class to its superclass */
+    int REFERENCE_SUPERCLASS     	= 10;
+    /** Reference from a classloader object to its loaded classes */
+    int REFERENCE_LOADED_CLASS     	= 11;
+    /** Reference from a class to its java.lang.Class instance */
+    int REFERENCE_CLASS_OBJECT      = 12;
+	/** Reference from a JavaObject representing a Class to the associated JavaClass **/
+    int REFERENCE_ASSOCIATED_CLASS 	= 13;
+
+
+    /** Reachability of target object via this reference is unknown */
+    int REACHABILITY_UNKNOWN =  0;
+    /** Reachability of target object via this reference is Strong */
+    int REACHABILITY_STRONG  =  1;
+    /** Reachability of target object via this reference is Soft */
+    int REACHABILITY_SOFT    =  2;
+    /** Reachability of target object via this reference is Weak */
+    int REACHABILITY_WEAK    =  3;
+    /** Reachability of target object via this reference is Phantom */
+    int REACHABILITY_PHANTOM =  4;
+
+    /**
+     * Get the root type, as defined in the JVMTI specification.
+     *
+     * @return an integer representing the root type, see HEAP_ROOT_ statics above.
+     */
+    int getRootType() throws CorruptDataException;
+
+    /**
+     * Get the reference type, as defined in the JVMTI specification.
+     * @return an integer representing the reference type, see REFERENCE_ statics above.
+     */
+    int getReferenceType() throws CorruptDataException;
+
+    /**
+     * Get the reachability of the target object via this specific reference.
+     * @return an integer representing the reachability, see REACHABILITY_ statics above.
+     */
+    int getReachability() throws CorruptDataException;
+
+    /**
+     * Get a string describing the reference type.
+     * Implementors should not depend on the contents or identity of this string.
+     * e.g. "JNI Weak global reference", "Instance field 'MyClass.value'", "Constant pool string constant"
+     * @return a String describing the reference type
+     */
+    String getDescription();
+
+    /**
+     * Does this reference point to an object in the heap?
+     * @return true if the target of this root is an object
+     */
+    boolean isObjectReference() throws DataUnavailable, CorruptDataException;
+
+    /**
+     * Does this reference point to a class?
+     * @return true if the target of this root is a class
+     */
+    boolean isClassReference() throws DataUnavailable, CorruptDataException;
+
+    /**
+     * Get the object referred to by this reference.
+     * @return a JavaObject or a JavaClass
+     */
+    Object getTarget() throws DataUnavailable, CorruptDataException;
+
+    /**
+     * Get the source of this reference if available.
+     * @return a JavaClass, JavaObject, JavaStackFrame or null if unknown
+     */
+    Object getSource() throws DataUnavailable, CorruptDataException;
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaRuntime.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaRuntime.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaRuntime.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaRuntime.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,142 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.ImagePointer;
+import com.ibm.dtfj.image.MemoryAccessException;
+import com.ibm.dtfj.runtime.ManagedRuntime;
+
+/**
+ * Represents an instance of a JavaVM within the ImageProcess
+ */
+public interface JavaRuntime extends ManagedRuntime {
+
+    /**
+     * Get the object that represents the virtual machine
+     * @return the address of the JavaVM structure which represents this JVM instance in JNI
+     * @throws CorruptDataException 
+     */
+    ImagePointer getJavaVM() throws CorruptDataException;
+    
+    /**
+     * Fetch the JavaVMInitArgs which were used to create this VM.
+     * See JNI_CreateJavaVM in the JNI Specification for more details.
+     * 
+     * @return the JavaVMInitArgs which were used to create this VM.
+     * @throws DataUnavailable if the arguments are not available 
+     * @throws CorruptDataException
+     */
+    JavaVMInitArgs getJavaVMInitArgs() throws DataUnavailable, CorruptDataException;
+    
+    /**
+     * Get the set of class loaders active in this VM
+     * @return an iterator of all of the class loaders within this JavaVM
+     * 
+     * @see JavaClassLoader
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getJavaClassLoaders();
+    
+    /**
+     * Get the set of Java threads known by the VM 
+     * @return an iterator of the JavaThreads in the runtime
+     * 
+     * @see JavaThread
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getThreads();
+    
+    /**
+     * This is short cut method. The same result can be found by iterating over all
+     * methods in all class loaders in all classes.
+     * 
+     * @return an iterator over all of the JavaMethods in the JavaRuntime which
+     * have been compiled
+     * 
+     * @see JavaMethod
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getCompiledMethods();
+    
+    /**
+     * Provides access to the collection of monitors used in the JavaVM. This 
+     * collection includes both monitors associated with managed objects (e.g. object
+     * monitors) and monitors associated with internal control structures (e.g.
+     * raw monitors)
+     * 
+     * @return an iterator over the collection of monitors
+     * 
+     * @see JavaMonitor
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getMonitors();
+    
+    /**
+     * Get the set of heaps known by the VM
+     * @return an iterator for all of the Java heaps within this runtime. Heaps
+     * may be specific to this JavaVM instance, or may be shared between multiple
+     * JavaVM instances
+     * 
+     * @see JavaHeap
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getHeaps();
+    
+    /**
+     * Get the set of object and class roots known to the VM.
+     * Stack frame roots are not included in the set. Instead, they can be retrieved using JavaStackFrame.getHeapRoots().
+	 *
+     * @return an iterator over the collection of JavaReferences representing the known global heap roots within this runtime. 
+     *      
+     * @see JavaReference
+     * @see JavaStackFrame
+     * @see com.ibm.dtfj.image.CorruptData
+     * 
+     */
+    Iterator getHeapRoots();
+    
+    /**
+     * Fetches implementation specific trace buffers, like the verbose GC buffer.
+     * 
+     * @param bufferName a String naming the buffer to be fetched
+     * @param formatted true if formatting should be performed on the buffer, or 
+     * false if the raw buffer contents should be returned
+     * @return an implementation specific result, depending on the parameters 
+     * @throws CorruptDataException 
+     */
+    Object getTraceBuffer(String bufferName, boolean formatted) throws CorruptDataException;
+    
+    /**
+     * Gets the object located at address <code>address</code> in the heap.
+     * @param	addr the <code>ImagePointer</code> instance representing the start address of object in the heap;
+     * @return	the <code>JavaObject</code> instance representing the located object.
+     * @throws 	IllegalArgumentException	if  <code>address</code> is outside the heap's boundaries, or if it doesn't point to the start location of an object;
+     * @throws 	MemoryAccessException 		if  <code>address</code> is is in the heap but it's not accessible from the dump;
+     * @throws 	CorruptDataException 		if any data needed to build the returned instance of <code>JavaObject</code> is corrupt.
+     * @throws 	DataUnavailable	 			if any data needed to build the returned instance of <code>JavaObject</code> is not available.
+     * @see 	com.ibm.dtfj.java.JavaObject
+     */
+     JavaObject getObjectAtAddress(ImagePointer address) throws CorruptDataException, IllegalArgumentException, MemoryAccessException, DataUnavailable;
+    
+	/**
+	 * @param obj
+	 * @return true if the given object refers to the same Java Runtime in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaStackFrame.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaStackFrame.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaStackFrame.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaStackFrame.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.ImagePointer;
+
+/**
+ * Represents a Java stack frame.
+ *
+ */
+public interface JavaStackFrame {
+    /**
+     * Get a pointer to the base of this stack frame
+     * @return the base pointer of the stack frame
+     * @throws CorruptDataException 
+     */
+    ImagePointer getBasePointer() throws CorruptDataException;
+    
+	/**
+     * Get the location at which the method owning this frame is currently executing
+     * @return a location object describing where the frame
+     * is executing
+	 * @throws CorruptDataException 
+     * 
+     * @see JavaLocation
+     * 
+     */
+    JavaLocation getLocation() throws CorruptDataException;
+    
+    /**
+     * Get the set of object roots from this stack frame.
+	 *
+     * @return an iterator of JavaReferences
+     */
+	Iterator getHeapRoots();                      
+
+	/**
+	 * @param obj
+	 * @return True if the given object refers to the same JavaStackFrame in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaThread.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaThread.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaThread.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaThread.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.ImagePointer;
+import com.ibm.dtfj.image.ImageSection;
+import com.ibm.dtfj.image.ImageThread;
+
+/**
+ * Represents a Java thread
+ * 
+ * @see com.ibm.dtfj.java.JavaRuntime#getThreads()
+ */
+public interface JavaThread  {
+
+	/** The thread is alive	 */
+	int STATE_ALIVE						= 0x00000001;
+	/** The thread has terminated */
+	int STATE_TERMINATED				= 0x00000002;
+	/** The thread can be run although may not be actually running */
+	int STATE_RUNNABLE					= 0x00000004;
+	/** The thread is waiting on a monitor with no timeout value set */
+	int STATE_WAITING_INDEFINITELY		= 0x00000010;
+	/** The thread is waiting on a monitor but will timeout at some point */
+	int STATE_WAITING_WITH_TIMEOUT		= 0x00000020;
+	/** The thread is in the Thread.sleep method	 */
+	int STATE_SLEEPING					= 0x00000040;
+	/** The thread is in a waiting state in native code	 */
+	int STATE_WAITING					= 0x00000080;
+	/** The thread is in Object.wait */
+	int STATE_IN_OBJECT_WAIT			= 0x00000100;
+	/** The thread has been deliberately removed from scheduling */
+	int STATE_PARKED					= 0x00000200;
+	/** The thread is waiting to enter an object monitor	 */
+	int STATE_BLOCKED_ON_MONITOR_ENTER	= 0x00000400;
+	/** The thread has been suspended by Thread.suspend */
+	int STATE_SUSPENDED					= 0x00100000;
+	/** The thread has a pending interrupt */
+	int STATE_INTERRUPTED				= 0x00200000;
+	/** The thread is in native code */
+	int STATE_IN_NATIVE					= 0x00400000;
+	/** The thread is in a vendor specific state */
+	int STATE_VENDOR_1					= 0x10000000;
+	/** The thread is in a vendor specific state */
+	int STATE_VENDOR_2					= 0x20000000;
+	/** The thread is in a vendor specific state */
+	int STATE_VENDOR_3					= 0x40000000;
+	
+    /**
+     * Get the address of the JNIEnv structure which represents this thread instance in JNI.
+     * @return the address of the JNIEnv structure which represents this thread instance in JNI
+     * @throws CorruptDataException 
+     */
+    ImagePointer getJNIEnv() throws CorruptDataException;
+    
+    /**
+     * Get the Java priority of the thread.
+     * @return the Java priority of the thread (a number between 1 and 10 inclusive)
+     * @throws CorruptDataException 
+     * 
+     * @see Thread#getPriority()
+     */
+    int getPriority() throws CorruptDataException;
+    
+
+    /**
+     * Fetch the java.lang.Thread associated with this thread. If the thread is in the process
+     * of being attached, this may return null.
+     * 
+     * @return the a JavaObject representing the java.lang.Thread associated with this thread
+     * @throws CorruptDataException 
+     * 
+     * @see JavaObject
+     * @see Thread
+     */
+    JavaObject getObject() throws CorruptDataException;
+    
+    /**
+     * Get the state of the thread when the image was created.
+     * @return the state of the thread when the image was created.
+     * The result is a bit vector, and uses the states defined by
+     * the JVMTI specification.
+     * @throws CorruptDataException 
+     */
+    int getState() throws CorruptDataException;
+    
+    /**
+     * Represents the joining point between the Java view of execution and the corresponding native view.
+     * This method is where the mapping from Java into native threading resources is provided.
+     * 
+     * @return the ImageThread which this ManagedThread is currently bound to.
+     * @throws CorruptDataException If the underlying resource describing the native representation of the thread
+     * is damaged
+     * @throws DataUnavailable If no mapping is provided due to missing or limited underlying resources (this 
+     * exception added in DTFJ 1.1)
+     * 
+     * @see ImageThread
+     */
+    ImageThread getImageThread() throws CorruptDataException, DataUnavailable;
+
+    /**
+     * Get the set of ImageSections which make up the managed stack.
+     * <br>
+     * Some Runtime implementations may also use parts of the ImageThread's stack
+     * for JavaStackFrames.
+     * 
+     * @return a collection of ImageSections which make up the managed stack.
+     * 
+     * @see ImageSection
+     * @see ImageThread#getStackSections()
+     * @see com.ibm.dtfj.image.CorruptData
+     */
+    Iterator getStackSections();
+    
+    /**
+     * Get the set of stack frames.
+     * 
+     * @return an iterator to walk the managed stack frames in order from 
+     * top-of-stack (that is, the most recent frame) to bottom-of-stack
+     * 
+     * @see JavaStackFrame
+     * @see com.ibm.dtfj.image.CorruptData
+     * 
+     */
+    Iterator getStackFrames();
+    
+    /**
+     * Return the name of the thread.
+     * 
+     * Usually this is derived from the object associated with the thread, but if the
+     * name cannot be derived this way (e.g. there is no object associated with the thread)
+     * DTFJ will synthesise a name for the thread.
+     * 
+     * @return the name of the thread
+     * @throws CorruptDataException 
+     */
+    String getName() throws CorruptDataException;
+    
+	/**
+	 * @param obj
+	 * @return true if the given object refers to the same Java Thread in the image
+	 */
+	public boolean equals(Object obj);
+	public int hashCode();
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMInitArgs.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMInitArgs.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMInitArgs.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMInitArgs.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import java.util.Iterator;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+
+/**
+ * This class models the JavaVMInitArgs C structure passed to JNI_CreateJavaVM
+ * to create this VM.
+ */
+public interface JavaVMInitArgs {
+
+	/**
+	 * The JNI specified version constant for the Java 1.1 version of JNI
+	 */
+	public static final int JNI_VERSION_1_1 = 0x00010001;
+
+	/**
+	 * The JNI specified version constant for the Java 1.2 version of JNI
+	 */
+	public static final int JNI_VERSION_1_2 = 0x00010002;
+
+	/**
+	 * The JNI specified version constant for the Java 1.4 version of JNI
+	 */
+	public static final int JNI_VERSION_1_4 = 0x00010004;
+	
+	/**
+	 * Fetch the JNI version from the JavaVMInitArgs structure used to create this VM.
+	 * See the JNI specification for the meaning for this field.
+	 *  
+	 * @return the JNI version
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	int getVersion() throws DataUnavailable, CorruptDataException;
+	
+	/**
+	 * Fetch the ignoreUnrecognized field from the JavaVMInitArgs structure used to create this VM.
+	 * See the JNI specification for the meaning of this field.
+	 * 
+	 * @return true if ignoreUnrecognized was set to a non-zero value with the VM was invoked
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	boolean getIgnoreUnrecognized() throws DataUnavailable, CorruptDataException;
+	
+	/**
+	 * Fetch the options used to start this VM, in the order they were originally specified.
+	 * 
+	 * @return an Iterator over the collection of JavaVMOptions
+	 * @throws DataUnavailable
+	 * 
+	 * @see JavaVMOption
+	 */
+	Iterator getOptions() throws DataUnavailable;
+
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMOption.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMOption.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMOption.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/java/JavaVMOption.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.java;
+
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.DataUnavailable;
+import com.ibm.dtfj.image.ImagePointer;
+
+/**
+ * This class models the JavaVMOption C structures passed to JNI_CreateJavaVM
+ * to create this VM.
+ * 
+ * Each JavaVMOption consists of two components:
+ * <ol>
+ * <li> an optionString string, used to identify the option.</li>
+ * <li> an extraInfo pointer, used to pass additional information. This component is usually NULL.</li>
+ * </ol>
+ */
+public interface JavaVMOption {
+
+	/**
+	 * Fetch the optionString component of the option.
+	 * @return a string representing the optionString. This is never null.
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	String getOptionString() throws DataUnavailable, CorruptDataException;
+	
+	/**
+	 * Fetch the extraInfo component of this option.
+	 * @return the pointer value from the extraInfo (usually null).
+	 * @throws DataUnavailable
+	 * @throws CorruptDataException
+	 */
+	ImagePointer getExtraInfo() throws DataUnavailable, CorruptDataException;
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/runtime/ManagedRuntime.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/runtime/ManagedRuntime.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/runtime/ManagedRuntime.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/src/com/ibm/dtfj/runtime/ManagedRuntime.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package com.ibm.dtfj.runtime;
+
+import com.ibm.dtfj.image.CorruptDataException;
+
+
+/**
+ * A generic managed runtime instance.
+ * <br>
+ * No class should implement this interface directly. Instead, they should implement
+ * another interface which extends this interface and provides APIs for a specific
+ * language runtime environment
+ */
+public interface ManagedRuntime {
+    
+    /**
+     * Get the 'full' version information for this runtime.
+     * @return a string representation of the version information for this runtime instance
+     * @throws CorruptDataException 
+     * @see #getVersion()
+     * 
+	 * @deprecated Use "getVersion()" instead
+     */
+	public String getFullVersion() throws CorruptDataException;
+    
+	/**
+	 * Get the version data available for this runtime instance.
+	 * @return a string representing all the version data available for this runtime instance.
+	 * 
+	 * @throws CorruptDataException If the runtime presents no understandable version data
+	 */
+	public String getVersion() throws CorruptDataException;    
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestCorruptDataException.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestCorruptDataException.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestCorruptDataException.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestCorruptDataException.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package test.ibm.dtfj.image;
+
+import junit.framework.TestCase;
+
+import com.ibm.dtfj.image.CorruptData;
+import com.ibm.dtfj.image.CorruptDataException;
+import com.ibm.dtfj.image.ImagePointer;
+
+public class TestCorruptDataException extends TestCase {
+
+	
+	public void testNullConstructor() {
+		
+			try {
+			CorruptDataException cde=new CorruptDataException(null);
+			fail("expected IllegalArgumentException concerning null value");
+			}
+			catch(IllegalArgumentException iae) {
+				
+			}
+	}
+	
+	public void testConstructor() {
+		
+		
+		CorruptData data=new CorruptData(){
+
+			public ImagePointer getAddress() {
+				return null;
+			}};
+		
+		CorruptDataException cde=new CorruptDataException(data);
+		
+	}
+	
+}

Added: incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestImage.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestImage.java?rev=754939&view=auto
==============================================================================
--- incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestImage.java (added)
+++ incubator/kato/trunk/import/org.apache.kato.api/testsrc/test/ibm/dtfj/image/TestImage.java Mon Mar 16 16:41:12 2009
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package test.ibm.dtfj.image;
+
+import junit.framework.TestCase;
+
+public class TestImage extends TestCase
+{
+
+    
+    public void testImageExists() throws Exception {
+        
+        Class clazz=Class.forName("com.ibm.dtfj.image.Image");
+        assertNotNull(clazz);
+    }
+}