Update of /cvsroot/javaprofiler/test/module
In directory usw-pr-cvs1:/tmp/cvs-serv6757
Modified Files:
TestAllocHistView.java
Log Message:
realtime
Index: TestAllocHistView.java
===================================================================
RCS file: /cvsroot/javaprofiler/test/module/TestAllocHistView.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** TestAllocHistView.java 22 Jul 2002 00:20:58 -0000 1.1
--- TestAllocHistView.java 22 Jul 2002 17:52:48 -0000 1.2
***************
*** 39,44 ****
JFrame frame;
! //RefreshThread refreshTread;
!
/** Creates a new instance of TestAllocHistView */
public TestAllocHistView() {
--- 39,44 ----
JFrame frame;
! RefreshThread refreshThread;
!
/** Creates a new instance of TestAllocHistView */
public TestAllocHistView() {
***************
*** 46,56 ****
VirtualMachineRef vm = connect();
! //FIXME WARNING depends on iplementation
! image = (VirtualMachineImageRef) vm;
! ((net.sourceforge.javaprofiler.jpiimpl.realtime.ImageR)
! ((net.sourceforge.javaprofiler.jpiimpl.VirtualMachineImpl) vm).
! getRealtimeImage() ).refreshTypes();
!
//image = getSnapshot(vm);
--- 46,54 ----
VirtualMachineRef vm = connect();
! image = vm.getRealtimeImage();
! ((net.sourceforge.javaprofiler.jpiimpl.realtime.ImageR) image).
! refreshTypes();
! refreshThread = new RefreshThread();
//image = getSnapshot(vm);
***************
*** 72,79 ****
//System.err.println( e.getMessage() );
//e.printStackTrace();
! throw new RuntimeException( "Error in connecting to profiled machine: " + e.getMessage() );
}
}
private Snapshot getSnapshot( VirtualMachineRef vm ) {
--- 70,92 ----
//System.err.println( e.getMessage() );
//e.printStackTrace();
! throw new RuntimeException( "Error in connecting to profiled machine: " + e.getMessage() );
}
}
+ private class RefreshThread extends Thread {
+ java.util.List types;
+ public RefreshThread() {
+ types = image.getTypes();
+ }
+ public void run () {
+ ((net.sourceforge.javaprofiler.jpiimpl.realtime.ImageR) image).
+ refreshTypes();
+ try {
+ sleep(1000);
+ }
+ catch ( InterruptedException e ) {
+ }
+ }
+ }
private Snapshot getSnapshot( VirtualMachineRef vm ) {
***************
*** 122,125 ****
--- 135,139 ----
public void show() {
+ refreshThread.start();
//frame.pack();
frame.show();
***************
*** 135,139 ****
}
-
- //TODO
- //refreshing thread
\ No newline at end of file
--- 149,150 ----
|