From: Pavel V. <va...@us...> - 2002-07-22 17:51:33
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl In directory usw-pr-cvs1:/tmp/cvs-serv6334 Modified Files: VirtualMachineImpl.java Log Message: realtime via getRealtimeImage() method, it no longer implements VirtualMachineImageRef Index: VirtualMachineImpl.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/VirtualMachineImpl.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** VirtualMachineImpl.java 22 Jul 2002 00:17:29 -0000 1.9 --- VirtualMachineImpl.java 22 Jul 2002 17:51:30 -0000 1.10 *************** *** 39,43 **** private Process process=null; ! private VirtualMachineImageRef realtime=null; /** --- 39,43 ---- private Process process=null; ! private VirtualMachineImageRef realtime=null; /** *************** *** 80,83 **** --- 80,84 ---- } catch (UNAVAILABLE_Exception e) { //PENDING + throw new RuntimeException("TODO: handle this: \"Enabling of Garbage Collection is unavailable\"" + e.getMessage()); } } *************** *** 95,106 **** /** ! * Creates the snapshot of the current profiling information about the mirrored * virtual machine. */ public Snapshot createSnapshot() { ! //pending: to pass configuration ! //pending: if not_suspendedVM then suspendVM and resumeVM suspendThreads(); - //FIXME SnapshotImpl snap = new SnapshotImpl( iprof ); resumeThreads(); --- 96,106 ---- /** ! * Creates the snapshot of the current profiling information in the * virtual machine. */ public Snapshot createSnapshot() { ! //PENDING: to pass configuration ! //PENDING: if not_suspendedVM then suspendVM and resumeVM suspendThreads(); SnapshotImpl snap = new SnapshotImpl( iprof ); resumeThreads(); *************** *** 108,111 **** --- 108,115 ---- } + /** + * Creates the snapshot of the current profiling information in the + * virtual machine. + */ public Snapshot createSnapshot(Snapshot.Configuration conf) { //PENDING: TO PASS CONFIGURATION *************** *** 125,129 **** */ public void exit(int exitCode) { - //PENDING try { iprof.exitVM(); --- 129,132 ---- *************** *** 146,154 **** /** ! * Suspends all threads in the virtual machine as described in ! * {@link ThreadInfo#suspend()}. */ public void suspendThreads() { ! //PENDING try { iprof.suspendVM(); --- 149,156 ---- /** ! * Suspends all threads in the virtual machine. */ public void suspendThreads() { ! //PENDING detect handle if the machine is suspended try { iprof.suspendVM(); *************** *** 157,160 **** --- 159,163 ---- } catch (UNAVAILABLE_Exception e) { //PENDING + throw new RuntimeException("TODO: handle this: \"Suspend Threads is unavailable\"" + e.getMessage()); } } *************** *** 176,184 **** /** ! * Resumes all threads in the virtual machine as described in ! * {@link ThreadInfo#resume()}. */ public void resumeThreads() { ! //PENDING try { iprof.resumeVM(); --- 179,186 ---- /** ! * Resumes all threads in the virtual machine. */ public void resumeThreads() { ! //PENDING try { iprof.resumeVM(); *************** *** 187,190 **** --- 189,193 ---- } catch (UNAVAILABLE_Exception e) { //PENDING + throw new RuntimeException("TODO: handle this: \" Resume Threads is unavailable\"" + e.getMessage()); } } *************** *** 210,213 **** --- 213,217 ---- } catch (UNAVAILABLE_Exception e) { //PENDING + throw new RuntimeException("TODO: handle this: \" Garbage Collection is unavailable\"" + e.getMessage() ); } } *************** *** 254,313 **** } ! //FIXME ! /**Returns realtime image of library. After that you can access information in library ! * withtout creating snapshot. For one instace of VirtalMachineImpl it returns the same object. ! */ ! public VirtualMachineImageRef getRealtimeImage() { ! return realtime; ! } ! ! public List getThreads() { ! return realtime.getThreads(); ! } ! ! public List getMethods() { ! return realtime.getMethods(); ! } ! ! public List getCPUTraces() { ! return realtime.getCPUTraces(); ! } ! ! public List getAllocTraces() { ! return realtime.getAllocTraces(); ! } ! ! public List getMonTraces() { ! return realtime.getMonTraces(); ! } ! ! public List getTypes() { ! return realtime.getTypes(); ! } ! ! public List getThreadGroups() { ! return realtime.getThreadGroups(); ! } ! ! public List getClasses() { ! return realtime.getClasses(); ! } ! ! public List getGCRuns() { ! return realtime.getGCRuns(); } - public void addChildrenListener( int type, ChildrenListener listener) { - realtime.addChildrenListener( type, listener ); - } - - public void removeChildrenListener( int type, ChildrenListener listener) { - realtime.removeChildrenListener( type, listener ); - } - } /* * $Log$ * Revision 1.9 2002/07/22 00:17:29 vachis * add implementation of realtime interface (fasade) --- 258,275 ---- } ! /**Returns realtime image of library. After that you can access information in library realtime ! * without creating snapshot. For one instace of VirtalMachineImpl it returns always the same refenrece. ! */ ! public VirtualMachineImageRef getRealtimeImage() { ! return realtime; } } /* * $Log$ + * Revision 1.10 2002/07/22 17:51:30 vachis + * realtime via getRealtimeImage() method, it no longer implements VirtualMachineImageRef + * * Revision 1.9 2002/07/22 00:17:29 vachis * add implementation of realtime interface (fasade) |