Update of /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/data
In directory usw-pr-cvs1:/tmp/cvs-serv4848
Modified Files:
ProfilerData.java
Log Message:
References to snapshots added.
Temporary SessionKiller added.
Index: ProfilerData.java
===================================================================
RCS file: /cvsroot/javaprofiler/module/net/sourceforge/javaprofiler/module/data/ProfilerData.java,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** ProfilerData.java 2001/10/14 22:18:16 1.1.1.1
--- ProfilerData.java 2002/01/27 23:04:31 1.2
***************
*** 27,30 ****
--- 27,31 ----
import net.sourceforge.javaprofiler.module.nodes.SessionsNode;
+ import net.sourceforge.javaprofiler.module.nodes.SessionKiller;
/**
***************
*** 35,43 ****
public class ProfilerData {
/** List of Sessions. */
! private List sessions;
/** Index of current session. */
private int current;
/** Sigleton instance of this class. */
private static ProfilerData data;
/**
--- 36,48 ----
public class ProfilerData {
/** List of Sessions. */
! private List sessions;
/** Index of current session. */
private int current;
+ /** List of Snapshots. */
+ private List snapshots;
/** Sigleton instance of this class. */
private static ProfilerData data;
+ /** Session killer. */
+ private static SessionKiller killer;
/**
***************
*** 47,50 ****
--- 52,56 ----
private ProfilerData() {
sessions=new LinkedList();
+ snapshots=new LinkedList();
current=-1;
}
***************
*** 70,73 ****
--- 76,83 ----
sessions.add(session);
current=sessions.size()-1;
+ if (killer==null) {
+ killer=new SessionKiller();
+ killer.start();
+ }
refreshSessions();
}
***************
*** 119,123 ****
/**
! * Refreshes session nodes.
*/
private void refreshSessions() {
--- 129,133 ----
/**
! * Refreshes session and snapshot nodes.
*/
private void refreshSessions() {
***************
*** 126,129 ****
--- 136,168 ----
sessionsNode.update();
}
+
+ /**
+ * Adds snapshot to the list of snapshots.
+ *
+ * @param snapshot added snapshot.
+ */
+ public void addSnapshot(Snapshot snapshot) {
+ snapshots.add(snapshot);
+ refreshSessions();
+ }
+
+ /**
+ * Removes snapshot from the list of snapshots.
+ *
+ * @param snapshot removed snapshot.
+ */
+ public void removeSnapshot(Snapshot snapshot) {
+ snapshots.remove(snapshot);
+ refreshSessions();
+ }
+
+ /**
+ * Returns <code>List</code> of snapshots.
+ *
+ * @return <code>List</code> of <code>Snapshot</code> objects.
+ */
+ public List snapshots() {
+ return new LinkedList(snapshots);
+ }
}
***************
*** 131,134 ****
--- 170,177 ----
/*
* $Log$
+ * Revision 1.2 2002/01/27 23:04:31 stolis
+ * References to snapshots added.
+ * Temporary SessionKiller added.
+ *
* Revision 1.1.1.1 2001/10/14 22:18:16 stolis
* The very first version of profiler module.
|