Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime
In directory usw-pr-cvs1:/tmp/cvs-serv12814
Modified Files:
AllocThreadMethodR.java AllocThreadTraceR.java
AllocTraceR.java AllocTypeMethodR.java
AllocTypeThreadMethodR.java AllocTypeThreadR.java
AllocTypeThreadTraceR.java AllocTypeTraceR.java ClassR.java
CPUThreadMethodR.java CPUThreadTraceR.java CPUTraceR.java
DataR.java ImageR.java MethodR.java MonThreadMethodR.java
MonThreadTraceR.java MonTraceR.java MultiRootDataR.java
ThreadGroupR.java ThreadR.java TypeR.java
Log Message:
created auto-refreshing task where children listeners are registered
Index: AllocThreadMethodR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocThreadMethodR.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** AllocThreadMethodR.java 24 Jul 2002 22:29:03 -0000 1.12
--- AllocThreadMethodR.java 20 Aug 2002 18:59:18 -0000 1.13
***************
*** 79,83 ****
protected EventListenerList listenerList=new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 79,82 ----
***************
*** 133,136 ****
--- 132,171 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_METHOD:
+ refreshAllocTypeThreadMethods();
+ return;
+ case Constants.ALLOC_THREAD_TRACE:
+ refreshAllocThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_METHOD:
+ return getAllocTypeThreadMethods();
+ case Constants.ALLOC_THREAD_TRACE:
+ return getAllocThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_THREAD_METHOD,
+ Constants.ALLOC_THREAD_TRACE};
+ }
+
// ---------- return parents, roots
/** Returns TypeRef root of this object.
***************
*** 220,233 ****
void addAllocTypeThreadMethod(AllocTypeThreadMethodRef o) {
allocTypeThreadMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_METHOD, new Object[]{o}, new int[]{
! allocTypeThreadMethods.size()-1}), listenersMap);
}
void addAllocThreadTrace(AllocThreadTraceRef o) {
allocThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_THREAD_TRACE, new Object[]{o}, new int[]{
! allocThreadTraces.size()-1}), listenersMap);
}
--- 255,268 ----
void addAllocTypeThreadMethod(AllocTypeThreadMethodRef o) {
allocTypeThreadMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_METHOD, new Object[]{o}, new int[]{
! allocTypeThreadMethods.size()-1}));
}
void addAllocThreadTrace(AllocThreadTraceRef o) {
allocThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_THREAD_TRACE, new Object[]{o}, new int[]{
! allocThreadTraces.size()-1}));
}
***************
*** 352,358 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_METHOD,
! Constants.ALLOC_THREAD_TRACE});
}
--- 387,391 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 367,373 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_METHOD,
! Constants.ALLOC_THREAD_TRACE});
}
--- 400,404 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: AllocThreadTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocThreadTraceR.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** AllocThreadTraceR.java 24 Jul 2002 22:29:03 -0000 1.10
--- AllocThreadTraceR.java 20 Aug 2002 18:59:18 -0000 1.11
***************
*** 77,81 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 77,80 ----
***************
*** 120,123 ****
--- 119,152 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ refreshAllocTypeThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ return getAllocTypeThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_THREAD_TRACE};
+ }
+
// ---------- return parents, roots
***************
*** 211,217 ****
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}), listenersMap);
}
--- 240,246 ----
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}));
}
***************
*** 350,355 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 379,383 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 364,369 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 392,396 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: AllocTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTraceR.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** AllocTraceR.java 24 Jul 2002 22:29:03 -0000 1.11
--- AllocTraceR.java 20 Aug 2002 18:59:18 -0000 1.12
***************
*** 81,85 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs new object with info.
--- 81,84 ----
***************
*** 140,143 ****
--- 139,178 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_TRACE:
+ refreshAllocTypeTraces();
+ return;
+ case Constants.ALLOC_THREAD_TRACE:
+ refreshAllocThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_TRACE:
+ return getAllocTypeTraces();
+ case Constants.ALLOC_THREAD_TRACE:
+ return getAllocThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_TRACE,
+ Constants.ALLOC_THREAD_TRACE};
+ }
+
// image getter method
***************
*** 189,202 ****
void addAllocTypeTrace(AllocTypeTraceRef o) {
allocTypeTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_TRACE, new Object[]{o}, new int[]{
! allocTypeTraces.size()-1}), listenersMap);
}
void addAllocThreadTrace(AllocThreadTraceRef o) {
allocThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_THREAD_TRACE, new Object[]{o}, new int[]{
! allocThreadTraces.size()-1}), listenersMap);
}
--- 224,237 ----
void addAllocTypeTrace(AllocTypeTraceRef o) {
allocTypeTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_TRACE, new Object[]{o}, new int[]{
! allocTypeTraces.size()-1}));
}
void addAllocThreadTrace(AllocThreadTraceRef o) {
allocThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_THREAD_TRACE, new Object[]{o}, new int[]{
! allocThreadTraces.size()-1}));
}
***************
*** 353,359 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_TRACE,
! Constants.ALLOC_THREAD_TRACE});
}
--- 388,392 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 368,374 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_TRACE,
! Constants.ALLOC_THREAD_TRACE});
}
--- 401,405 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: AllocTypeMethodR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeMethodR.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** AllocTypeMethodR.java 24 Jul 2002 22:29:03 -0000 1.11
--- AllocTypeMethodR.java 20 Aug 2002 18:59:18 -0000 1.12
***************
*** 77,81 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 77,80 ----
***************
*** 176,179 ****
--- 175,214 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_TRACE:
+ refreshAllocTypeTraces();
+ return;
+ case Constants.ALLOC_TYPE_THREAD_METHOD:
+ refreshAllocTypeThreadMethods();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_TRACE:
+ return getAllocTypeTraces();
+ case Constants.ALLOC_TYPE_THREAD_METHOD:
+ return getAllocTypeThreadMethods();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_TRACE,
+ Constants.ALLOC_TYPE_THREAD_METHOD};
+ }
+
// ---------- profiler statistic
***************
*** 218,231 ****
void addAllocTypeTrace(AllocTypeTraceRef o) {
allocTypeTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_TRACE, new Object[]{o}, new int[]{
! allocTypeTraces.size()-1}), listenersMap);
}
void addAllocTypeThreadMethod(AllocTypeThreadMethodRef o) {
allocTypeThreadMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_METHOD, new Object[]{o}, new int[]{
! allocTypeThreadMethods.size()-1}), listenersMap);
}
--- 253,266 ----
void addAllocTypeTrace(AllocTypeTraceRef o) {
allocTypeTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_TRACE, new Object[]{o}, new int[]{
! allocTypeTraces.size()-1}));
}
void addAllocTypeThreadMethod(AllocTypeThreadMethodRef o) {
allocTypeThreadMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_METHOD, new Object[]{o}, new int[]{
! allocTypeThreadMethods.size()-1}));
}
***************
*** 324,330 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_TRACE,
! Constants.ALLOC_TYPE_THREAD_METHOD});
}
--- 359,363 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 339,345 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_TRACE,
! Constants.ALLOC_TYPE_THREAD_METHOD});
}
--- 372,376 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: AllocTypeThreadMethodR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeThreadMethodR.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** AllocTypeThreadMethodR.java 24 Jul 2002 22:29:03 -0000 1.11
--- AllocTypeThreadMethodR.java 20 Aug 2002 18:59:18 -0000 1.12
***************
*** 80,84 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 80,83 ----
***************
*** 123,126 ****
--- 122,155 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ refreshAllocTypeThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ return getAllocTypeThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_THREAD_TRACE};
+ }
+
// ---------- return parents
***************
*** 227,233 ****
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}), listenersMap);
}
--- 256,262 ----
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}));
}
***************
*** 371,376 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 400,404 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 385,390 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 413,417 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: AllocTypeThreadR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeThreadR.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** AllocTypeThreadR.java 24 Jul 2002 22:29:03 -0000 1.12
--- AllocTypeThreadR.java 20 Aug 2002 18:59:19 -0000 1.13
***************
*** 77,81 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 77,80 ----
***************
*** 175,178 ****
--- 174,213 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_METHOD:
+ refreshAllocTypeThreadMethods();
+ return;
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ refreshAllocTypeThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_METHOD:
+ return getAllocTypeThreadMethods();
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ return getAllocTypeThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_THREAD_METHOD,
+ Constants.ALLOC_TYPE_THREAD_TRACE};
+ }
+
// ---------- profiler statistic
***************
*** 217,230 ****
void addAllocTypeThreadMethod (AllocTypeThreadMethodRef o) {
allocTypeThreadMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_METHOD, new Object[]{o}, new int[]{
! allocTypeThreadMethods.size()-1}), listenersMap);
}
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}), listenersMap);
}
--- 252,265 ----
void addAllocTypeThreadMethod (AllocTypeThreadMethodRef o) {
allocTypeThreadMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_METHOD, new Object[]{o}, new int[]{
! allocTypeThreadMethods.size()-1}));
}
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}));
}
***************
*** 331,337 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_METHOD,
! Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 366,370 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 346,352 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_METHOD,
! Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 379,383 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: AllocTypeThreadTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeThreadTraceR.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** AllocTypeThreadTraceR.java 24 Jul 2002 22:29:03 -0000 1.9
--- AllocTypeThreadTraceR.java 20 Aug 2002 18:59:19 -0000 1.10
***************
*** 105,108 ****
--- 105,129 ----
// ---------- return child Lists
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {};
+ }
+
// ---------- return parents
Index: AllocTypeTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeTraceR.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -r1.11 -r1.12
*** AllocTypeTraceR.java 24 Jul 2002 22:29:03 -0000 1.11
--- AllocTypeTraceR.java 20 Aug 2002 18:59:19 -0000 1.12
***************
*** 76,80 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient AllocStatEvent allocEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 76,79 ----
***************
*** 119,122 ****
--- 118,151 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ refreshAllocTypeThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.ALLOC_TYPE_THREAD_TRACE:
+ return getAllocTypeThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.ALLOC_TYPE_THREAD_TRACE};
+ }
+
// ---------- return parents, roots
***************
*** 210,216 ****
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}), listenersMap);
}
--- 239,245 ----
void addAllocTypeThreadTrace(AllocTypeThreadTraceRef o) {
allocTypeThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_THREAD_TRACE, new Object[]{o}, new int[]{
! allocTypeThreadTraces.size()-1}));
}
***************
*** 330,335 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 359,363 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 344,349 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE});
}
--- 372,376 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: ClassR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/ClassR.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** ClassR.java 24 Jul 2002 22:29:03 -0000 1.8
--- ClassR.java 20 Aug 2002 18:59:19 -0000 1.9
***************
*** 117,124 ****
public void refreshMethods() {
- List list=new ArrayList();
image.extractChildRoot(this.objId, IProf.CLASS_METHODS, image.
! methodFactory, list);
! image.addMethods(list);
}
--- 117,122 ----
public void refreshMethods() {
image.extractChildRoot(this.objId, IProf.CLASS_METHODS, image.
! methodFactory, null, Constants.METHOD);
}
***************
*** 129,132 ****
--- 127,160 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.METHOD:
+ refreshMethods();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.METHOD:
+ return getMethods();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.METHOD};
+ }
+
// image getter method
***************
*** 188,191 ****
--- 216,222 ----
void addMethod(MethodRef o) {
methods.add(o);
+ // methods may be added unexpectedly for "unknown" classes
+ image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
+ METHOD, new Object[]{o}, new int[]{methods.size()-1}));
}
***************
*** 291,294 ****
--- 322,350 ----
public String toString() {
return getName();
+ }
+
+ // ---------- listeners
+
+ /**
+ * Removes an <code>ChildrenListener</code> from this object.
+ * @param type Type of children to listen events for. Constants are defined
+ * in net.sourceforge.javaprofiler.jpi.Constants.
+ * @param l the listener to be removed
+ */
+ public void removeChildrenListener(int type, ChildrenListener l) {
+ image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
+ }
+
+ /**
+ * Adds an <code>ChildrenListener</code> to this object.
+ * <strong>Warning:</strong> Events are not dispatched in the swing event-
+ * dispatching thread, rather they are dispatched in the thread which
+ * caused new data to be loaded.
+ * @param type Type of children to listen events for. Constants are defined
+ * in net.sourceforge.javaprofiler.jpi.Constants.
+ * @param l the listener to be added
+ */
+ public void addChildrenListener(int type, ChildrenListener l) {
+ image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
}
Index: CPUThreadMethodR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/CPUThreadMethodR.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** CPUThreadMethodR.java 24 Jul 2002 22:29:03 -0000 1.9
--- CPUThreadMethodR.java 20 Aug 2002 18:59:19 -0000 1.10
***************
*** 74,78 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient CPUStatEvent CPUEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 74,77 ----
***************
*** 117,120 ****
--- 116,149 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.CPU_THREAD_TRACE:
+ refreshCPUThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.CPU_THREAD_TRACE:
+ return getCPUThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.CPU_THREAD_TRACE};
+ }
+
// ---------- return parents, roots
***************
*** 193,199 ****
void addCPUThreadTrace(CPUThreadTraceRef o) {
cpuThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_THREAD_TRACE, new Object[]{o}, new int[]{
! cpuThreadTraces.size()-1}), listenersMap);
}
--- 222,228 ----
void addCPUThreadTrace(CPUThreadTraceRef o) {
cpuThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_THREAD_TRACE, new Object[]{o}, new int[]{
! cpuThreadTraces.size()-1}));
}
***************
*** 309,314 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.CPU_THREAD_TRACE});
}
--- 338,342 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 323,328 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.CPU_THREAD_TRACE});
}
--- 351,355 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: CPUThreadTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/CPUThreadTraceR.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** CPUThreadTraceR.java 24 Jul 2002 22:29:03 -0000 1.8
--- CPUThreadTraceR.java 20 Aug 2002 18:59:19 -0000 1.9
***************
*** 99,102 ****
--- 99,123 ----
// ---------- return child Lists
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {};
+ }
+
// ---------- return parents
Index: CPUTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/CPUTraceR.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** CPUTraceR.java 24 Jul 2002 22:29:03 -0000 1.10
--- CPUTraceR.java 20 Aug 2002 18:59:19 -0000 1.11
***************
*** 76,80 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient CPUStatEvent CPUEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs new object with info.
--- 76,79 ----
***************
*** 124,127 ****
--- 123,156 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.CPU_THREAD_TRACE:
+ refreshCPUThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.CPU_THREAD_TRACE:
+ return getCPUThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.CPU_THREAD_TRACE};
+ }
+
// image getter method
***************
*** 194,200 ****
void addCPUThreadTrace(CPUThreadTraceRef o) {
cpuThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_THREAD_TRACE, new Object[]{o}, new int[]{
! cpuThreadTraces.size()-1}), listenersMap);
}
--- 223,229 ----
void addCPUThreadTrace(CPUThreadTraceRef o) {
cpuThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_THREAD_TRACE, new Object[]{o}, new int[]{
! cpuThreadTraces.size()-1}));
}
***************
*** 308,313 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.CPU_THREAD_TRACE});
}
--- 337,341 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 322,327 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.CPU_THREAD_TRACE});
}
--- 350,354 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: DataR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/DataR.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -r1.6 -r1.7
*** DataR.java 24 Jul 2002 22:29:03 -0000 1.6
--- DataR.java 20 Aug 2002 18:59:19 -0000 1.7
***************
*** 69,71 ****
--- 69,77 ----
*/
public abstract DataR getLocationR();
+
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public abstract void refresh(int type);
}
Index: ImageR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/ImageR.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** ImageR.java 24 Jul 2002 22:29:03 -0000 1.13
--- ImageR.java 20 Aug 2002 18:59:19 -0000 1.14
***************
*** 128,131 ****
--- 128,143 ----
protected EventListenerList threadgroupListeners = new EventListenerList();
+ /** Maps from data object and child type to <code>ChildrenListener</code>
+ * list.
+ */
+ private Map childListeners=new HashMap(1);
+ /** Maps from image child type to <code>ChildrenListener</code> list. */
+ private Map imageChildListeners=new HashMap(1);
+
[...1270 lines suppressed...]
! int type=(int) (key.longValue() >> 32);
!
! refresh(type);
! }
! }
! };
! }
! return task;
}
!
! /** Returns a <code>Timer</code> that can be used for refreshing realtime
! * image.
*/
! public Timer getTimer() {
! if (timer==null) {
! timer=new Timer(true);
! }
! return timer;
}
}
Index: MethodR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MethodR.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** MethodR.java 24 Jul 2002 22:29:03 -0000 1.12
--- MethodR.java 20 Aug 2002 18:59:19 -0000 1.13
***************
*** 104,108 ****
protected transient CPUStatEvent CPUEvent;
protected transient MonStatEvent monEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs new object with info.
--- 104,107 ----
***************
*** 157,164 ****
public void refreshCPUTraces() {
- List list=new ArrayList();
image.extractChildRoot(this.objId, IProf.CPU_METHOD_TRACES, image.
! cpuTraceFactory, list);
! image.addCPUTraces(list);
}
--- 156,161 ----
public void refreshCPUTraces() {
image.extractChildRoot(this.objId, IProf.CPU_METHOD_TRACES, image.
! cpuTraceFactory, null, Constants.CPU_TRACE);
}
***************
*** 170,177 ****
public void refreshAllocTraces() {
- List list=new ArrayList();
image.extractChildRoot(this.objId, IProf.ALLOC_METHOD_TRACES, image.
! allocTraceFactory, list);
! image.addAllocTraces(list);
}
--- 167,172 ----
public void refreshAllocTraces() {
image.extractChildRoot(this.objId, IProf.ALLOC_METHOD_TRACES, image.
! allocTraceFactory, null, Constants.ALLOC_TRACE);
}
***************
*** 183,190 ****
public void refreshMonTraces() {
- List list=new ArrayList();
image.extractChildRoot(this.objId, IProf.MON_METHOD_TRACES, image.
! monTraceFactory, list);
! image.addMonTraces(list);
}
--- 178,183 ----
public void refreshMonTraces() {
image.extractChildRoot(this.objId, IProf.MON_METHOD_TRACES, image.
! monTraceFactory, null, Constants.MON_TRACE);
}
***************
*** 239,242 ****
--- 232,301 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.CPU_TRACE:
+ refreshCPUTraces();
+ return;
+ case Constants.ALLOC_TRACE:
+ refreshAllocTraces();
+ return;
+ case Constants.MON_TRACE:
+ refreshMonTraces();
+ return;
+ case Constants.ALLOC_TYPE_METHOD:
+ refreshAllocTypeMethods();
+ return;
+ case Constants.ALLOC_THREAD_METHOD:
+ refreshAllocThreadMethods();
+ return;
+ case Constants.CPU_THREAD_METHOD:
+ refreshCPUThreadMethods();
+ return;
+ case Constants.MON_THREAD_METHOD:
+ refreshMonThreadMethods();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.CPU_TRACE:
+ return getCPUTraces();
+ case Constants.ALLOC_TRACE:
+ return getAllocTraces();
+ case Constants.MON_TRACE:
+ return getMonTraces();
+ case Constants.ALLOC_TYPE_METHOD:
+ return getAllocTypeMethods();
+ case Constants.ALLOC_THREAD_METHOD:
+ return getAllocThreadMethods();
+ case Constants.CPU_THREAD_METHOD:
+ return getCPUThreadMethods();
+ case Constants.MON_THREAD_METHOD:
+ return getMonThreadMethods();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.CPU_TRACE,
+ Constants.ALLOC_TRACE,
+ Constants.MON_TRACE,
+ Constants.ALLOC_TYPE_METHOD,
+ Constants.ALLOC_THREAD_METHOD,
+ Constants.CPU_THREAD_METHOD,
+ Constants.MON_THREAD_METHOD};
+ }
+
// image getter method
***************
*** 296,302 ****
*/
public void refresh() {
! refresh(IProf.ALLOC_DATA);
! refresh(IProf.CPU_DATA);
! refresh(IProf.MON_DATA);
}
--- 355,361 ----
*/
public void refresh() {
! refreshStatistics(IProf.ALLOC_DATA);
! refreshStatistics(IProf.CPU_DATA);
! refreshStatistics(IProf.MON_DATA);
}
***************
*** 335,383 ****
void addCPUTrace(CPUTraceRef o) {
cpuTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_TRACE, new Object[]{o}, new int[]{
! cpuTraces.size()-1}), listenersMap);
}
void addAllocTrace(AllocTraceRef o) {
allocTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TRACE, new Object[]{o}, new int[]{
! allocTraces.size()-1}), listenersMap);
}
void addMonTrace(MonTraceRef o) {
monTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
MON_TRACE, new Object[]{o}, new int[]{
! monTraces.size()-1}), listenersMap);
}
void addAllocTypeMethod(AllocTypeMethodRef o) {
allocTypeMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_METHOD, new Object[]{o}, new int[]{
! allocTypeMethods.size()-1}), listenersMap);
}
void addAllocThreadMethod(AllocThreadMethodRef o) {
allocThreadMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_THREAD_METHOD, new Object[]{o}, new int[]{
! allocThreadMethods.size()-1}), listenersMap);
}
void addCPUThreadMethod(CPUThreadMethodRef o) {
cpuThreadMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_THREAD_METHOD, new Object[]{o}, new int[]{
! cpuThreadMethods.size()-1}), listenersMap);
}
void addMonThreadMethod(MonThreadMethodRef o) {
monThreadMethods.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
MON_THREAD_METHOD, new Object[]{o}, new int[]{
! monThreadMethods.size()-1}), listenersMap);
}
--- 394,442 ----
void addCPUTrace(CPUTraceRef o) {
cpuTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_TRACE, new Object[]{o}, new int[]{
! cpuTraces.size()-1}));
}
void addAllocTrace(AllocTraceRef o) {
allocTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TRACE, new Object[]{o}, new int[]{
! allocTraces.size()-1}));
}
void addMonTrace(MonTraceRef o) {
monTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
MON_TRACE, new Object[]{o}, new int[]{
! monTraces.size()-1}));
}
void addAllocTypeMethod(AllocTypeMethodRef o) {
allocTypeMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_TYPE_METHOD, new Object[]{o}, new int[]{
! allocTypeMethods.size()-1}));
}
void addAllocThreadMethod(AllocThreadMethodRef o) {
allocThreadMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
ALLOC_THREAD_METHOD, new Object[]{o}, new int[]{
! allocThreadMethods.size()-1}));
}
void addCPUThreadMethod(CPUThreadMethodRef o) {
cpuThreadMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
CPU_THREAD_METHOD, new Object[]{o}, new int[]{
! cpuThreadMethods.size()-1}));
}
void addMonThreadMethod(MonThreadMethodRef o) {
monThreadMethods.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
MON_THREAD_METHOD, new Object[]{o}, new int[]{
! monThreadMethods.size()-1}));
}
***************
*** 425,429 ****
* IProf.MON_DATA.
*/
! private void refresh(int what) {
IProf.sData data;
try {
--- 484,488 ----
* IProf.MON_DATA.
*/
! private void refreshStatistics(int what) {
IProf.sData data;
try {
***************
*** 452,456 ****
private void conditionalRefresh(int what) {
if (image.getAlwaysRefresh())
! refresh(what);
}
--- 511,515 ----
private void conditionalRefresh(int what) {
if (image.getAlwaysRefresh())
! refreshStatistics(what);
}
***************
*** 546,557 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.CPU_TRACE,
! Constants.ALLOC_TRACE,
! Constants.MON_TRACE,
! Constants.ALLOC_TYPE_METHOD,
! Constants.ALLOC_THREAD_METHOD,
! Constants.CPU_THREAD_METHOD,
! Constants.MON_THREAD_METHOD});
}
--- 605,609 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 566,577 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.CPU_TRACE,
! Constants.ALLOC_TRACE,
! Constants.MON_TRACE,
! Constants.ALLOC_TYPE_METHOD,
! Constants.ALLOC_THREAD_METHOD,
! Constants.CPU_THREAD_METHOD,
! Constants.MON_THREAD_METHOD});
}
--- 618,622 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: MonThreadMethodR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MonThreadMethodR.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** MonThreadMethodR.java 24 Jul 2002 22:29:03 -0000 1.9
--- MonThreadMethodR.java 20 Aug 2002 18:59:19 -0000 1.10
***************
*** 74,78 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient MonStatEvent monEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs multi-rooted object
--- 74,77 ----
***************
*** 117,120 ****
--- 116,149 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.MON_THREAD_TRACE:
+ refreshMonThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ switch (type) {
+ case Constants.MON_THREAD_TRACE:
+ return getMonThreadTraces();
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {Constants.MON_THREAD_TRACE};
+ }
+
// ---------- return parents, roots
/** Returns ThreadRef root of this object.
***************
*** 193,199 ****
void addMonThreadTrace(MonThreadTraceRef o) {
monThreadTraces.add(o);
! image.fireChildrenAdded(new ChildrenEvent(this, Constants.
MON_THREAD_TRACE, new Object[]{o}, new int[]{
! monThreadTraces.size()-1}), listenersMap);
}
--- 222,228 ----
void addMonThreadTrace(MonThreadTraceRef o) {
monThreadTraces.add(o);
! image.globalFireChildrenAdded(new ChildrenEvent(this, Constants.
MON_THREAD_TRACE, new Object[]{o}, new int[]{
! monThreadTraces.size()-1}));
}
***************
*** 309,314 ****
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.removeChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.MON_THREAD_TRACE});
}
--- 338,342 ----
*/
public void removeChildrenListener(int type, ChildrenListener l) {
! image.globalRemoveChildrenListener(getId(), type, l, getChildTypes());
}
***************
*** 323,328 ****
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.addChildrenListenerChecked(type, l, listenersMap,
! new int[] {Constants.MON_THREAD_TRACE});
}
--- 351,355 ----
*/
public void addChildrenListener(int type, ChildrenListener l) {
! image.globalAddChildrenListener(getId(), type, l, getChildTypes());
}
Index: MonThreadTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MonThreadTraceR.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** MonThreadTraceR.java 24 Jul 2002 22:29:03 -0000 1.8
--- MonThreadTraceR.java 20 Aug 2002 18:59:19 -0000 1.9
***************
*** 99,102 ****
--- 99,123 ----
// ---------- return child Lists
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public List getChildren(int type) {
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns child types which this object can have. */
+ public int[] getChildTypes() {
+ return new int[] {};
+ }
+
// ---------- return parents, roots
Index: MonTraceR.java
===================================================================
RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MonTraceR.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** MonTraceR.java 24 Jul 2002 22:29:03 -0000 1.10
--- MonTraceR.java 20 Aug 2002 18:59:19 -0000 1.11
***************
*** 76,80 ****
protected EventListenerList listenerList = new EventListenerList();
protected transient MonStatEvent monEvent;
- private Map listenersMap=new HashMap(1);
/** Constructs new object with info.
--- 76,79 ----
***************
*** 124,127 ****
--- 123,156 ----
}
+ /** Refreshes a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
+ */
+ public void refresh(int type) {
+ switch (type) {
+ case Constants.MON_THREAD_TRACE:
+ refreshMonThreadTraces();
+ return;
+ }
+ throw new IllegalArgumentException("Illegal child type");
+ }
+
+ /** Returns a child list specified by the <code>type</code> argument.
+ * @param type Type of child list. Constants are defined in
+ * net.sourceforge.javaprofiler.jpi.Constants.
...
[truncated message content] |