incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r784667 [1/2] - in /incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti: ./ src/main/java/org/apache/kato/jvmti/javaruntime/ src/main/java/org/apache/kato/jvmti/javaruntime/model/ src/main/java/org/apache/kato/...
Date Mon, 15 Jun 2009 06:26:50 GMT
Author: spoole
Date: Mon Jun 15 06:26:49 2009
New Revision: 784667

URL: http://svn.apache.org/viewvc?rev=784667&view=rev
Log:
updated jmvti project to read the new xml format dump

Added:
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClass.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClassLoader.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JField.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JFieldValue.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariable.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariableTableEntry.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocation.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMethod.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMonitor.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JStackFrame.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JThread.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JValueHolder.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java
      - copied, changed from r784380, incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/SimpleImagePointer.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/XMLReader.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/test/java/test/apache/kato/jvmti/TestXMLReader.java
Removed:
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinPrinter.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/SimpleImagePointer.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/test/java/test/apache/kato/jvmti/TestBinReader.java
Modified:
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/pom.xml
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
    incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/pom.xml
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/pom.xml?rev=784667&r1=784666&r2=784667&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/pom.xml (original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/pom.xml Mon Jun 15 06:26:49 2009
@@ -20,5 +20,10 @@
 		<version>3.8.1</version>
 		<scope>test</scope>
 	</dependency>
+  	<dependency>
+  		<groupId>commons-codec</groupId>
+  		<artifactId>commons-codec</artifactId>
+  		<version>1.3</version>
+  	</dependency>
     </dependencies>
 </project>
\ No newline at end of file

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java?rev=784667&r1=784666&r2=784667&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java (original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/JavaRuntimeImpl.java Mon Jun 15 06:26:49 2009
@@ -14,7 +14,6 @@
 
 package org.apache.kato.jvmti.javaruntime;
 
-import java.io.File;
 import java.io.IOException;
 import java.util.LinkedList;
 import java.util.List;
@@ -26,15 +25,15 @@
 import org.apache.kato.java.JavaObject;
 import org.apache.kato.java.JavaRuntime;
 import org.apache.kato.java.JavaVMInitArgs;
-import org.apache.kato.jvmti.reader.BinReader;
+import org.apache.kato.jvmti.javaruntime.model.Model;
 
 public class JavaRuntimeImpl implements JavaRuntime {
 
 
-	private BinReader base=null;
+	private Model base=null;
 	
-	public JavaRuntimeImpl(File base) throws IOException {
-		this.base=new BinReader(base);
+	public JavaRuntimeImpl(Model m) throws IOException {
+		this.base=m;
 		
 	}
 	

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClass.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClass.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClass.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClass.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,138 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.kato.ObjectMapList;
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.ImagePointer;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaClassLoader;
+import org.apache.kato.java.JavaObject;
+
+public class JClass implements JavaClass{
+	   /**
+	 * 
+	 */
+	private Model model=null;
+	/**
+	 * @param binReader
+	 */
+	JClass(Model model) {
+		this.model=model;
+	}
+	public int classid=0;
+	public int superclassid=0;
+	public JClassLoader classloader=null;
+	public short status=0;
+	public     short modifiers=0;
+	public short fieldCount=0;
+	public short interfaceCount=0;
+	public short methodsCount=0;
+	public int   nameLength=0; 
+	public String classSig=null;
+		private List<JClass> interfaces=null;
+		private List<JMethod> methods=null;
+		private ObjectMapList<Integer, JField> fields=null;
+		
+		@Override
+		public JavaClassLoader getClassLoader() throws CorruptDataException {
+			
+			return classloader;
+		}
+		public void addInterface(JClass face) {
+			if(interfaces==null) {
+				interfaces=new LinkedList<JClass>();
+			}
+			interfaces.add(face);
+			
+		}
+		public void addMethod(JMethod m) {
+			if(methods==null) {
+				methods=new LinkedList<JMethod>();
+			}
+			m.setParent(this);
+			methods.add(m);
+			
+		}
+		@Override
+		public JavaClass getComponentType() throws CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+		@Override
+		public List getConstantPoolReferences() {
+			return new LinkedList();
+			
+		}
+		@Override
+		public List getDeclaredFields() {
+			
+			if(fields==null) fields=new ObjectMapList<Integer, JField>();
+			System.out.println("asking for fields "+fields);
+			return fields.values();
+		}
+		@Override
+		public List getDeclaredMethods() {
+			if(methods==null) methods=new LinkedList<JMethod>();
+			return methods;
+		}
+		@Override
+		public ImagePointer getID() {
+			// TODO Auto-generated method stub
+			return new SimpleImagePointer(classid); 
+		}
+		@Override
+		public List getInterfaces() {
+			
+			return new LinkedList();
+		}
+		@Override
+		public int getModifiers() throws CorruptDataException {
+			
+			return modifiers;
+		}
+		@Override
+		public String getName() throws CorruptDataException {
+			
+			return classSig;
+		}
+		@Override
+		public JavaObject getObject() throws CorruptDataException {
+			// TODO Auto-generated method stub
+			return null;
+		}
+		@Override
+		public List getReferences() {
+			return new LinkedList();
+		}
+		@Override
+		public JavaClass getSuperclass() throws CorruptDataException {
+			return model.getClass(new Integer(superclassid));
+		}
+		@Override
+		public boolean isArray() throws CorruptDataException {
+			
+			return classSig.startsWith("[");
+		}
+		
+		public JField getField(int id) {
+			
+			if(fields==null) {
+				fields=new ObjectMapList<Integer, JField>();
+			}
+			
+			JField f=fields.get(id);
+			if(f==null) {
+				f=new JField(this,id);
+				fields.put(id, f);
+			}
+			return f;
+			
+			
+		}
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClassLoader.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClassLoader.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClassLoader.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JClassLoader.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,47 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaClassLoader;
+import org.apache.kato.java.JavaObject;
+
+public class JClassLoader implements JavaClassLoader {
+
+	private List<JavaClass> classes=null;
+	
+	@Override
+	public JavaClass findClass(String name) throws CorruptDataException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void addClass(JClass c) {
+		if(classes==null) classes=new LinkedList<JavaClass>();
+		classes.add(c);
+		
+	}
+
+	@Override
+	public List getCachedClasses() {
+		return new LinkedList();
+	}
+
+	@Override
+	public List getDefinedClasses() {
+		if(classes==null) classes=new LinkedList<JavaClass>();
+		return classes;
+	}
+
+	@Override
+	public JavaObject getObject() throws CorruptDataException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JField.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JField.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JField.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JField.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,133 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.MemoryAccessException;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaField;
+import org.apache.kato.java.JavaObject;
+
+public class JField implements JavaField , JValueHolder{
+
+	private JClass clazzid=null;
+	private int id=0;
+	
+	public String genericsignature;
+	public String signature;
+	public String name;
+	public boolean staticField=false;
+	public Object staticValue=null;
+	
+	public JField(JClass classid,int fid) {
+		this.clazzid=classid;
+ 		id=fid;
+		
+	}
+
+	@Override
+	public Object get(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getValue(id);
+		
+	}
+
+	@Override
+	public boolean getBoolean(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getBooleanValue(id);
+	}
+
+	@Override
+	public byte getByte(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getByteValue(id);
+	}
+
+	@Override
+	public char getChar(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getCharValue(id);
+	}
+
+	@Override
+	public double getDouble(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getDoubleValue(id);
+	}
+
+	@Override
+	public float getFloat(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getFloatValue(id);
+	}
+
+	@Override
+	public int getInt(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getIntValue(id);
+	}
+
+	@Override
+	public long getLong(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getLongValue(id);
+	}
+
+	@Override
+	public short getShort(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getShortValue(id);
+	}
+
+	@Override
+	public String getString(JavaObject arg0) throws CorruptDataException,
+			MemoryAccessException {
+		JObject job=(JObject) arg0;
+		return job.getStringValue(id);
+	}
+
+	@Override
+	public JavaClass getDeclaringClass() throws CorruptDataException,
+			DataUnavailable {
+		
+		return clazzid;
+	}
+
+	@Override
+	public int getModifiers() throws CorruptDataException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public String getName() throws CorruptDataException {
+		
+		return name;
+	}
+
+	@Override
+	public String getSignature() throws CorruptDataException {
+		
+		return signature;
+	}
+
+	@Override
+	public void setValue(Object o) {
+			staticValue=o;
+	}
+
+	
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JFieldValue.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JFieldValue.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JFieldValue.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JFieldValue.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,17 @@
+package org.apache.kato.jvmti.javaruntime.model;
+
+public class JFieldValue implements JValueHolder{
+
+	public int id=0;
+	public String signature;
+	public String name;
+	public Object value;
+	public JFieldValue(int id) {
+		this.id=id;
+	}
+	@Override
+	public void setValue(Object o) {
+		value=o;
+	}
+
+}

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariable.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariable.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariable.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariable.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,14 @@
+package org.apache.kato.jvmti.javaruntime.model;
+
+public class JLocalVariable implements JValueHolder{
+
+	public Object value=null;
+	public int slot=0;
+	
+	@Override
+	public void setValue(Object o) {
+		value=o;
+		
+	}
+
+}

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariableTableEntry.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariableTableEntry.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariableTableEntry.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocalVariableTableEntry.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,38 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.java.JavaVariable;
+
+public class JLocalVariableTableEntry implements JavaVariable {
+
+	public String gensig;
+	public String sig;
+	public String name;
+	public int slot;
+	public int length;
+	public int start;
+	@Override
+	public int getLength() {
+		return length;
+	}
+	@Override
+	public String getName() throws DataUnavailable {
+		return name;
+	}
+	@Override
+	public String getSignature() {
+		return sig;
+	}
+	@Override
+	public int getSlot() {
+		return slot;
+	}
+	@Override
+	public int getStart() {
+		return start;
+	}
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocation.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocation.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocation.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JLocation.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,52 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.ImagePointer;
+import org.apache.kato.java.JavaLocation;
+import org.apache.kato.java.JavaMethod;
+
+public class JLocation implements JavaLocation {
+
+	
+	public JMethod method=null;
+	public String filename=null;
+	public int linenumber=0;
+	
+	public JLocation() {
+		
+	}
+	@Override
+	public ImagePointer getAddress() throws CorruptDataException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public int getCompilationLevel() throws CorruptDataException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public String getFilename() throws DataUnavailable,
+			CorruptDataException {
+		
+		return filename;
+	}
+
+	@Override
+	public int getLineNumber() throws DataUnavailable, CorruptDataException {
+		
+		return linenumber;
+	}
+
+	@Override
+	public JavaMethod getMethod() throws CorruptDataException {
+		return method;
+	}
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMethod.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMethod.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMethod.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMethod.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,86 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaMethod;
+
+public class JMethod implements JavaMethod {
+
+	
+	public String genericsignature;
+	public int nativemethod;
+	public int argumentsize;
+	public int maxlocals;
+	public String name=null;
+	public String signature=null;
+	public int mods=0;
+	public JClass parent=null;
+	
+	private List<JLocalVariableTableEntry> localVars=null;
+	public JMethod() {
+		
+	}
+	
+	public void setParent(JClass class1) {
+		parent=class1;
+		
+	}
+
+	public void addLocalVariableTableEntry(JLocalVariableTableEntry entry) {
+		if(localVars==null) {
+			localVars=new LinkedList<JLocalVariableTableEntry>();
+		}
+		
+		localVars.add(entry);
+	}
+
+	@Override
+	public List getBytecodeSections() {
+	
+		return new LinkedList();
+	}
+
+	@Override
+	public List getCompiledSections() {
+		return new LinkedList();
+	}
+
+	@Override
+	public JavaClass getDeclaringClass() throws CorruptDataException,
+			DataUnavailable {
+		
+		return parent;
+	}
+
+	@Override
+	public int getModifiers() throws CorruptDataException {
+		
+		return mods;
+	}
+
+	@Override
+	public String getName() throws CorruptDataException {
+		return name;
+	}
+
+	@Override
+	public String getSignature() throws CorruptDataException {
+		return signature;
+	}
+
+	@Override
+	public List getVariables() throws DataUnavailable {
+		if(localVars==null) {
+			localVars=new LinkedList<JLocalVariableTableEntry>();
+		}
+		return localVars;
+	}
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMonitor.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMonitor.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMonitor.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JMonitor.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,144 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.ImagePointer;
+import org.apache.kato.image.MemoryAccessException;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaHeap;
+import org.apache.kato.java.JavaMonitor;
+import org.apache.kato.java.JavaObject;
+import org.apache.kato.java.JavaThread;
+
+public class JMonitor implements JavaMonitor {
+
+	private JThread owner=null;
+	private int id=0;
+	
+	List<JavaThread> waiters=new LinkedList<JavaThread>();
+	public JMonitor(int monitorid) {
+		this.id=monitorid;
+	}
+
+	@Override
+	public List getEnterWaiters() {
+		
+		return waiters;
+	}
+
+	public void addWaiter(JThread t) {
+		waiters.add(t);
+		
+	}
+
+	@Override
+	public ImagePointer getID() {
+		return new SimpleImagePointer(id);
+		
+	}
+
+	@Override
+	public String getName() throws CorruptDataException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public List getNotifyWaiters() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public JavaObject getObject() {
+		
+		return new JavaObject(){
+
+			@Override
+			public void arraycopy(int srcStart, Object dst, int dstStart,
+					int length) throws CorruptDataException,
+					MemoryAccessException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			@Override
+			public int getArraySize() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public long getHashcode() throws DataUnavailable,
+					CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public JavaHeap getHeap() throws CorruptDataException,
+					DataUnavailable {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public ImagePointer getID() {
+				return new SimpleImagePointer(id);
+			}
+
+			@Override
+			public JavaClass getJavaClass() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public long getPersistentHashcode() throws DataUnavailable,
+					CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public List getReferences() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public List getSections() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public long getSize() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public boolean isArray() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return false;
+			}};
+	}
+
+	@Override
+	public JavaThread getOwner() throws CorruptDataException {
+		return owner;
+	}
+
+	public void setOwner(JThread thread) {
+		this.owner=thread;
+		
+	}
+	
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JObject.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,165 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.ImagePointer;
+import org.apache.kato.image.MemoryAccessException;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaHeap;
+import org.apache.kato.java.JavaObject;
+
+public class JObject implements JavaObject {
+
+	private int objid=0;
+	private long size=0;
+	private Map<Integer,Object> data=new HashMap<Integer, Object>();
+	private JClass clazz=null;
+	public JObject(JClass clazz, int objID) {
+		this.clazz=clazz;
+		this.objid=objID;
+	}
+
+	public void addValue(int fieldid,  Object data) {
+		this.data.put(fieldid,data);
+		
+	}
+
+	public double getDoubleValue(int id) {
+		Double d=(Double) data.get(id);
+		return d;
+	}
+
+	public long getLongValue(int id) {
+		Long d=(Long) data.get(id);
+		return d;
+	}
+
+	public char getCharValue(int id) {
+		Character d=(Character) data.get(id);
+		return d;
+		
+	}
+
+	public boolean getBooleanValue(int id) {
+		Boolean d=(Boolean) data.get(id);
+		return d;
+	}
+
+	public byte getByteValue(int id) {
+		Byte d=(Byte) data.get(id);
+		return d;
+	}
+
+	public float getFloatValue(int id) {
+		Float d=(Float) data.get(id);
+		return d;
+	}
+
+	public int getIntValue(int id) {
+		Integer d=(Integer) data.get(id);
+		return d;		}
+
+	public short getShortValue(int id) {
+		Short d=(Short) data.get(id);
+		return d;
+	}
+
+	public String getStringValue(int id) {
+		String d=(String) data.get(id);
+		return d;
+		
+	}
+
+	public Object getValue(int id) {
+	
+		return data.get(id);
+	}
+
+	@Override
+	public void arraycopy(int srcStart, Object dst, int dstStart, int length)
+			throws CorruptDataException, MemoryAccessException {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public int getArraySize() throws CorruptDataException {
+		
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public long getHashcode() throws DataUnavailable, CorruptDataException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public JavaHeap getHeap() throws CorruptDataException, DataUnavailable {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	@Override
+	public ImagePointer getID() {
+		return new SimpleImagePointer(objid);
+	}
+
+	@Override
+	public JavaClass getJavaClass() throws CorruptDataException {
+		
+		System.out.println("asking for class "+clazz);
+		return clazz;
+	}
+
+	@Override
+	public long getPersistentHashcode() throws DataUnavailable,
+			CorruptDataException {
+		// TODO Auto-generated method stub
+		return 0;
+	}
+
+	@Override
+	public List getReferences() {
+		return new LinkedList();
+	}
+
+	@Override
+	public List getSections() {
+		
+		return new LinkedList();
+	}
+
+	@Override
+	public long getSize() throws CorruptDataException {
+		
+		return size;
+	}
+
+	@Override
+	public boolean isArray() throws CorruptDataException {
+		
+		return clazz.isArray();
+	}
+	
+	public String toString() {
+		if(clazz==null) {
+			return "<unknown>@"+objid;
+		}
+		try {
+			return clazz.getName()+"@"+objid;
+		} catch (CorruptDataException e) {
+			
+			return super.toString();
+		}
+	}
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JStackFrame.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JStackFrame.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JStackFrame.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JStackFrame.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,55 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.kato.ObjectMapList;
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.ImagePointer;
+import org.apache.kato.java.JavaLocation;
+import org.apache.kato.java.JavaStackFrame;
+
+public class JStackFrame implements JavaStackFrame {
+
+	public JLocation location=null;
+	private ObjectMapList<Integer,Object> vars=new ObjectMapList<Integer, Object>();
+	@Override
+	public ImagePointer getBasePointer() throws CorruptDataException {
+		
+		return new SimpleImagePointer(0);
+	}
+
+	@Override
+	public List getHeapRoots() {
+		return new LinkedList();
+	}
+
+	@Override
+	public JavaLocation getLocation() throws CorruptDataException {
+		
+			return location;
+	}
+
+	@Override
+	public Object getVariable(int slot) throws CorruptDataException,
+			DataUnavailable, IndexOutOfBoundsException {
+		Object r=vars.get(slot);
+		System.out.println("asked for variable at slot "+slot+" ("+r+")");
+		return r;
+		
+	}
+	
+	public void addVariable(int slot,Object value) {
+		vars.put(slot, value);
+	}
+
+	@Override
+	public List getVariables() {
+		
+		return vars.values();
+	}
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JThread.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JThread.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JThread.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JThread.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,165 @@
+/**
+ * 
+ */
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.kato.image.CorruptDataException;
+import org.apache.kato.image.DataUnavailable;
+import org.apache.kato.image.ImagePointer;
+import org.apache.kato.image.ImageThread;
+import org.apache.kato.image.MemoryAccessException;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaHeap;
+import org.apache.kato.java.JavaMonitor;
+import org.apache.kato.java.JavaObject;
+import org.apache.kato.java.JavaStackFrame;
+import org.apache.kato.java.JavaThread;
+
+public class JThread implements JavaThread{
+	public JMonitor contendedMonitor=null;
+	public int id=0;
+	public short priority=0;
+	public  short daemon=0;
+	public int   groupID=0;
+	public String threadName=null;
+	
+	private List<JavaMonitor> monitors=null;
+	private List<JavaStackFrame> frames=new LinkedList<JavaStackFrame>();
+	
+	
+	public JThread(int id) {
+		this.id=id;
+	}
+
+	@Override
+	public ImageThread getImageThread() throws CorruptDataException,
+			DataUnavailable {
+		
+			throw new DataUnavailable();
+	}
+	
+	public void addMonitor(JMonitor mon) {
+		if(monitors==null) {
+			monitors=new LinkedList<JavaMonitor>();
+			
+		}
+		mon.setOwner(this);
+		monitors.add(mon);
+		
+		
+	}
+	public void addStackFrame(JStackFrame frame) {
+		frames.add(frame);
+		
+		
+	}
+	@Override
+	public ImagePointer getJNIEnv() throws CorruptDataException {
+		
+		return null;
+	}
+	@Override
+	public String getName() throws CorruptDataException {
+		
+		return threadName;
+	}
+	@Override
+	public JavaObject getObject() throws CorruptDataException {
+		
+		return new JavaObject(){
+
+			@Override
+			public void arraycopy(int srcStart, Object dst, int dstStart,
+					int length) throws CorruptDataException,
+					MemoryAccessException {
+				// TODO Auto-generated method stub
+				
+			}
+
+			@Override
+			public int getArraySize() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public long getHashcode() throws DataUnavailable,
+					CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public JavaHeap getHeap() throws CorruptDataException,
+					DataUnavailable {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public ImagePointer getID() {
+				return new SimpleImagePointer(id);
+			}
+
+			@Override
+			public JavaClass getJavaClass() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public long getPersistentHashcode() throws DataUnavailable,
+					CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public List getReferences() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public List getSections() {
+				// TODO Auto-generated method stub
+				return null;
+			}
+
+			@Override
+			public long getSize() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return 0;
+			}
+
+			@Override
+			public boolean isArray() throws CorruptDataException {
+				// TODO Auto-generated method stub
+				return false;
+			}};
+		
+		
+	}
+	@Override
+	public int getPriority() throws CorruptDataException {
+		
+		return priority;
+	}
+	@Override
+	public List getStackFrames() {
+		return frames;
+	}
+	@Override
+	public List getStackSections() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	@Override
+	public int getState() throws CorruptDataException {
+		
+		return 0;
+	}
+}
\ No newline at end of file

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JValueHolder.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JValueHolder.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JValueHolder.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/JValueHolder.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,7 @@
+package org.apache.kato.jvmti.javaruntime.model;
+
+public interface JValueHolder {
+
+	public void setValue(Object o);
+	
+}

Added: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java?rev=784667&view=auto
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java (added)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/Model.java Mon Jun 15 06:26:49 2009
@@ -0,0 +1,95 @@
+package org.apache.kato.jvmti.javaruntime.model;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.kato.ObjectMapList;
+import org.apache.kato.java.JavaClass;
+import org.apache.kato.java.JavaClassLoader;
+import org.apache.kato.java.JavaMethod;
+import org.apache.kato.java.JavaMonitor;
+import org.apache.kato.java.JavaObject;
+import org.apache.kato.java.JavaThread;
+
+public class Model {
+
+	
+	private ObjectMapList<Integer,JavaThread> threadMap=new ObjectMapList<Integer,JavaThread>();
+	Map<Integer,JavaClass>  classMap=new HashMap<Integer,JavaClass>();
+	private ObjectMapList<Integer,JavaClassLoader> loadersMap=new ObjectMapList<Integer,JavaClassLoader>();
+	private ObjectMapList<Integer,JavaMonitor> monitorsMap=new ObjectMapList<Integer,JavaMonitor>();
+	private ObjectMapList<Integer,JavaMethod>  methodMap=new ObjectMapList<Integer,JavaMethod>();
+	private ObjectMapList<Integer,JavaObject>  objectMap=new ObjectMapList<Integer,JavaObject>();
+	
+	
+	public JClass getClass(int id) {
+		if(id==0) return null;
+		JClass m=(JClass) classMap.get(id);
+		if(m==null) {
+			m=new JClass(this);
+			m.classid=id;
+			classMap.put(id,m);
+		}
+		return m;
+	}
+	public JMethod getMethod(int methodid) {
+		if(methodid==0) return null;
+		JMethod m=(JMethod) methodMap.get(methodid);
+		if(m==null) {
+			m=new JMethod();
+		
+			methodMap.put(methodid,m);
+		}
+		return m;
+		
+	}
+	public JClassLoader getLoader(int classloaderid) {
+		
+		JClassLoader loader=(JClassLoader) loadersMap.get(classloaderid);
+		if(loader==null) {
+			loader=new JClassLoader();
+			loadersMap.put(classloaderid, loader);
+		}
+		return loader;
+	}
+	
+	
+public JObject getObject(int classid, int objectid) {
+		
+		JObject o=(JObject) objectMap.get(objectid);
+		if(o==null) {
+			JClass clazz=getClass(classid);
+			o=new JObject(clazz,objectid);
+			objectMap.put(objectid,o);
+		}
+		return o;
+	}
+	public JMonitor getMonitor(int monitorid) {
+		if(monitorid==0) return null;
+		JMonitor m=(JMonitor) monitorsMap.get(monitorid);
+		if(m==null) {
+			m=new JMonitor(monitorid);
+			monitorsMap.put(monitorid,m);
+		}
+		return m;
+	}
+	public List getThreads() {
+		return threadMap.values();
+	}
+public List getJavaClassLoader() {
+		
+		return loadersMap.values();
+	}
+	public List getJavaMonitors() {
+		return monitorsMap.values();
+	}
+	public JThread getThread(int id) {
+		JThread t=(JThread) threadMap.get(id);
+		if(t!=null) return t;
+		t=new JThread(id);
+		threadMap.put(t.id, t);
+		return t;
+	}
+	
+}

Copied: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java (from r784380, incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/SimpleImagePointer.java)
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java?p2=incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java&p1=incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/SimpleImagePointer.java&r1=784380&r2=784667&rev=784667&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/SimpleImagePointer.java (original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/javaruntime/model/SimpleImagePointer.java Mon Jun 15 06:26:49 2009
@@ -1,7 +1,7 @@
 /**
  * 
  */
-package org.apache.kato.jvmti.reader;
+package org.apache.kato.jvmti.javaruntime.model;
 
 import org.apache.kato.image.CorruptDataException;
 import org.apache.kato.image.DataUnavailable;
@@ -9,7 +9,7 @@
 import org.apache.kato.image.ImagePointer;
 import org.apache.kato.image.MemoryAccessException;
 
-final class SimpleImagePointer implements ImagePointer {
+public final class SimpleImagePointer implements ImagePointer {
 	private int address=0;
 	public SimpleImagePointer(int id) {
 		this.address=id;

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java?rev=784667&r1=784666&r2=784667&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java (original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java Mon Jun 15 06:26:49 2009
@@ -30,6 +30,7 @@
 import org.apache.kato.image.ImageProcess;
 import org.apache.kato.image.ImageThread;
 import org.apache.kato.jvmti.javaruntime.JavaRuntimeImpl;
+import org.apache.kato.jvmti.reader.BinReader;
 import org.apache.kato.runtime.ManagedRuntime;
 
 public class ImageImpl implements Image{
@@ -91,7 +92,8 @@
 				if(runtimes==null) {
 					runtimes=new LinkedList<ManagedRuntime>();
 					try {
-						runtimes.add(new JavaRuntimeImpl(file));
+						BinReader br=new BinReader(file);
+						runtimes.add(new JavaRuntimeImpl(br.getModel()));
 					} catch (IOException e) {
 						e.printStackTrace();
 						

Modified: incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java?rev=784667&r1=784666&r2=784667&view=diff
==============================================================================
--- incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java (original)
+++ incubator/kato/branches/experimental/maven_restructure/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/reader/BinReader.java Mon Jun 15 06:26:49 2009
@@ -18,30 +18,21 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.util.HashMap;
-import java.util.LinkedList;
 import java.util.List;
-import java.util.Map;
 
 import javax.imageio.stream.FileImageInputStream;
 
-import org.apache.kato.ObjectMapList;
-import org.apache.kato.image.CorruptDataException;
-import org.apache.kato.image.DataUnavailable;
-import org.apache.kato.image.ImagePointer;
-import org.apache.kato.image.ImageThread;
-import org.apache.kato.image.MemoryAccessException;
-import org.apache.kato.java.JavaClass;
-import org.apache.kato.java.JavaClassLoader;
-import org.apache.kato.java.JavaField;
-import org.apache.kato.java.JavaHeap;
-import org.apache.kato.java.JavaLocation;
-import org.apache.kato.java.JavaMethod;
-import org.apache.kato.java.JavaMonitor;
-import org.apache.kato.java.JavaObject;
-import org.apache.kato.java.JavaStackFrame;
-import org.apache.kato.java.JavaThread;
-import org.apache.kato.java.JavaVariable;
+import org.apache.kato.jvmti.javaruntime.model.JClass;
+import org.apache.kato.jvmti.javaruntime.model.JClassLoader;
+import org.apache.kato.jvmti.javaruntime.model.JField;
+import org.apache.kato.jvmti.javaruntime.model.JLocalVariableTableEntry;
+import org.apache.kato.jvmti.javaruntime.model.JLocation;
+import org.apache.kato.jvmti.javaruntime.model.JMethod;
+import org.apache.kato.jvmti.javaruntime.model.JMonitor;
+import org.apache.kato.jvmti.javaruntime.model.JObject;
+import org.apache.kato.jvmti.javaruntime.model.JStackFrame;
+import org.apache.kato.jvmti.javaruntime.model.JThread;
+import org.apache.kato.jvmti.javaruntime.model.Model;
 
 public class BinReader {
 
@@ -50,14 +41,8 @@
 	private static final int MAX_MOD=1;
 	
 	
-	private ObjectMapList<Integer,JavaThread> threadMap=new ObjectMapList<Integer,JavaThread>();
-	private Map<Integer,JavaClass>  classMap=new HashMap<Integer,JavaClass>();
-	private ObjectMapList<Integer,JavaClassLoader> loadersMap=new ObjectMapList<Integer,JavaClassLoader>();
-	private ObjectMapList<Integer,JavaMonitor> monitorsMap=new ObjectMapList<Integer,JavaMonitor>();
-	private ObjectMapList<Integer,JavaMethod>  methodMap=new ObjectMapList<Integer,JavaMethod>();
-	private ObjectMapList<Integer,JavaObject>  objectMap=new ObjectMapList<Integer,JavaObject>();
 	FileImageInputStream in=null;
-	
+	Model model=new Model();
 	 
 	
 	public BinReader(File base) throws IOException {
@@ -147,7 +132,7 @@
 		
 		int objID=in.readInt();
 		int clazzID=in.readInt();
-		JClass clazz=getClass(clazzID);
+		JClass clazz=model.getClass(clazzID);
 		JObject obj=new JObject(clazz,objID);
 		
 		// read and add fields...
@@ -167,28 +152,28 @@
 		
 		if( signature.equals("Z"))  {
 				int value=in.readInt();
-				obj.addValue(fieldid,signature,value);
+				obj.addValue(fieldid,value);
 		}
 		else if( signature.equals("C"))  {
 			char value=in.readChar();
-			obj.addValue(fieldid,signature,value);
+			obj.addValue(fieldid,value);
 	    }
 		else if( signature.equals("I"))  {
 			int value=in.readInt();
-			obj.addValue(fieldid,signature,value);
+			obj.addValue(fieldid,value);
 	    }
 		else if( signature.equals("B"))  {
 			int value=in.readInt();
 		
-			obj.addValue(fieldid,signature,value);
+			obj.addValue(fieldid,value);
 	    }
 		else if( signature.equals("S"))  {
 			int value=in.readInt();
-			obj.addValue(fieldid,signature,value);
+			obj.addValue(fieldid,value);
 	    }
 		else if( signature.equals("J"))  {
 			long value=in.readLong();
-			obj.addValue(fieldid,signature,value);
+			obj.addValue(fieldid,value);
 	    }
 		else if( signature.equals("[C"))  {
 			int length=in.readInt();
@@ -197,7 +182,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readChar();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
 		else if( signature.equals("[I"))  {
 			int length=in.readInt();
@@ -206,7 +191,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readInt();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
 		else if( signature.equals("[B"))  {
 			int length=in.readInt();
@@ -215,7 +200,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readShort();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
 		else if( signature.equals("[S"))  {
 			int length=in.readInt();
@@ -224,7 +209,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readShort();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
                
 		else if( signature.equals("[J"))  {
@@ -234,7 +219,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readLong();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
                 
 		else if( signature.equals("[F"))  {
@@ -244,7 +229,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readFloat();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
             
 		else if( signature.equals("[D"))  {
@@ -254,7 +239,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readDouble();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
                       
 		else if( signature.startsWith("["))  {
@@ -264,7 +249,7 @@
 			for(int i=0;i<length;i++) {
 				data[i]=in.readInt();
 			}
-			obj.addValue(fieldid,signature,data);
+			obj.addValue(fieldid,data);
 	    }
                       
 		else {
@@ -303,10 +288,10 @@
 		int id=in.readShort();
 		if(id!=201) error("unexpected class record id of "+id);
 		int classid=in.readInt();
-		JClass c=getClass(classid);
+		JClass c=model.getClass(classid);
 	    c.superclassid=in.readInt();
 	    int classloaderid=in.readInt();
-	    JClassLoader loader=getLoader(classloaderid);
+	    JClassLoader loader=model.getLoader(classloaderid);
 	    loader.addClass(c);
 	    c.status=in.readShort();
 	    c.modifiers=in.readShort();
@@ -335,7 +320,8 @@
 		}
 		
 		//trace("read class - name ="+c.classSig);
-		classMap.put(c.classid, c);
+		
+		
 	}
 	
 	private void readMethods(JClass c) throws IOException {
@@ -349,7 +335,7 @@
 			int rid=in.readShort();
 			if(rid!=204) error("unexpected method record id of "+rid);
 			int id=in.readInt();
-			JMethod m=getMethod(id);
+			JMethod m=model.getMethod(id);
 			c.addMethod(m);   
 			
 			m.mods=in.readInt();
@@ -393,51 +379,14 @@
 		
 		for(int i=0;i<count;i++) {
 			int id=in.readInt();
-			JClass face=getClass(id);
+			JClass face=model.getClass(id);
 			c.addInterface(face);    
 		}
 		
 	}
 	
-	private JMonitor getMonitor(int monitorid) {
-		if(monitorid==0) return null;
-		JMonitor m=(JMonitor) monitorsMap.get(monitorid);
-		if(m==null) {
-			m=new JMonitor(monitorid);
-			monitorsMap.put(monitorid,m);
-		}
-		return m;
-	}
-	private JClass getClass(int id) {
-		if(id==0) return null;
-		JClass m=(JClass) classMap.get(id);
-		if(m==null) {
-			m=new JClass();
-			m.classid=id;
-			classMap.put(id,m);
-		}
-		return m;
-	}
-	private JMethod getMethod(int methodid) {
-		if(methodid==0) return null;
-		JMethod m=(JMethod) methodMap.get(methodid);
-		if(m==null) {
-			m=new JMethod();
-		
-			methodMap.put(methodid,m);
-		}
-		return m;
-		
-	}
-	private JClassLoader getLoader(int classloaderid) {
-		
-		JClassLoader loader=(JClassLoader) loadersMap.get(classloaderid);
-		if(loader==null) {
-			loader=new JClassLoader();
-			loadersMap.put(classloaderid, loader);
-		}
-		return loader;
-	}
+	
+	
 	private String readName() throws IOException {
 		int   nameLength=in.readInt();
 		if(nameLength>0) {
@@ -487,13 +436,13 @@
 		int id=in.readShort();
 		if(id!=101) error("unexpected thread record id of "+id);
 		int threadid=in.readInt();
-		JThread t=new JThread();
+		JThread t=model.getThread(threadid);
 		t.id=threadid;
 		t.priority=in.readShort();
 		t.daemon=in.readShort();
 		t.groupID=in.readInt();
 		int contendedMonitor=in.readInt();
-		t.contendedMonitor=getMonitor(contendedMonitor);
+		t.contendedMonitor=model.getMonitor(contendedMonitor);
 		if(t.contendedMonitor!=null) {
 			t.contendedMonitor.addWaiter(t);
 		}
@@ -502,7 +451,7 @@
 		t.threadName=readName();
 		
 		trace("read thread - name ="+t.threadName);
-		threadMap.put(t.id, t);
+		
 		
 		// read monitors...
 		if(monitorCount>0) {
@@ -533,7 +482,7 @@
 		int vars=in.readInt();
 		
 		JLocation loc=new JLocation();
-		loc.method=getMethod(methodid);
+		loc.method=model.getMethod(methodid);
 		loc.linenumber=location;
 		
 		JStackFrame frame=new JStackFrame();
@@ -692,21 +641,12 @@
 		
         int objectid=in.readInt();
         int classid=in.readInt();
-        JObject obj=getObject(classid,objectid);
+        JObject obj=model.getObject(classid,objectid);
     	frame.addVariable(slot, obj);
          
 		
 	}
-	private JObject getObject(int classid, int objectid) {
-		
-		JObject o=(JObject) objectMap.get(objectid);
-		if(o==null) {
-			JClass clazz=getClass(classid);
-			o=new JObject(clazz,objectid);
-			objectMap.put(objectid,o);
-		}
-		return o;
-	}
+	
 	private void trace(String msg, byte[] data) {
 		System.out.print(msg+" : ");
 		for(int i=0;i<data.length;i++) {
@@ -731,7 +671,7 @@
 	private void readMonitor(JThread t) throws IOException {
 		
 		int id=in.readInt();
-		JMonitor mon=getMonitor(id);
+		JMonitor mon=model.getMonitor(id);
 		t.addMonitor(mon);
 		
 	}
@@ -750,874 +690,19 @@
 		
 	}
 	
-	public List getThreads() {
-		return threadMap.values();
-	}
 	
 	
-	class JMonitor implements JavaMonitor {
-
-		private JThread owner=null;
-		private int id=0;
-		
-		List<JavaThread> waiters=new LinkedList<JavaThread>();
-		public JMonitor(int monitorid) {
-			this.id=monitorid;
-		}
-
-		@Override
-		public List getEnterWaiters() {
-			
-			return waiters;
-		}
-
-		private void addWaiter(JThread t) {
-			waiters.add(t);
-			
-		}
-
-		@Override
-		public ImagePointer getID() {
-			return new SimpleImagePointer(id);
-			
-		}
-
-		@Override
-		public String getName() throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public List getNotifyWaiters() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public JavaObject getObject() {
-			
-			return new JavaObject(){
-
-				@Override
-				public void arraycopy(int srcStart, Object dst, int dstStart,
-						int length) throws CorruptDataException,
-						MemoryAccessException {
-					// TODO Auto-generated method stub
-					
-				}
-
-				@Override
-				public int getArraySize() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public long getHashcode() throws DataUnavailable,
-						CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public JavaHeap getHeap() throws CorruptDataException,
-						DataUnavailable {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public ImagePointer getID() {
-					return new SimpleImagePointer(id);
-				}
-
-				@Override
-				public JavaClass getJavaClass() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public long getPersistentHashcode() throws DataUnavailable,
-						CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public List getReferences() {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public List getSections() {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public long getSize() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public boolean isArray() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return false;
-				}};
-		}
-
-		@Override
-		public JavaThread getOwner() throws CorruptDataException {
-			return owner;
-		}
-
-		public void setOwner(JThread thread) {
-			this.owner=thread;
-			
-		}
-		
-	}
-	class JThread implements JavaThread{
-		public JMonitor contendedMonitor=null;
-		int id=0;
-		short priority=0;
-		short daemon=0;
-		int   groupID=0;
-		String threadName=null;
-		
-		private List<JavaMonitor> monitors=null;
-		private List<JavaStackFrame> frames=new LinkedList<JavaStackFrame>();
-		
-		
-		@Override
-		public ImageThread getImageThread() throws CorruptDataException,
-				DataUnavailable {
-			
-				throw new DataUnavailable();
-		}
-		
-		private void addMonitor(JMonitor mon) {
-			if(monitors==null) {
-				monitors=new LinkedList<JavaMonitor>();
-				
-			}
-			mon.setOwner(this);
-			monitors.add(mon);
-			
-			
-		}
-		private void addStackFrame(JStackFrame frame) {
-			frames.add(frame);
-			
-			
-		}
-		@Override
-		public ImagePointer getJNIEnv() throws CorruptDataException {
-			
-			return null;
-		}
-		@Override
-		public String getName() throws CorruptDataException {
-			
-			return threadName;
-		}
-		@Override
-		public JavaObject getObject() throws CorruptDataException {
-			
-			return new JavaObject(){
-
-				@Override
-				public void arraycopy(int srcStart, Object dst, int dstStart,
-						int length) throws CorruptDataException,
-						MemoryAccessException {
-					// TODO Auto-generated method stub
-					
-				}
-
-				@Override
-				public int getArraySize() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public long getHashcode() throws DataUnavailable,
-						CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public JavaHeap getHeap() throws CorruptDataException,
-						DataUnavailable {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public ImagePointer getID() {
-					return new SimpleImagePointer(id);
-				}
-
-				@Override
-				public JavaClass getJavaClass() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public long getPersistentHashcode() throws DataUnavailable,
-						CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public List getReferences() {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public List getSections() {
-					// TODO Auto-generated method stub
-					return null;
-				}
-
-				@Override
-				public long getSize() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return 0;
-				}
-
-				@Override
-				public boolean isArray() throws CorruptDataException {
-					// TODO Auto-generated method stub
-					return false;
-				}};
-			
-			
-		}
-		@Override
-		public int getPriority() throws CorruptDataException {
-			
-			return priority;
-		}
-		@Override
-		public List getStackFrames() {
-			return frames;
-		}
-		@Override
-		public List getStackSections() {
-			// TODO Auto-generated method stub
-			return null;
-		}
-		@Override
-		public int getState() throws CorruptDataException {
-			
-			return 0;
-		}
-	}
 	
-	class JClassLoader implements JavaClassLoader {
-
-		private List<JavaClass> classes=null;
-		
-		@Override
-		public JavaClass findClass(String name) throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		private void addClass(JClass c) {
-			if(classes==null) classes=new LinkedList<JavaClass>();
-			classes.add(c);
-			
-		}
-
-		@Override
-		public List getCachedClasses() {
-			return new LinkedList();
-		}
-
-		@Override
-		public List getDefinedClasses() {
-			if(classes==null) classes=new LinkedList<JavaClass>();
-			return classes;
-		}
-
-		@Override
-		public JavaObject getObject() throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return null;
-		}
-		
-	}
-	class JClass implements JavaClass{
-		   int classid=0;
-		   int superclassid=0;
-		   JClassLoader classloader=null;
-		    short status=0;
-		    short modifiers=0;
-		    short fieldCount=0;
-		    short interfaceCount=0;
-		    short methodsCount=0;
-		    int   nameLength=0; 
-			String classSig=null;
-			private List<JClass> interfaces=null;
-			private List<JMethod> methods=null;
-			private List<JField> fields=null;
-			@Override
-			public JavaClassLoader getClassLoader() throws CorruptDataException {
-				
-				return classloader;
-			}
-			private void addInterface(JClass face) {
-				if(interfaces==null) {
-					interfaces=new LinkedList<JClass>();
-				}
-				interfaces.add(face);
-				
-			}
-			private void addMethod(JMethod m) {
-				if(methods==null) {
-					methods=new LinkedList<JMethod>();
-				}
-				m.setParent(this);
-				methods.add(m);
-				
-			}
-			@Override
-			public JavaClass getComponentType() throws CorruptDataException {
-				// TODO Auto-generated method stub
-				return null;
-			}
-			@Override
-			public List getConstantPoolReferences() {
-				return new LinkedList();
-				
-			}
-			@Override
-			public List getDeclaredFields() {
-				
-				if(fields==null) fields=new LinkedList<JField>();
-				System.out.println("asking for fields "+fields);
-				return fields;
-			}
-			@Override
-			public List getDeclaredMethods() {
-				if(methods==null) methods=new LinkedList<JMethod>();
-				return methods;
-			}
-			@Override
-			public ImagePointer getID() {
-				// TODO Auto-generated method stub
-				return new SimpleImagePointer(classid); 
-			}
-			@Override
-			public List getInterfaces() {
-				
-				return new LinkedList();
-			}
-			@Override
-			public int getModifiers() throws CorruptDataException {
-				
-				return modifiers;
-			}
-			@Override
-			public String getName() throws CorruptDataException {
-				
-				return classSig;
-			}
-			@Override
-			public JavaObject getObject() throws CorruptDataException {
-				// TODO Auto-generated method stub
-				return null;
-			}
-			@Override
-			public List getReferences() {
-				return new LinkedList();
-			}
-			@Override
-			public JavaClass getSuperclass() throws CorruptDataException {
-				return classMap.get(new Integer(superclassid));
-			}
-			@Override
-			public boolean isArray() throws CorruptDataException {
-				
-				return classSig.startsWith("[");
-			}
-			public void addField(JField field) {
-				if(fields==null) {
-					fields=new LinkedList<JField>();
-				}
-				fields.add(field);
-				
-			}
-		
-	}
-	
-	class JField implements JavaField {
-
-		private JClass clazzid=null;
-		private int id=0;
-		
-		public String genericsignature;
-		public String signature;
-		public String name;
-
-		public JField(JClass classid,int fid) {
-			this.clazzid=classid;
-	 		id=fid;
-			classid.addField(this);
-		}
-
-		@Override
-		public Object get(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getValue(id);
-			
-		}
-
-		@Override
-		public boolean getBoolean(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getBooleanValue(id);
-		}
-
-		@Override
-		public byte getByte(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getByteValue(id);
-		}
-
-		@Override
-		public char getChar(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getCharValue(id);
-		}
-
-		@Override
-		public double getDouble(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getDoubleValue(id);
-		}
-
-		@Override
-		public float getFloat(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getFloatValue(id);
-		}
-
-		@Override
-		public int getInt(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getIntValue(id);
-		}
-
-		@Override
-		public long getLong(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getLongValue(id);
-		}
-
-		@Override
-		public short getShort(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getShortValue(id);
-		}
-
-		@Override
-		public String getString(JavaObject arg0) throws CorruptDataException,
-				MemoryAccessException {
-			JObject job=(JObject) arg0;
-			return job.getStringValue(id);
-		}
-
-		@Override
-		public JavaClass getDeclaringClass() throws CorruptDataException,
-				DataUnavailable {
-			
-			return clazzid;
-		}
-
-		@Override
-		public int getModifiers() throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		@Override
-		public String getName() throws CorruptDataException {
-			
-			return name;
-		}
-
-		@Override
-		public String getSignature() throws CorruptDataException {
-			
-			return signature;
-		}
-		
-	}
-
-	class JStackFrame implements JavaStackFrame {
-
-		private JLocation location=null;
-		private ObjectMapList<Integer,Object> vars=new ObjectMapList<Integer, Object>();
-		@Override
-		public ImagePointer getBasePointer() throws CorruptDataException {
-			
-			return new SimpleImagePointer(0);
-		}
-
-		@Override
-		public List getHeapRoots() {
-			return new LinkedList();
-		}
-
-		@Override
-		public JavaLocation getLocation() throws CorruptDataException {
-			
-				return location;
-		}
-
-		@Override
-		public Object getVariable(int slot) throws CorruptDataException,
-				DataUnavailable, IndexOutOfBoundsException {
-			Object r=vars.get(slot);
-			System.out.println("asked for variable at slot "+slot+" ("+r+")");
-			return r;
-			
-		}
-		
-		private void addVariable(int slot,Object value) {
-			vars.put(slot, value);
-		}
-
-		@Override
-		public List getVariables() {
-			
-			return vars.values();
-		}
-	}
-	
-	class JLocation implements JavaLocation {
-
-		
-		private JMethod method=null;
-		String filename=null;
-		int linenumber=0;
-		
-		public JLocation() {
-			
-		}
-		@Override
-		public ImagePointer getAddress() throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public int getCompilationLevel() throws CorruptDataException {
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		@Override
-		public String getFilename() throws DataUnavailable,
-				CorruptDataException {
-			
-			return filename;
-		}
-
-		@Override
-		public int getLineNumber() throws DataUnavailable, CorruptDataException {
-			
-			return linenumber;
-		}
-
-		@Override
-		public JavaMethod getMethod() throws CorruptDataException {
-			return method;
-		}
-		
+	class VariableValue {
+		String signature=null;
 	}
-	
-	class JMethod implements JavaMethod {
 
-		
-		public String genericsignature;
-		public int nativemethod;
-		public int argumentsize;
-		public int maxlocals;
-		private String name=null;
-		private String signature=null;
-		private int mods=0;
-		private JClass parent=null;
-		
-		private List<JLocalVariableTableEntry> localVars=null;
-		public JMethod() {
-			
-		}
-		
-		public void setParent(JClass class1) {
-			parent=class1;
-			
-		}
-
-		private void addLocalVariableTableEntry(JLocalVariableTableEntry entry) {
-			if(localVars==null) {
-				localVars=new LinkedList<JLocalVariableTableEntry>();
-			}
-			
-			localVars.add(entry);
-		}
-
-		@Override
-		public List getBytecodeSections() {
-		
-			return new LinkedList();
-		}
-
-		@Override
-		public List getCompiledSections() {
-			return new LinkedList();
-		}
-
-		@Override
-		public JavaClass getDeclaringClass() throws CorruptDataException,
-				DataUnavailable {
-			
-			return parent;
-		}
-
-		@Override
-		public int getModifiers() throws CorruptDataException {
-			
-			return mods;
-		}
 
-		@Override
-		public String getName() throws CorruptDataException {
-			return name;
-		}
 
-		@Override
-		public String getSignature() throws CorruptDataException {
-			return signature;
-		}
 
-		@Override
-		public List getVariables() throws DataUnavailable {
-			if(localVars==null) {
-				localVars=new LinkedList<JLocalVariableTableEntry>();
-			}
-			return localVars;
-		}
-		
+	public Model getModel() {
+		return model;
 	}
 	
-	class JLocalVariableTableEntry implements JavaVariable {
-
-		public String gensig;
-		public String sig;
-		public String name;
-		public int slot;
-		public int length;
-		public int start;
-		@Override
-		public int getLength() {
-			return length;
-		}
-		@Override
-		public String getName() throws DataUnavailable {
-			return name;
-		}
-		@Override
-		public String getSignature() {
-			return sig;
-		}
-		@Override
-		public int getSlot() {
-			return slot;
-		}
-		@Override
-		public int getStart() {
-			return start;
-		}
-		
-	}
-
-	class JObject implements JavaObject {
-
-		private int objid=0;
-		private long size=0;
-		private Map<Integer,Object> data=new HashMap<Integer, Object>();
-		private JClass clazz=null;
-		public JObject(JClass clazz, int objID) {
-			this.clazz=clazz;
-			this.objid=objID;
-		}
-
-		public void addValue(int fieldid, String signature, Object data) {
-			this.data.put(fieldid,data);
-			
-		}
-
-		public double getDoubleValue(int id) {
-			Double d=(Double) data.get(id);
-			return d;
-		}
-
-		public long getLongValue(int id) {
-			Long d=(Long) data.get(id);
-			return d;
-		}
-
-		public char getCharValue(int id) {
-			Character d=(Character) data.get(id);
-			return d;
-			
-		}
-
-		public boolean getBooleanValue(int id) {
-			Boolean d=(Boolean) data.get(id);
-			return d;
-		}
-
-		public byte getByteValue(int id) {
-			Byte d=(Byte) data.get(id);
-			return d;
-		}
-
-		public float getFloatValue(int id) {
-			Float d=(Float) data.get(id);
-			return d;
-		}
-
-		public int getIntValue(int id) {
-			Integer d=(Integer) data.get(id);
-			return d;		}
-
-		public short getShortValue(int id) {
-			Short d=(Short) data.get(id);
-			return d;
-		}
-
-		public String getStringValue(int id) {
-			String d=(String) data.get(id);
-			return d;
-			
-		}
-
-		public Object getValue(int id) {
-		
-			return data.get(id);
-		}
-
-		@Override
-		public void arraycopy(int srcStart, Object dst, int dstStart, int length)
-				throws CorruptDataException, MemoryAccessException {
-			// TODO Auto-generated method stub
-			
-		}
-
-		@Override
-		public int getArraySize() throws CorruptDataException {
-			
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		@Override
-		public long getHashcode() throws DataUnavailable, CorruptDataException {
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		@Override
-		public JavaHeap getHeap() throws CorruptDataException, DataUnavailable {
-			// TODO Auto-generated method stub
-			return null;
-		}
-
-		@Override
-		public ImagePointer getID() {
-			return new SimpleImagePointer(objid);
-		}
-
-		@Override
-		public JavaClass getJavaClass() throws CorruptDataException {
-			
-			System.out.println("asking for class "+clazz);
-			return clazz;
-		}
-
-		@Override
-		public long getPersistentHashcode() throws DataUnavailable,
-				CorruptDataException {
-			// TODO Auto-generated method stub
-			return 0;
-		}
-
-		@Override
-		public List getReferences() {
-			return new LinkedList();
-		}
-
-		@Override
-		public List getSections() {
-			
-			return new LinkedList();
-		}
-
-		@Override
-		public long getSize() throws CorruptDataException {
-			
-			return size;
-		}
-
-		@Override
-		public boolean isArray() throws CorruptDataException {
-			
-			return clazz.isArray();
-		}
-		
-		public String toString() {
-			if(clazz==null) {
-				return "<unknown>@"+objid;
-			}
-			try {
-				return clazz.getName()+"@"+objid;
-			} catch (CorruptDataException e) {
-				
-				return super.toString();
-			}
-		}
-	}
-	class VariableValue {
-		String signature=null;
-	}
 	
-	public List getJavaClassLoader() {
-		
-		return loadersMap.values();
-	}
-	public List getJavaMonitors() {
-		return monitorsMap.values();
-	}
 }



Mime
View raw message