From: Jan S. <st...@us...> - 2002-01-27 23:10:57
|
Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes In directory usw-pr-cvs1:/tmp/cvs-serv6304 Modified Files: SessionNode.java Log Message: GC, enableGC, disableGC, createSnapshot actions added. Index: SessionNode.java =================================================================== RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/nodes/SessionNode.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** SessionNode.java 2001/10/14 22:18:16 1.1.1.1 --- SessionNode.java 2002/01/27 23:10:55 1.2 *************** *** 30,33 **** --- 30,34 ---- import org.openide.util.actions.SystemAction; + import net.sourceforge.javaprofiler.jpi.Snapshot; import net.sourceforge.javaprofiler.module.actions.*; import net.sourceforge.javaprofiler.module.data.Session; *************** *** 56,60 **** --- 57,66 ---- return new SystemAction[] { SystemAction.get(MakeCurrentSessionAction.class), + SystemAction.get(SnapshotSessionAction.class), null, + SystemAction.get(GCSessionAction.class), + SystemAction.get(DisableGCSessionAction.class), + SystemAction.get(EnableGCSessionAction.class), + null, SystemAction.get(SuspendSessionAction.class), SystemAction.get(ResumeSessionAction.class), *************** *** 118,125 **** --- 124,163 ---- } + /** + * Enables GC in the session. + */ + public void enableGC() { + session.getVM().enableGC(true); + } + + /** + * Disables GC in the session. + */ + public void disableGC() { + session.getVM().enableGC(false); + } + + /** + * Creates snapshot of the session. + */ + public void createSnapshot() { + Snapshot snapshot=session.getVM().createSnapshot(); + ProfilerData.getData().addSnapshot(new net.sourceforge.javaprofiler.module.data.Snapshot(snapshot)); + } + + /** + * Forces GC in the session. + */ + public void gc() { + session.getVM().gc(); + } + } /* * $Log$ + * Revision 1.2 2002/01/27 23:10:55 stolis + * GC, enableGC, disableGC, createSnapshot actions added. + * * Revision 1.1.1.1 2001/10/14 22:18:16 stolis * The very first version of profiler module. |