org.eclipse.mat.dtfj
Class DTFJHeapObjectReader

java.lang.Object
  extended by org.eclipse.mat.dtfj.DTFJHeapObjectReader
All Implemented Interfaces:
IObjectReader

public class DTFJHeapObjectReader
extends Object
implements IObjectReader

Reads details of an object from a DTFJ dump.


Constructor Summary
DTFJHeapObjectReader()
           
 
Method Summary
 void close()
          tidy up when snapshot no longer required
<A> A
getAddon(Class<A> addon)
          Returns extra data to be provided by ISnapshot.getSnapshotAddons(Class addon).
 void open(ISnapshot snapshot)
          Open the dump file associated with the snapshot
 IObject read(int objectId, ISnapshot snapshot)
          Get detailed information about an object
 long[] readObjectArrayContent(ObjectArrayImpl array, int offset, int length)
          Read some of the contents of an array
 Object readPrimitiveArrayContent(PrimitiveArrayImpl array, int offset, int length)
          Read some of the contents of an array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DTFJHeapObjectReader

public DTFJHeapObjectReader()
Method Detail

close

public void close()
           throws IOException
Description copied from interface: IObjectReader
tidy up when snapshot no longer required

Specified by:
close in interface IObjectReader
Throws:
IOException

getAddon

public <A> A getAddon(Class<A> addon)
           throws SnapshotException
Returns extra data to be provided by ISnapshot.getSnapshotAddons(Class addon). Also can be returned via Argument.

Specified by:
getAddon in interface IObjectReader
Parameters:
addon - the type of the extra data required from the dump Types supported by DTFJHeapObjectReader include
  • com.ibm.dtfj.image.Image
  • com.ibm.dtfj.image.ImageAddressSpace
  • com.ibm.dtfj.image.ImageProcess
  • com.ibm.dtfj.java.JavaRuntime
  • com.ibm.dtfj.image.ImageFactory since 1.1
Returns:
the extra data
Throws:
SnapshotException
See Also:
IObjectReader.getAddon(Class)

open

public void open(ISnapshot snapshot)
          throws IOException
Description copied from interface: IObjectReader
Open the dump file associated with the snapshot

Specified by:
open in interface IObjectReader
Throws:
IOException

read

public IObject read(int objectId,
                    ISnapshot snapshot)
             throws SnapshotException,
                    IOException
Description copied from interface: IObjectReader
Get detailed information about an object

Specified by:
read in interface IObjectReader
Parameters:
objectId - the object id
snapshot - the snapshot
Returns:
an IObject such as InstanceImpl, ObjectArrayImpl, PrimitiveArrayImpl, ClassLoaderImpl
Throws:
SnapshotException
IOException

readPrimitiveArrayContent

public Object readPrimitiveArrayContent(PrimitiveArrayImpl array,
                                        int offset,
                                        int length)
                                 throws IOException,
                                        SnapshotException
Read some of the contents of an array

Specified by:
readPrimitiveArrayContent in interface IObjectReader
Parameters:
array - The MAT array to be read
offset - the offset into the array
length - the number of items to be read
Returns:
A primitive array holding the items
Throws:
IOException
SnapshotException

readObjectArrayContent

public long[] readObjectArrayContent(ObjectArrayImpl array,
                                     int offset,
                                     int length)
                              throws IOException,
                                     SnapshotException
Read some of the contents of an array

Specified by:
readObjectArrayContent in interface IObjectReader
Parameters:
array - The MAT array to be read
offset - the offset into the array
length - the number of items to be read
Returns:
A array of longs holding the addresses of the objects in the array
Throws:
IOException
SnapshotException