Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime In directory usw-pr-cvs1:/tmp/cvs-serv2231 Modified Files: AllocThreadMethodR.java AllocThreadTraceR.java AllocTraceR.java AllocTypeMethodR.java AllocTypeR.java AllocTypeThreadMethodR.java AllocTypeThreadR.java AllocTypeTraceR.java CPUThreadMethodR.java CPUTraceR.java MethodR.java MonThreadMethodR.java MonTraceR.java ThreadGroupR.java ThreadR.java Log Message: childrenAdded event firing Index: AllocThreadMethodR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocThreadMethodR.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** AllocThreadMethodR.java 17 Jul 2002 22:11:14 -0000 1.9 --- AllocThreadMethodR.java 18 Jul 2002 08:48:20 -0000 1.10 *************** *** 80,86 **** protected transient AllocStatEvent allocEvent; private Map listenersMap=new HashMap(1); - private EventListenerList allocTypeThreadMethodListeners=new - EventListenerList(); - private EventListenerList allocThreadTraceListeners=new EventListenerList(); /** Constructs multi-rooted object --- 80,83 ---- Index: AllocThreadTraceR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocThreadTraceR.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** AllocThreadTraceR.java 11 Jul 2002 18:17:23 -0000 1.7 --- AllocThreadTraceR.java 18 Jul 2002 08:48:20 -0000 1.8 *************** *** 77,80 **** --- 77,81 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 203,206 **** --- 204,210 ---- 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); } *************** *** 332,341 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 336,362 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE}); } Index: AllocTraceR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTraceR.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AllocTraceR.java 11 Jul 2002 18:17:23 -0000 1.8 --- AllocTraceR.java 18 Jul 2002 08:48:20 -0000 1.9 *************** *** 81,84 **** --- 81,85 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** Constructs new object with info. *************** *** 188,195 **** --- 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); } *************** *** 332,341 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 339,367 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_TRACE, ! Constants.ALLOC_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_TRACE, ! Constants.ALLOC_THREAD_TRACE}); } Index: AllocTypeMethodR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeMethodR.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AllocTypeMethodR.java 11 Jul 2002 18:17:23 -0000 1.8 --- AllocTypeMethodR.java 18 Jul 2002 08:48:20 -0000 1.9 *************** *** 77,80 **** --- 77,81 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 209,216 **** --- 210,223 ---- 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); } *************** *** 302,311 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 309,337 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_TRACE, ! Constants.ALLOC_TYPE_THREAD_METHOD}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_TRACE, ! Constants.ALLOC_TYPE_THREAD_METHOD}); } Index: AllocTypeR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeR.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** AllocTypeR.java 11 Jul 2002 18:17:23 -0000 1.6 --- AllocTypeR.java 18 Jul 2002 08:48:20 -0000 1.7 *************** *** 81,84 **** --- 81,85 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** This constructor will find it's component class on its own through *************** *** 233,244 **** --- 234,254 ---- 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 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 addAllocTypeThread(AllocTypeThreadRef o) { allocTypeThreads.add(o); + image.fireChildrenAdded(new ChildrenEvent(this, Constants. + ALLOC_TYPE_THREAD, new Object[]{o}, new int[]{ + allocTypeThreads.size()-1}), listenersMap); } *************** *** 393,402 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 403,433 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_METHOD, ! Constants.ALLOC_TYPE_TRACE, ! Constants.ALLOC_TYPE_THREAD}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_METHOD, ! Constants.ALLOC_TYPE_TRACE, ! Constants.ALLOC_TYPE_THREAD}); } Index: AllocTypeThreadMethodR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeThreadMethodR.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AllocTypeThreadMethodR.java 11 Jul 2002 18:17:23 -0000 1.8 --- AllocTypeThreadMethodR.java 18 Jul 2002 08:48:20 -0000 1.9 *************** *** 80,83 **** --- 80,84 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 207,210 **** --- 208,214 ---- 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); } *************** *** 341,350 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 345,371 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE}); } Index: AllocTypeThreadR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeThreadR.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** AllocTypeThreadR.java 11 Jul 2002 18:17:23 -0000 1.9 --- AllocTypeThreadR.java 18 Jul 2002 08:48:20 -0000 1.10 *************** *** 77,80 **** --- 77,81 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 216,223 **** --- 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); } *************** *** 317,326 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 324,352 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_METHOD, ! Constants.ALLOC_TYPE_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_METHOD, ! Constants.ALLOC_TYPE_THREAD_TRACE}); } Index: AllocTypeTraceR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/AllocTypeTraceR.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** AllocTypeTraceR.java 11 Jul 2002 18:17:23 -0000 1.8 --- AllocTypeTraceR.java 18 Jul 2002 08:48:20 -0000 1.9 *************** *** 76,79 **** --- 76,80 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient AllocStatEvent allocEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 202,205 **** --- 203,209 ---- 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); } *************** *** 312,321 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 316,342 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD_TRACE}); } Index: CPUThreadMethodR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/CPUThreadMethodR.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** CPUThreadMethodR.java 11 Jul 2002 18:17:23 -0000 1.6 --- CPUThreadMethodR.java 18 Jul 2002 08:48:21 -0000 1.7 *************** *** 74,77 **** --- 74,78 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient CPUStatEvent CPUEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 185,188 **** --- 186,192 ---- 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); } *************** *** 291,300 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 295,321 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.CPU_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.CPU_THREAD_TRACE}); } Index: CPUTraceR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/CPUTraceR.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** CPUTraceR.java 11 Jul 2002 18:17:23 -0000 1.7 --- CPUTraceR.java 18 Jul 2002 08:48:21 -0000 1.8 *************** *** 76,79 **** --- 76,80 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient CPUStatEvent CPUEvent; + private Map listenersMap=new HashMap(1); /** Constructs new object with info. *************** *** 184,187 **** --- 185,191 ---- 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); } *************** *** 288,297 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 292,318 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.CPU_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.CPU_THREAD_TRACE}); } Index: MethodR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MethodR.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** MethodR.java 17 Jul 2002 12:25:36 -0000 1.9 --- MethodR.java 18 Jul 2002 08:48:21 -0000 1.10 *************** *** 104,107 **** --- 104,108 ---- protected transient CPUStatEvent CPUEvent; protected transient MonStatEvent monEvent; + private Map listenersMap=new HashMap(1); /** Constructs new object with info. *************** *** 323,350 **** --- 324,372 ---- 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); } *************** *** 506,515 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 528,566 ---- // ---------- 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.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}); ! } ! ! /** ! * 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.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}); } Index: MonThreadMethodR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MonThreadMethodR.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** MonThreadMethodR.java 11 Jul 2002 18:17:23 -0000 1.6 --- MonThreadMethodR.java 18 Jul 2002 08:48:21 -0000 1.7 *************** *** 74,77 **** --- 74,78 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient MonStatEvent monEvent; + private Map listenersMap=new HashMap(1); /** Constructs multi-rooted object *************** *** 185,188 **** --- 186,192 ---- 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); } *************** *** 291,300 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 295,321 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.MON_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.MON_THREAD_TRACE}); } Index: MonTraceR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/MonTraceR.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** MonTraceR.java 11 Jul 2002 18:17:23 -0000 1.7 --- MonTraceR.java 18 Jul 2002 08:48:21 -0000 1.8 *************** *** 76,79 **** --- 76,80 ---- protected EventListenerList listenerList = new EventListenerList(); protected transient MonStatEvent monEvent; + private Map listenersMap=new HashMap(1); /** Constructs new object with info. *************** *** 161,164 **** --- 162,168 ---- 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); } *************** *** 276,285 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 280,306 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.MON_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.MON_THREAD_TRACE}); } Index: ThreadGroupR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/ThreadGroupR.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** ThreadGroupR.java 17 Jul 2002 12:25:36 -0000 1.6 --- ThreadGroupR.java 18 Jul 2002 08:48:21 -0000 1.7 *************** *** 65,70 **** threads); ! /** A list of event listeners for this component. */ ! protected EventListenerList threadListeners = new EventListenerList(); /** Constructs new object with info. --- 65,69 ---- threads); ! private Map listenersMap=new HashMap(1); /** Constructs new object with info. *************** *** 138,145 **** // package / private ! void addThread(ThreadRef thread) { ! threads.add(thread); ! fireChildrenAdded(new ChildrenEvent(this, Constants.THREAD, new Object[] ! {thread}, new int[]{threads.size()-1}), threadListeners); } --- 137,145 ---- // package / private ! void addThread(ThreadRef o) { ! threads.add(o); ! image.fireChildrenAdded(new ChildrenEvent(this, Constants. ! THREAD, new Object[]{o}, new int[]{ ! threads.size()-1}), listenersMap); } *************** *** 196,208 **** /** * Removes an <code>ChildrenListener</code> from this object. * @param l the listener to be removed */ public void removeChildrenListener(int type, ChildrenListener l) { ! if (type==Constants.THREAD) ! threadListeners.remove(ChildrenListener.class, l); ! else ! throw new IllegalArgumentException("Illegal child type."); } ! /** * Adds an <code>ChildrenListener</code> to this object. --- 196,208 ---- /** * 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.THREAD}); } ! /** * Adds an <code>ChildrenListener</code> to this object. *************** *** 210,236 **** * dispatching thread, rather they are dispatched in the thread which * caused new data to be loaded. * @param l the listener to be added */ public void addChildrenListener(int type, ChildrenListener l) { ! if (type==Constants.THREAD) ! threadListeners.add(ChildrenListener.class, l); ! else ! throw new IllegalArgumentException("Illegal child type."); ! } ! ! /** ! * Notifies all listeners that have registered interest for ! * notification on this event type. The event instance ! * is taken from a parameter. ! * @param e the event to fire ! * @param list list holding the listeners to receive the event ! */ ! private void fireChildrenAdded(ChildrenEvent e, EventListenerList list) { ! // Guaranteed to return a non-null array ! Object[] listeners = list.getListenerList(); ! // Process the listeners last to first, notifying all ! for (int i = listeners.length-2; i>=0; i-=2) { ! ((ChildrenListener)listeners[i+1]).childrenAdded(e); ! } } } --- 210,220 ---- * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.THREAD}); } } Index: ThreadR.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/realtime/ThreadR.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ThreadR.java 11 Jul 2002 18:17:23 -0000 1.9 --- ThreadR.java 18 Jul 2002 08:48:21 -0000 1.10 *************** *** 104,107 **** --- 104,108 ---- protected transient CPUStatEvent CPUEvent; protected transient MonStatEvent monEvent; + private Map listenersMap=new HashMap(1); /** Constructs new object with info. *************** *** 338,365 **** --- 339,387 ---- void addAllocTypeThread(AllocTypeThreadRef o) { allocTypeThreads.add(o); + image.fireChildrenAdded(new ChildrenEvent(this, Constants. + ALLOC_TYPE_THREAD, new Object[]{o}, new int[]{ + allocTypeThreads.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 addAllocThreadTrace(AllocThreadTraceRef o) { allocThreadTraces.add(o); + image.fireChildrenAdded(new ChildrenEvent(this, Constants. + ALLOC_THREAD_TRACE, new Object[]{o}, new int[]{ + allocThreadTraces.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 addCPUThreadTrace(CPUThreadTraceRef o) { cpuThreadTraces.add(o); + image.fireChildrenAdded(new ChildrenEvent(this, Constants. + CPU_THREAD_TRACE, new Object[]{o}, new int[]{ + cpuThreadTraces.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); } 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); } *************** *** 539,548 **** // ---------- listeners ! public void removeChildrenListener(int type, ChildrenListener listener) { ! // PENDING ! } ! ! public void addChildrenListener(int type, ChildrenListener listener) { ! // PENDING } --- 561,599 ---- // ---------- 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.removeChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD, ! Constants.ALLOC_THREAD_METHOD, ! Constants.ALLOC_THREAD_TRACE, ! Constants.CPU_THREAD_METHOD, ! Constants.CPU_THREAD_TRACE, ! Constants.MON_THREAD_METHOD, ! Constants.MON_THREAD_TRACE}); ! } ! ! /** ! * 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.addChildrenListenerChecked(type, l, listenersMap, ! new int[] {Constants.ALLOC_TYPE_THREAD, ! Constants.ALLOC_THREAD_METHOD, ! Constants.ALLOC_THREAD_TRACE, ! Constants.CPU_THREAD_METHOD, ! Constants.CPU_THREAD_TRACE, ! Constants.MON_THREAD_METHOD, ! Constants.MON_THREAD_TRACE}); } |