incubator-kato-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From spo...@apache.org
Subject svn commit: r828044 - in /incubator/kato/branches/experimental/thirdview/org.apache.kato: kato.api/src/main/java/javax/tools/diagnostics/image/ kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ kato.hprof.api/src/main/java/org/apache/kato/hprof/...
Date Wed, 21 Oct 2009 15:26:24 GMT
Author: spoole
Date: Wed Oct 21 15:26:23 2009
New Revision: 828044

URL: http://svn.apache.org/viewvc?rev=828044&view=rev
Log:
implemented removing lists from imageaddressspace  and replaced with queryresults

Modified:
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageAddressSpace.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageAddressSpaceImpl.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageAddressSpace.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.java.db/target/  
(props changed)
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
    incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageAddressSpace.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageAddressSpace.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageAddressSpace.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.api/src/main/java/javax/tools/diagnostics/image/ImageAddressSpace.java
Wed Oct 21 15:26:23 2009
@@ -16,7 +16,8 @@
  */
 package javax.tools.diagnostics.image;
 
-import java.util.List;
+
+import javax.tools.diagnostics.QueryResult;
 
 /**
  * This class represents a single Address Space within the image. 
@@ -37,13 +38,13 @@
     
     /**
      * Get the set of processes within the address space.
-     * @return an iterator which provides all of the processes
+     * @return an QueryResult which provides all of the processes
      * within a given address space. In most images, there will 
      * only be one process within an ImageAddressSpace
      * 
      * @see ImageProcess
      */
-    List<ImageProcess> getProcesses();
+    QueryResult<ImageProcess> getProcesses();
     
     /**
      * A factory method for creating pointers into this address space
@@ -55,8 +56,8 @@
     /**
      * Get the raw memory in the address space.
      * 
-     * @return An iterator of all the ImageSections in the address.  Their union will be
the total process address space
+     * @return A QueryResult of all the ImageSections in the address.  Their union will be
the total process address space
      * @see ImageSection
      */
-    List<ImageSection> getImageSections();
+    QueryResult<ImageSection> getImageSections();
 }

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.cjvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
Wed Oct 21 15:26:23 2009
@@ -139,8 +139,8 @@
 	}
 
 	@Override
-	public List<ImageSection> getImageSections() {
-		return new EmptyList<ImageSection>();
+	public QueryResult<ImageSection> getImageSections() {
+		return  new ListBackedQueryResult<ImageSection>(new EmptyList<ImageSection>());
 	}
 
 	@Override
@@ -149,8 +149,8 @@
 	}
 
 	@Override
-	public List<ImageProcess> getProcesses() {
-		return processes;
+	public QueryResult<ImageProcess> getProcesses() {
+		return new ListBackedQueryResult<ImageProcess>(  processes);
 	}
 
 	@Override

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageAddressSpaceImpl.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageAddressSpaceImpl.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageAddressSpaceImpl.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/main/java/org/apache/kato/hprof/image/ImageAddressSpaceImpl.java
Wed Oct 21 15:26:23 2009
@@ -16,9 +16,14 @@
 import java.util.LinkedList;
 import java.util.List;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.image.ImageAddressSpace;
 import javax.tools.diagnostics.image.ImagePointer;
 import javax.tools.diagnostics.image.ImageProcess;
+import javax.tools.diagnostics.image.ImageSection;
+
+import org.apache.kato.common.EmptyQueryResult;
+import org.apache.kato.common.ListBackedQueryResult;
 
 
 final public class ImageAddressSpaceImpl implements ImageAddressSpace {
@@ -46,10 +51,11 @@
 	}
 
 	@Override
-	public List getImageSections() {
+	public QueryResult<ImageSection> getImageSections() {
+		
+		
+		return new EmptyQueryResult<ImageSection>();
 		
-		List l=new LinkedList();
-		return l;
 	}
 
 	@Override
@@ -58,9 +64,9 @@
 	}
 
 	@Override
-	public List getProcesses() {
-		List l=new LinkedList();
+	public QueryResult<ImageProcess> getProcesses() {
+		List<ImageProcess> l=new LinkedList();
 		l.add(currentProcess);
-		return l;
+		return new ListBackedQueryResult<ImageProcess>(l);
 	}
 }
\ No newline at end of file

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageAddressSpace.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageAddressSpace.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageAddressSpace.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.hprof.api/src/test/java/test/apache/kato/hprof/image/TestImageAddressSpace.java
Wed Oct 21 15:26:23 2009
@@ -17,9 +17,11 @@
 import java.util.Iterator;
 import java.util.List;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.image.ImageAddressSpace;
 import javax.tools.diagnostics.image.ImagePointer;
 import javax.tools.diagnostics.image.ImageProcess;
+import javax.tools.diagnostics.image.ImageSection;
 
 
 public class TestImageAddressSpace extends AbstractHProfTestCase {
@@ -28,8 +30,9 @@
 	public void testGetImageSectionIterator() throws IOException {
 		
 		ImageAddressSpace space=getFirstAddressSpace();
-		List i=space.getImageSections();
-		assertNotNull(i);
+		QueryResult<ImageSection> sections=space.getImageSections();
+		assertNotNull(sections);
+		sections.dispose();
 		
 	}
 	
@@ -49,8 +52,9 @@
 	}
 	public void testGetProcessIterator() throws IOException {
 		ImageAddressSpace space=getFirstAddressSpace();
-		List i=space.getProcesses();
-		assertNotNull(i);
+		QueryResult<ImageProcess> processes=space.getProcesses();
+		assertNotNull(processes);
+		processes.dispose();
 		
 	}
 	

Propchange: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.java.db/target/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Wed Oct 21 15:26:23 2009
@@ -0,0 +1 @@
+classes

Modified: incubator/kato/branches/experimental/thirdview/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/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.jvmti/src/main/java/org/apache/kato/jvmti/process/ImageImpl.java
Wed Oct 21 15:26:23 2009
@@ -29,6 +29,7 @@
 import javax.tools.diagnostics.image.ImageModule;
 import javax.tools.diagnostics.image.ImagePointer;
 import javax.tools.diagnostics.image.ImageProcess;
+import javax.tools.diagnostics.image.ImageSection;
 import javax.tools.diagnostics.image.ImageThread;
 import javax.tools.diagnostics.runtime.ManagedRuntime;
 import javax.xml.parsers.ParserConfigurationException;
@@ -156,7 +157,7 @@
 		}
 
 		@Override
