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 mo...@apache.org on 2009/05/07 14:50:35 UTC
svn commit: r772669 [4/7] - in /incubator/kato/trunk: HprofBinaryReaderPOC/
HprofBinaryReaderPOC/.settings/ HprofBinaryReaderPOC/META-INF/
HprofBinaryReaderPOC/bin/ HprofBinaryReaderPOC/bin/org/
HprofBinaryReaderPOC/bin/org/apache/ HprofBinaryReaderPOC...
Added: incubator/kato/trunk/HprofBinaryReaderPOC/src/org/apache/kato/hprof/datalayer/StaticFieldEntry.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/src/org/apache/kato/hprof/datalayer/StaticFieldEntry.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/src/org/apache/kato/hprof/datalayer/StaticFieldEntry.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/src/org/apache/kato/hprof/datalayer/StaticFieldEntry.java Thu May 7 14:50:21 2009
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.datalayer;
+
+/**
+ * Represents a static field in a class on the heap.
+ * Provides methods to retrieve its value.
+ */
+public class StaticFieldEntry extends FieldEntry {
+ public StaticFieldEntry(long fieldNameID, short type, long data) {
+ this.fieldNameID = fieldNameID;
+ this.type = type;
+ this.data = data;
+ }
+
+ /**
+ * The data. Fields are either ID's of objects or numbers,
+ * all should fit within a long.
+ */
+ private long data;
+
+ public long getData() {
+ return data;
+ }
+
+ public byte getByteField() {
+ return (byte) data;
+ }
+
+
+ public char getCharField() {
+ return (char) data;
+ }
+
+
+ public double getDoubleField() {
+ return Double.longBitsToDouble(data);
+ }
+
+
+ public float getFloatField() {
+ return Float.intBitsToFloat((int) data);
+ }
+
+
+ public long getIDField() {
+ return data;
+ }
+
+
+ public int getIntegerField() {
+ return (int)data;
+ }
+
+
+ public long getLongField() {
+ return data;
+ }
+
+
+ public short getShortField() {
+ return (short)data;
+ }
+
+ public boolean getBooleanField() {
+ return !(data == 0L);
+ }
+}
\ No newline at end of file
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/org/apache/kato/hprof/HProfViewTest.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/org/apache/kato/hprof/HProfViewTest.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/org/apache/kato/hprof/HProfViewTest.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/org/apache/kato/hprof/HProfViewTest.java Thu May 7 14:50:21 2009
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.Vector;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.hprof.datalayer.HProfFactory;
+import org.apache.kato.hprof.datalayer.HProfFile;
+
+public class HProfViewTest extends TestCase {
+ HProfFile file;
+ HProfView view;
+
+ public void setUp() throws Exception {
+ file = HProfFactory.createReader(new File("data/dumpall.hprof"));
+ view = new HProfView(file);
+ view.open(null);
+ }
+
+ public void testClassLoaders() {
+ Collection<IJavaClassLoader> loaders = view.getJavaClassLoaders();
+
+ for(IJavaClassLoader loader : loaders) {
+
+ System.out.println("\nloader = 0x"+Long.toHexString(loader.getID()));
+ System.out.println("==============================");
+
+ Collection<Long> classes = loader.getClasses();
+
+ for ( Long clazz : classes ) {
+ IJavaClass classObj = view.getJavaClassByID(clazz);
+
+ System.out.println("\t0x"+Long.toHexString(clazz)+ ": "+
+ Long.toHexString(classObj.getClassObjectID())+
+ " "+classObj.getClassName());
+ }
+ }
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/AllTests.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/AllTests.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/AllTests.java Thu May 7 14:50:21 2009
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * 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.apache.kato.common;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+public class AllTests {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite("Test for test.apache.kato.common");
+ //$JUnit-BEGIN$
+ suite.addTestSuite(TestBitMaskMappingArray.class);
+ suite.addTestSuite(TestSubsetDataProvider.class);
+ suite.addTestSuite(TestDataReader.class);
+ suite.addTestSuite(TestArrayCompactor.class);
+ suite.addTestSuite(TestArrayBitMaskMappingStrategy.class);
+ //$JUnit-END$
+ return suite;
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayBitMaskMappingStrategy.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayBitMaskMappingStrategy.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayBitMaskMappingStrategy.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayBitMaskMappingStrategy.java Thu May 7 14:50:21 2009
@@ -0,0 +1,279 @@
+package test.apache.kato.common;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.common.ArrayBitMaskMappingStrategy;
+
+public class TestArrayBitMaskMappingStrategy extends TestCase {
+
+
+
+ public void report(int arraySize,int elementNo1,int elementNo2) {
+
+
+ System.out.println("Array Size = "+arraySize);
+ System.out.println("Element Nos = "+elementNo1+","+elementNo2+" ("+Integer.toBinaryString(elementNo2));
+ int maxBitShift= (int) (31 - (Math.log10(arraySize)/Math.log10(2)))+1;
+ System.out.println("Maximum bit shift = "+maxBitShift);
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(arraySize,2);
+
+ int arrayIndex1 = c.getIndexArrayElement(elementNo1);
+ int seekCount1 = c.getSeekCount(elementNo1);
+
+ System.out.println("Array Index1 = "+arrayIndex1+" : "+seekCount1);
+
+ int arrayIndex2 = c.getIndexArrayElement(elementNo2);
+ int seekCount2 = c.getSeekCount(elementNo2);
+
+ System.out.println("Array Index2 = "+arrayIndex2+" : "+seekCount2);
+
+ int bitcount=(int) (Math.log10(elementNo2)/Math.log10(2))+1;
+ int max= ( 1 << bitcount ) -1;
+ System.out.println("Element2 bitcount = "+bitcount+" ( Max is "+max+")");
+ int newBucketSize=max/arraySize;
+ int bitcountBS=(int) (Math.log10(newBucketSize)/Math.log10(2))+1;
+ int maxBS= ( 1 << bitcountBS ) -1;
+ System.out.println("new bitcount = "+bitcountBS+" ( Max is "+maxBS+")");
+ System.out.println("new bucket size = "+maxBS+" ("+(maxBS*arraySize)+")("+Integer.toBinaryString(maxBS));
+
+
+ }
+
+
+
+ public void testArraySize1bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(8,c.getArraySize());
+
+
+ }
+
+ public void testBucketSize1bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(2,c.getBucketSize());
+
+ }
+ public void testArraySize5bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(8,c.getArraySize());
+
+
+ }
+
+ public void testBucketSize5bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(32,c.getBucketSize());
+
+ }
+
+ public void testGet0ElementFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(0,c.getIndexArrayElement(0));
+ assertEquals(0,c.getSeekCount(0));
+
+ }
+ public void testGet0ElementSeekCountFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(0,c.getSeekCount(0));
+
+ }
+
+ public void testGet1ElementFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(0,c.getIndexArrayElement(1));
+
+
+ }
+ public void testGet1ElementSeekFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(1,c.getSeekCount(1));
+
+ }
+
+ public void testGet3ElementFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(1,c.getIndexArrayElement(3));
+
+
+ }
+ public void testGet3ElementSeekFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(1,c.getSeekCount(3));
+
+ }
+
+ public void testGet15ElementFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(7,c.getIndexArrayElement(15));
+
+
+ }
+ public void testGet15ElementSeekFrom1Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ assertEquals(1,c.getSeekCount(15));
+
+ }
+
+
+ public void testGet0ElementFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(0,c.getIndexArrayElement(0));
+ assertEquals(0,c.getSeekCount(0));
+
+ }
+
+ public void testGet0ElementSeekCountFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(0,c.getSeekCount(0));
+
+ }
+
+ public void testGet1ElementFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(0,c.getIndexArrayElement(1));
+
+
+ }
+
+ public void testGet1ElementSeekFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(1,c.getSeekCount(1));
+
+ }
+
+ public void testGet3ElementFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(0,c.getIndexArrayElement(3));
+
+
+ }
+
+ public void testGet3ElementSeekFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(3,c.getSeekCount(3));
+
+ }
+
+ public void testGet64ElementFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(2,c.getIndexArrayElement(64));
+
+
+ }
+
+ public void testGet64ElementSeekFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(0,c.getSeekCount(64));
+
+ }
+
+ public void testGet500ElementFrom5Bit() {
+
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ assertEquals(-1,c.getIndexArrayElement(500));
+
+ }
+
+ public void testDoubleCapacityReturnsObject() {
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ ArrayBitMaskMappingStrategy newStrategy=c.doubleCapacity();
+ assertNotNull(newStrategy);
+ }
+ public void testDoubleCapacityReturnsNull() {
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,(Integer.MAX_VALUE/2)+50);
+ ArrayBitMaskMappingStrategy newStrategy=c.doubleCapacity();
+ assertNull(newStrategy);
+ }
+ public void testDoubleCapacityArraySize() {
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ ArrayBitMaskMappingStrategy newStrategy=c.doubleCapacity();
+ assertEquals(8,newStrategy.getArraySize());
+
+
+ }
+ public void testDoubleCapacityBucketSize() {
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,30);
+ ArrayBitMaskMappingStrategy newStrategy=c.doubleCapacity();
+ assertEquals(64,newStrategy.getBucketSize());
+
+ }
+ public void testSmallArrayMapping1Bit() {
+
+ int[] data=new int[8];
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ for(int i=0;i<16;i++) {
+ int location=c.getIndexArrayElement(i);
+ int seek=c.getSeekCount(i);
+ if(seek==0) data[location]=i;
+ }
+
+ assertEquals(0,data[0]);
+ assertEquals(2,data[1]);
+ assertEquals(4,data[2]);
+ assertEquals(6,data[3]);
+ assertEquals(8,data[4]);
+ assertEquals(10,data[5]);
+ assertEquals(12,data[6]);
+ assertEquals(14,data[7]);
+
+
+
+ }
+
+
+ public void testSmallArrayDoubling1Bit() {
+
+ int[] data=new int[8];
+ ArrayBitMaskMappingStrategy c=new ArrayBitMaskMappingStrategy(8,2);
+ for(int i=0;i<16;i++) {
+ int location=c.getIndexArrayElement(i);
+ int seek=c.getSeekCount(i);
+ if(seek==0) data[location]=i;
+ }
+
+ c=c.doubleCapacity();
+
+ for(int i=0;i<16;i++) {
+ int location=c.getIndexArrayElement(i);
+ int seek=c.getSeekCount(i);
+ if(seek==0) {
+ assertEquals(data[location]*2,i);
+ }
+ }
+
+
+
+ }
+
+ public void printWible() {
+
+ for(int i=2;i<32;i++) {
+ int bitshift=(int) (Math.log10(i-1)/Math.log10(2));
+ int shifted= 1 << bitshift;
+ int mask = (1 << (bitshift+1))-1;
+ int max = mask+1;
+ System.out.println(""+i+"("+max+")="+bitshift+" "+Integer.toBinaryString(i)+" "+Integer.toBinaryString(shifted)+ " "+Integer.toBinaryString(mask));
+ }
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayCompactor.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayCompactor.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayCompactor.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestArrayCompactor.java Thu May 7 14:50:21 2009
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.apache.kato.common;
+
+import org.apache.kato.common.ArrayCompactor;
+
+import junit.framework.TestCase;
+
+public class TestArrayCompactor extends TestCase {
+
+
+ public void testCompactArray() {
+
+ long[] array=new long[]{100,50,45,30,56,90,89,2,0,0,0 };
+ int last=7;
+ long[] results=new long[]{100,45,56,89,56,90,89,2,0,0,0 };
+ int expectedLast=3;
+
+ int result=ArrayCompactor.compact(array, last);
+ assertEquals(expectedLast,result);
+
+ for(int i=0;i<results.length;i++) {
+ assertEquals("Element "+i,results[i],array[i]);
+ }
+
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestBitMaskMappingArray.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestBitMaskMappingArray.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestBitMaskMappingArray.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestBitMaskMappingArray.java Thu May 7 14:50:21 2009
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * 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.apache.kato.common;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.common.BitMaskMappingArray;
+import org.apache.kato.common.IArrayEntryProvider;
+
+public class TestBitMaskMappingArray extends TestCase{
+
+
+ public void testCreation() {
+
+ BitMaskMappingArray array=new BitMaskMappingArray(8,2,null);
+ }
+
+ public void testSingleSpanSeek() {
+ BitMaskMappingArray array=new BitMaskMappingArray(8,2,new MockArrayEntryProvider());
+
+ for(int i=0;i<8;i++) {
+ Long l=(Long) array.get(i);
+ assertEquals(i,l.intValue());
+ }
+ }
+
+ public void testDoubleSpanSeek() {
+ BitMaskMappingArray array=new BitMaskMappingArray(8,2,new MockArrayEntryProvider());
+
+ for(int i=9;i<24;i++) {
+ Long l=(Long) array.get(i);
+ assertEquals(i,l.intValue());
+ }
+ }
+
+ public void testLargeSpanSeek() {
+ BitMaskMappingArray array=new BitMaskMappingArray(8,2,new MockArrayEntryProvider());
+
+ Long l=(Long) array.get(100);
+ assertEquals(100,l.intValue());
+
+ l=(Long) array.get(1000);
+ assertEquals(1000,l.intValue());
+
+
+
+ }
+ class MockArrayEntryProvider implements IArrayEntryProvider {
+
+ long location=0;
+ @Override
+ public Object getCurrentElement() {
+
+ return new Long(location);
+ }
+
+ @Override
+ public boolean moveRelativeElement(int seekNo) {
+ location+=seekNo;
+ return true;
+ }
+
+ @Override
+ public boolean moveToLocation(long l) {
+ location=l;
+ return true;
+ }
+
+ @Override
+ public long getCurrentLocation() {
+
+ return location;
+ }
+
+ @Override
+ public void getState(List state) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestDataReader.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestDataReader.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestDataReader.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestDataReader.java Thu May 7 14:50:21 2009
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.apache.kato.common;
+
+import org.apache.kato.common.DataReader;
+
+import junit.framework.TestCase;
+
+public class TestDataReader extends TestCase {
+
+
+ public void testReadInt1() {
+
+ byte[] data=new byte[]{0,0,0,0};
+
+ assertEquals(0,DataReader.read4Bytes(data));
+ }
+
+ public void testReadInt2() {
+
+ byte[] data=new byte[]{0,0,0,1};
+
+ assertEquals(1,DataReader.read4Bytes(data));
+ }
+ public void testReadInt3() {
+
+ byte[] data=new byte[]{0,0,(byte)2,(byte) 0};
+
+ assertEquals(512,DataReader.read4Bytes(data));
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestSubsetDataProvider.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestSubsetDataProvider.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestSubsetDataProvider.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/common/TestSubsetDataProvider.java Thu May 7 14:50:21 2009
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * 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.apache.kato.common;
+
+import java.io.IOException;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.common.IDataProvider;
+import org.apache.kato.common.SubsetDataProvider;
+
+public class TestSubsetDataProvider extends TestCase {
+
+
+ public void testCreationNullProvider() throws IOException {
+
+ try {
+ new SubsetDataProvider(null,0);
+ fail("Expected illegal arguement exception");
+ }
+ catch (IllegalArgumentException e) {
+ ; // ok
+ }
+
+ }
+ public void testCreationNegativeRange() throws IOException {
+
+ try {
+ new SubsetDataProvider(new MockDataProvider(),-1);
+ fail("Expected illegal arguement exception");
+ }
+ catch (IllegalArgumentException e) {
+ ; // ok
+ }
+
+ }
+ public void testGetDataAt00() throws IOException {
+
+ SubsetDataProvider provider=new SubsetDataProvider(new MockDataProvider(),10);
+ short b=provider.readByte();
+ assertEquals(0,b);
+
+ }
+ public void testGetDataAt01() throws IOException {
+
+ MockDataProvider p=new MockDataProvider();
+ p.moveTo(1);
+ SubsetDataProvider provider=new SubsetDataProvider(p,10);
+ short b=provider.readByte();
+ assertEquals(1,b);
+
+ }
+
+
+ class MockDataProvider implements IDataProvider {
+
+ private long location=0;
+ private long length=100;
+
+ public MockDataProvider() {
+
+ }
+ public MockDataProvider(int length) {
+ this.length=length;
+ }
+ @Override
+ public void addState(List state) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+
+ @Override
+ public void close() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public long getCurrentLocation() throws IOException {
+
+ return location;
+ }
+
+ @Override
+ public long getDataLength() throws IOException {
+
+ return length;
+ }
+
+ @Override
+ public void moveBy(int left) throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void moveTo(long l) throws IOException {
+ this.location=l;
+
+ }
+
+ @Override
+ public void open() throws IOException {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public short readByte() throws IOException {
+
+ return (short) location;
+ }
+
+ @Override
+ public byte[] readBytes(int left) throws IOException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String readCString() throws IOException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public short readU2() throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public int readU4() throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ @Override
+ public long readU8() throws IOException {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+ @Override
+ public long dataRemaining() {
+ // TODO Auto-generated method stub
+ return 0;
+ }
+
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestHProf.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestHProf.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestHProf.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestHProf.java Thu May 7 14:50:21 2009
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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.apache.kato.hprof;
+
+import java.io.File;
+import java.io.IOException;
+
+import junit.framework.TestCase;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.apache.kato.hprof.datalayer.HProfFactory;
+import org.apache.kato.hprof.datalayer.IHProfRecord;
+
+public class TestHProf extends TestCase {
+
+
+ private static final String DUMP = "/home/spoole/workspace/HprofBinaryReaderPOC/data/java.hprof";
+ public void testHeader() throws IOException {
+
+ File dump=new File(DUMP);
+ HProfFile h=HProfFactory.createReader(dump);
+
+ h.open();
+
+ String header=h.getHeader();
+ int idSize=h.getIdentifierSize();
+ long timeStamp=h.getTimeStamp();
+
+ IHProfRecord record=h.getRecord(0);
+ assertNotNull(record);
+
+ System.out.println("tag="+Integer.toHexString(record.getTag()));
+ h.close();
+
+ }
+ public void testRead() throws IOException {
+
+ File dump=new File(DUMP);
+ HProfFile h=HProfFactory.createReader(dump);
+
+ h.open();
+ int records=h.getRecordCount();
+ h.close();
+ assertEquals(1525,records);
+
+
+ }
+ public void testReadTwice() throws IOException {
+
+ File dump=new File(DUMP);
+ HProfFile h=HProfFactory.createReader(dump);
+
+ h.open();
+ int records=h.getRecordCount();
+ for(int i=0;i<records;i++) {
+ Object o=h.getRecord(i);
+ assertNotNull("element "+i+" is null",o);
+ }
+ h.close();
+
+
+
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestSetup.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestSetup.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestSetup.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOC/testsrc/test/apache/kato/hprof/TestSetup.java Thu May 7 14:50:21 2009
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.apache.kato.hprof;
+
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+
+// -XX:+HeapDumpOnOutOfMemoryError
+
+
+public class TestSetup {
+
+ private static Object root=null;
+ /**
+ * @param args
+ */
+ public static void main(String[] args) {
+
+
+ List list=new LinkedList();
+ root=list;
+ while(true) {
+ list.add(new byte[100000]);
+ }
+
+
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/.settings/org.eclipse.jdt.core.prefs?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/.settings/org.eclipse.jdt.core.prefs (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/.settings/org.eclipse.jdt.core.prefs Thu May 7 14:50:21 2009
@@ -0,0 +1,7 @@
+#Tue Feb 17 12:07:45 GMT 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/META-INF/MANIFEST.MF?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/META-INF/MANIFEST.MF (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/META-INF/MANIFEST.MF Thu May 7 14:50:21 2009
@@ -0,0 +1,15 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Hprof binary format reader Ui Plug-in
+Bundle-SymbolicName: HprofBinaryReaderPOCUI;singleton:=true
+Bundle-Version: 0.0.1.qualifier
+Bundle-Activator: org.apache.kato.hprof.ui.Activator
+Bundle-Vendor: Apache Software Foundation
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ HprofBinaryReaderPOC;bundle-version="1.0.0",
+ org.eclipse.ui.ide,
+ org.eclipse.jface.text,
+ org.eclipse.ui.editors
+Bundle-ActivationPolicy: lazy
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/Activator.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/Activator.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/Activator.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/DumpEditorInput.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/DumpEditorInput.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/DumpEditorInput.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/ExploreHProfFileAction.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/ExploreHProfFileAction.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/ExploreHProfFileAction.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfRecordHandle.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfRecordHandle.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfRecordHandle.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfRecordPropertySource.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfRecordPropertySource.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfRecordPropertySource.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfSource.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfSource.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfSource.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfSubRecordHandle.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfSubRecordHandle.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfSubRecordHandle.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer$1$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer%241%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer$1$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/editors/DumpViewer.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HProfRecordPropertySourceFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HProfRecordPropertySourceFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HProfRecordPropertySourceFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HeapDumpsRecordViewerFactory$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HeapDumpsRecordViewerFactory%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HeapDumpsRecordViewerFactory$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HeapDumpsRecordViewerFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HeapDumpsRecordViewerFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/HeapDumpsRecordViewerFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedClassesViewerFactory$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedClassesViewerFactory%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedClassesViewerFactory$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedClassesViewerFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedClassesViewerFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedClassesViewerFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$2.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory%242.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$2.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$3.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory%243.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$3.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$4.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory%244.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$4.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$5.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory%245.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory$5.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/LoadedThreadsViewerFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory$2.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory%242.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory$2.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/RecordsViewerFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$2.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory%242.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$2.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$3.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory%243.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$3.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$4.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory%244.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$4.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$5.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory%245.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory$5.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/StackTraceViewerFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/UTF8RecordsViewerFactory$1.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/UTF8RecordsViewerFactory%241.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/UTF8RecordsViewerFactory$1.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/UTF8RecordsViewerFactory.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/UTF8RecordsViewerFactory.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/factory/UTF8RecordsViewerFactory.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/popup/actions/NewAction.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/popup/actions/NewAction.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/popup/actions/NewAction.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/propertysource/GCClassHeapDumpRecordPropertySource$ConstantPoolEntryPropertySource.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/propertysource/GCClassHeapDumpRecordPropertySource%24ConstantPoolEntryPropertySource.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/propertysource/GCClassHeapDumpRecordPropertySource$ConstantPoolEntryPropertySource.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/propertysource/GCClassHeapDumpRecordPropertySource.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/propertysource/GCClassHeapDumpRecordPropertySource.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/propertysource/GCClassHeapDumpRecordPropertySource.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/AbstractHProfLazyContentProvider.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/AbstractHProfLazyContentProvider.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/AbstractHProfLazyContentProvider.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/AbstractHProfViewLabelProvider.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/AbstractHProfViewLabelProvider.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/AbstractHProfViewLabelProvider.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/HeapDumpRecordLabelProvider.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/HeapDumpRecordLabelProvider.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/HeapDumpRecordLabelProvider.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/StringArrayLabelProvider.class
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/StringArrayLabelProvider.class?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/bin/org/apache/kato/hprof/ui/provider/StringArrayLabelProvider.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/icons/sample.gif
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/icons/sample.gif?rev=772669&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/kato/trunk/HprofBinaryReaderPOCUI/icons/sample.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/plugin.xml?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/plugin.xml (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/plugin.xml Thu May 7 14:50:21 2009
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.popupMenus">
+ <objectContribution
+ objectClass="org.eclipse.core.resources.IFile"
+ id="org.apache.kato.hprof.contribution1">
+ <menu
+ label="HProf"
+ path="additions"
+ id="org.apache.kato.hprof.menu1">
+ <separator
+ name="group1">
+ </separator>
+ </menu>
+ <action
+ label="Explore HProf Dump"
+ class="org.apache.kato.hprof.ui.ExploreHProfFileAction"
+ menubarPath="org.apache.kato.hprof.ui.menu1/group1"
+ enablesFor="1"
+ id="org.apache.kato.hprof.ui.ExploreHProfFileAction">
+ </action>
+ </objectContribution>
+ </extension>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.apache.kato.hprof.ui.editors.DumpViewer"
+ contributorClass="org.eclipse.ui.texteditor.BasicTextEditorActionContributor"
+ extensions="hprof"
+ icon="icons/bomb.png"
+ id="org.apache.kato.hprof.ui.editors.DumpViewer"
+ name="HProf Dump Viewer">
+ </editor>
+ </extension>
+ <extension
+ point="org.eclipse.ui.views">
+ <category
+ id="HprofBinaryReaderPOCUI"
+ name="HProf Binary Reader">
+ </category>
+ </extension>
+</plugin>
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/Activator.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/Activator.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/Activator.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/Activator.java Thu May 7 14:50:21 2009
@@ -0,0 +1,105 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.apache.kato.hprof.datalayer.HProfFactory;
+import org.eclipse.core.runtime.IAdapterManager;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.ui.views.properties.IPropertySource;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.apache.kato.hprof.ui";
+
+ // The shared instance
+ private static Activator plugin;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+
+ final IAdapterManager manager = Platform.getAdapterManager();
+
+ manager.registerAdapters(new HPRofEntityPropertySourceAdapter(),IPropertySource.class);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns an image descriptor for the image file at the given
+ * plug-in relative path
+ *
+ * @param path the path
+ * @return the image descriptor
+ */
+ public static ImageDescriptor getImageDescriptor(String path) {
+ return imageDescriptorFromPlugin(PLUGIN_ID, path);
+ }
+
+ public void load(IProgressMonitor pm, File file) {
+
+
+ }
+
+ public void load(IProgressMonitor pm, HProfSource source) {
+ HProfFile converter=null;
+ try {
+ converter = HProfFactory.createReader(source.getFile());
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ source.setDump(converter);
+ }
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/DumpEditorInput.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/DumpEditorInput.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/DumpEditorInput.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/DumpEditorInput.java Thu May 7 14:50:21 2009
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IPersistableElement;
+
+public class DumpEditorInput implements IEditorInput {
+
+ private HProfSource source=null;
+
+ public DumpEditorInput(HProfSource converter) {
+ this.source = converter;
+ }
+
+ @Override
+ public boolean exists() {
+
+ return false;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getName() {
+
+ return source.getName();
+ }
+
+ @Override
+ public IPersistableElement getPersistable() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getToolTipText() {
+
+ return "HProf Dump";
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public HProfSource getSource() {
+ return source;
+ }
+
+
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/ExploreHProfFileAction.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/ExploreHProfFileAction.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/ExploreHProfFileAction.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/ExploreHProfFileAction.java Thu May 7 14:50:21 2009
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.apache.kato.hprof.datalayer.HProfFactory;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IObjectActionDelegate;
+import org.eclipse.ui.IWorkbenchPart;
+
+public class ExploreHProfFileAction implements IObjectActionDelegate{
+
+ private IFile file=null;
+ @Override
+ public void setActivePart(IAction action, IWorkbenchPart targetPart) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void run(IAction action) {
+ if(file==null) return;
+ File realFile=new File(file.getFullPath().toString());
+ HProfFile hprof;
+ try {
+ hprof = HProfFactory.createReader(realFile);
+ } catch (IOException e) {
+ e.printStackTrace();
+ hprof=null;
+ }
+ if(hprof==null) {
+ Shell shell = new Shell();
+ MessageDialog.openInformation(
+ shell,
+ "HPRof Viewer Plug-in",
+ ""+realFile+" is not an hprof file");
+
+ }
+
+
+
+ }
+
+ @Override
+ public void selectionChanged(IAction action, ISelection selection) {
+ if(selection==null) file=null;
+ else {
+ if(selection instanceof IStructuredSelection) {
+ IStructuredSelection ss=(IStructuredSelection) selection;
+ Object top=ss.getFirstElement();
+ if(top instanceof IFile) {
+ file=(IFile) top;
+ }
+
+ }
+ }
+
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HPRofEntityPropertySourceAdapter.java Thu May 7 14:50:21 2009
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import java.util.Properties;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.apache.kato.hprof.datalayer.IUTF8HProfRecord;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
+import org.eclipse.ui.progress.IElementCollector;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class HPRofEntityPropertySourceAdapter implements IAdapterFactory{
+
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+
+ System.out.println("called for "+adaptableObject.getClass()+" "+adapterType);
+ if(adaptableObject==null) return null; // belt and braces
+
+ if(adaptableObject instanceof HProfFile) {
+ HProfFile hp=(HProfFile) adaptableObject;
+ return toProperty(hp);
+ }
+ if(adaptableObject instanceof IUTF8HProfRecord) {
+ return toProperty((IUTF8HProfRecord)adaptableObject);
+ }
+ return null;
+ }
+
+ private Object toProperty(IUTF8HProfRecord adaptableObject) {
+ Properties p=new Properties();
+ p.put("characters",adaptableObject.getCharacters());
+ p.put("value",adaptableObject.getAsString());
+ return p;
+ }
+
+ private Object toProperty(HProfFile hp) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Class[] getAdapterList() {
+ return new Class[]{IPropertySource.class};
+ }
+
+
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfEntityPropertySourceAdapterFactory.java Thu May 7 14:50:21 2009
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.eclipse.core.runtime.IAdapterFactory;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class HProfEntityPropertySourceAdapterFactory implements IAdapterFactory{
+
+ @Override
+ public Object getAdapter(Object adaptableObject, Class adapterType) {
+
+ System.out.println("handle.."+adaptableObject);
+ if(adaptableObject==null) return null; // belt and braces
+
+ if(adaptableObject instanceof HProfFile) {
+ HProfFile hp=(HProfFile) adaptableObject;
+ return hp.getHeader();
+ }
+ return null;
+ }
+
+ @Override
+ public Class[] getAdapterList() {
+ return new Class[]{IWorkbenchAdapter.class};
+ }
+
+
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordHandle.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordHandle.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordHandle.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordHandle.java Thu May 7 14:50:21 2009
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import org.apache.kato.hprof.HProfView;
+import org.apache.kato.hprof.datalayer.IHProfRecord;
+import org.apache.kato.hprof.datalayer.HProfFile.GCClassHeapDumpRecord;
+import org.apache.kato.hprof.ui.propertysource.GCClassHeapDumpRecordPropertySource;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class HProfRecordHandle implements IAdaptable{
+
+ private HProfView view=null;
+
+ public HProfRecordHandle(int index,HProfView view) {
+ this.recordNumber=index;
+ this.view=view;
+ }
+
+ public int recordNumber=0;
+
+ public IHProfRecord getRecord() {
+ return view.getFile().getRecord(recordNumber);
+ }
+
+ public long getRecordLocation() {
+ return view.getFile().getRecordLocation(recordNumber);
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+
+
+ return null;
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordPropertySource.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordPropertySource.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordPropertySource.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfRecordPropertySource.java Thu May 7 14:50:21 2009
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class HProfRecordPropertySource implements IPropertySource {
+
+ private HProfRecordHandle handle=null;
+ public HProfRecordPropertySource(HProfRecordHandle profRecordHandle) {
+ this.handle=profRecordHandle;
+ }
+
+ @Override
+ public Object getEditableValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IPropertyDescriptor[] getPropertyDescriptors() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getPropertyValue(Object id) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public boolean isPropertySet(Object id) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ @Override
+ public void resetPropertyValue(Object id) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void setPropertyValue(Object id, Object value) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSource.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSource.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSource.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSource.java Thu May 7 14:50:21 2009
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import java.io.File;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+
+public class HProfSource {
+
+ public HProfSource(File file) {
+ this.file=file;
+ }
+ private File file=null;
+ private HProfFile dump=null;
+ public File getFile() {
+
+ return file;
+ }
+ public HProfFile getDump() {
+ return dump;
+ }
+ public void setDump(HProfFile dump) {
+ this.dump = dump;
+ }
+ public String getName() {
+
+ return file.getAbsolutePath();
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSubRecordHandle.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSubRecordHandle.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSubRecordHandle.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfSubRecordHandle.java Thu May 7 14:50:21 2009
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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 org.apache.kato.hprof.ui;
+
+import org.apache.kato.hprof.datalayer.IHProfRecord;
+import org.apache.kato.hprof.datalayer.IHeapDumpHProfRecord;
+import org.apache.kato.hprof.ui.factory.HProfRecordPropertySourceFactory;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.views.properties.IPropertySource;
+
+public class HProfSubRecordHandle implements IAdaptable {
+
+ private IHeapDumpHProfRecord dumprecord = null;
+
+ public HProfSubRecordHandle(int index, IHeapDumpHProfRecord rec) {
+ this.recordNumber = index;
+ this.dumprecord = rec;
+ }
+
+ public int recordNumber = 0;
+
+ public IHProfRecord getRecord() {
+ return dumprecord.getSubRecord(recordNumber);
+ }
+
+ public long getRecordLocation() {
+ return dumprecord.getSubRecordLocation(recordNumber);
+ }
+
+ @Override
+ public Object getAdapter(Class adapter) {
+
+
+
+ if (IPropertySource.class.isAssignableFrom(adapter)) {
+
+ IHProfRecord record = getRecord();
+ return HProfRecordPropertySourceFactory.createPropertySource(
+ dumprecord, recordNumber, getRecord());
+ }
+
+ if(adapter == Long.class) {
+ return (Long)getRecordLocation();
+ }
+ return null;
+ }
+
+}
Added: incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.java
URL: http://svn.apache.org/viewvc/incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.java?rev=772669&view=auto
==============================================================================
--- incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.java (added)
+++ incubator/kato/trunk/HprofBinaryReaderPOCUI/src/org/apache/kato/hprof/ui/HProfWorkbenchAdapter.java Thu May 7 14:50:21 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 org.apache.kato.hprof.ui;
+
+import org.apache.kato.hprof.datalayer.HProfFile;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.ui.model.IWorkbenchAdapter;
+
+public class HProfWorkbenchAdapter implements IWorkbenchAdapter {
+
+ private HProfFile base=null;
+
+ public HProfWorkbenchAdapter(HProfFile obj) {
+ this.base=null;
+ }
+ @Override
+ public Object[] getChildren(Object o) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public ImageDescriptor getImageDescriptor(Object object) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public String getLabel(Object o) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Object getParent(Object o) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}