FileDocCategorySizeDatePackage
MPDataProvider.javaAPI DocphoneME MR2 API (J2ME)9226Wed May 02 17:59:48 BST 2007com.sun.cldchi.tools.memoryprofiler.data

MPDataProvider

public interface MPDataProvider
The MPDataProvider declares interface which provides data for data-displaying GUI tool. For work it requires some implementation of VMConnection. The implementation of this interface is provided by MPDataProviderFactory. To work with this interface you should firstly obtain its realization from MPDataProviderFactory, passing it an instance of VMConnection. After this you should connect to a KDP running on hostName:port by calling connect(String hostName, int port) To control VM execution use pauseVM() and resumeVM() funtions. * All other functions provide processed information.
see
com.sun.cldchi.tools.memoryprofiler.data.MPDataProviderFactory
see
com.sun.cldchi.tools.memoryprofiler.jdwp.VMConnection

Fields Summary
public static final int
JAVA_OBJECT
public static final int
STATICS_OBJECT
public static final int
STACK_OBJECT
public static final int
VM_OBJECT
Constructors Summary
Methods Summary
public ClassStatistics[]calculateStatistics()
Returns statistics of memory usage for each class in the VM. There is separate ClassStatistics object int the returned array for each class. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
array of ClassStatistics.
see
#connect(String hostName, int port)

public voidcloseConnections()
Disconnects from the KDP. Does nothing if not connected.

public voidconnect(java.lang.String hostName, int port)
Connects to the KDP running on hostName:port using VMConnection, which should be set before by setConnector(VMConnection connector) call. It will throw java.net.ConnectException unless connection is successful.

param
hostName - name of host where KDP runs
param
port - number of port where KDP listens
see
#closeConnections()

public JavaClass[]getClassList()
Returns list of all classes in systems. All objects in array are JavaClass The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
array of JavaClass
see
#connect(String hostName, int port)

public java.lang.StringgetObjectTypeName(JavaObject obj)
Returns name of the type of the object. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

param
obj
return
name of the type of the object.
see
#connect(String hostName, int port)

public java.util.IteratorgetObjects()
Returns all objects. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
all objects. Iterator returns instances of JavaObject
see
#connect(String hostName, int port)

public JavaObject[]getObjectsFromTheAddresses(int start, int end)
Returns array JavaObjects, sorted by address from given memory block. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

param
start - start address of the zone in heap
param
end - end address of the zone in heap
return
array JavaObjects, sorted by address from given memory block.
see
#connect(String hostName, int port)

public JavaObject[]getObjectsOfClass(JavaClass jc)
Returns all objects with given extended class id. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

param
jc - class which objects you want to find.
return
all objects with given extended class id.
see
#connect(String hostName, int port)

public java.lang.StringgetStackTrace(JavaObject stackObject, int ptrAddress)
Returns stacktrace of an address on java stack The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

param
stackObject - JavaObject of stack type
param
ptrAddress - address of the pointer on stack
return
String.
see
#connect(String hostName, int port)

public intget_allocation_top()
Returns value of _old_generation_end global varaible, which is address where old generation of heap objects ends. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
value of _old_generation_end global varaible
see
#connect(String hostName, int port)

public intget_heap_start()
Returns value of _heap_start global varaible, which is address where VM heap starts. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
value of _heap_start global varaible
see
#connect(String hostName, int port)

public intget_heap_top()
Returns value of _heap_top global varaible, which is address where VM heap ends. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
value of _heap_top global varaible
see
#connect(String hostName, int port)

public intget_old_gen_end()
Returns value of _old_generation_end global varaible, which is address where old generation of heap objects ends. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

return
value of _old_generation_end global varaible
see
#connect(String hostName, int port)

public JavaObject[]pathFromTheRoot(JavaObject obj)
Returns array of linked JavaObjects, where first one is a root object and last one is the parameter. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

param
obj
return
array of linked JavaObjects, where first one is a root object and last one is the parameter.
see
#connect(String hostName, int port)

public voidpauseVM()
Pauses the VM execution. The provider must be connected to a kdp, see interface description. The function will throw SocketException unless communication with VM is successful

see
#connect(String hostName, int port)

public voidresumeVM()
Resumes the VM execution. The provider must be connected to a KDP, see interface description. The function will throw SocketException unless communication with VM is successful

see
#connect(String hostName, int port)