-		public List getImageSections() {
+		public QueryResult<ImageSection> getImageSections() {
 			// TODO Auto-generated method stub
 			return null;
 		}
@@ -168,9 +169,9 @@
 		}
 
 		@Override
-		public List getProcesses() {
+		public QueryResult<ImageProcess> getProcesses() {
 			fill();
-			return processes;
+			return new ListBackedQueryResult<ImageProcess>(processes);
 		}
 	}
 

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tck.testsuite/src/main/java/org/apache/kato/tests/junit/ImageAddressSpaceTest.java
Wed Oct 21 15:26:23 2009
@@ -13,11 +13,14 @@
  ******************************************************************************/
 package org.apache.kato.tests.junit;
 
+import java.io.IOException;
 import java.util.Iterator;
 import java.util.List;
 
+import javax.tools.diagnostics.QueryResult;
 import javax.tools.diagnostics.image.CorruptData;
 import javax.tools.diagnostics.image.ImageAddressSpace;
+import javax.tools.diagnostics.image.ImageProcess;
 import javax.tools.diagnostics.image.ImageSection;
 
 
@@ -43,12 +46,14 @@
 	 * Test method for 'javax.tools.diagnostics.image.ImageAddressSpace.getProcesses()'
 	 * 
 	 * Ensures that the process iterator is non-null and has at least one process
+	 * @throws IOException 
 	 */
-	public void testGetProcesses() {
-		List it = _space.getProcesses();
+	public void testGetProcesses() throws IOException {
+		QueryResult<ImageProcess> it = _space.getProcesses();
 		
 		assertNotNull(it);
 		assertFalse(it.isEmpty());
+		it.dispose();
 	}
 
 	/**

Modified: incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java
URL: http://svn.apache.org/viewvc/incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java?rev=828044&r1=828043&r2=828044&view=diff
==============================================================================
--- incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java
(original)
+++ incubator/kato/branches/experimental/thirdview/org.apache.kato/kato.tools.katoview/src/main/java/org/apache/kato/katoview/commands/helpers/KatoSearch.java
Wed Oct 21 15:26:23 2009
@@ -57,9 +57,9 @@
 			
 			ImageAddressSpace space = (ImageAddressSpace) nextSpace;
 			
-			List processes = space.getProcesses();
+			QueryResult<ImageProcess> processes = space.getProcesses();
 			
-			for (Object nextProcess : processes) {
+			for (ImageProcess nextProcess : processes) {
 				
 				if (nextProcess instanceof CorruptData) {
 					continue;
@@ -82,6 +82,12 @@
 					}
 				}
 			}
+			try {
+				processes.dispose();
+			} catch (IOException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
 		}
 		try {
 			spaces.dispose();



Mime
View raw message