From: Marek P. <ma...@us...> - 2001-12-03 15:49:59
|
Update of /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun In directory usw-pr-cvs1:/tmp/cvs-serv12226/net/sourceforge/javaprofiler/jpiimpl/commun Modified Files: IProf.java IProfException.java Log Message: new features of IProf class added Index: IProf.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProf.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** IProf.java 2001/12/03 10:02:23 1.7 --- IProf.java 2001/12/03 15:49:56 1.8 *************** *** 36,39 **** --- 36,40 ---- import java.util.*; + import java.lang.*; /** Communication interface class. This class implements *************** *** 824,832 **** ** of #sInfo structure. Reference to new #sInfo object ** is returned. Offset 'o' is changed to position behind ! ** just parsed item. ** ** @param infoType type of information stored in buffer ** @param b buffer ** @param o position in the buffer (input/output) ** ** @return information about object --- 825,836 ---- ** of #sInfo structure. Reference to new #sInfo object ** is returned. Offset 'o' is changed to position behind ! ** just parsed item. If 'info' is not null, it is used ! ** as output #sInfo structure (and a reference to it ! ** is returned). ** ** @param infoType type of information stored in buffer ** @param b buffer ** @param o position in the buffer (input/output) + ** @param info output buffer (if null, new instance is created) ** ** @return information about object *************** *** 834,838 **** ** @see sInfo, getInfo() */ ! private sInfo getInfo( int infoType, Buffer b, sOffset o) { switch( infoType) { --- 838,842 ---- ** @see sInfo, getInfo() */ ! private sInfo getInfo( int infoType, Buffer b, sOffset o, sInfo info) { switch( infoType) { *************** *** 840,845 **** case CLASS_INFO: { ! sClassInfo info = new sClassInfo(); ! o.offset = getClassInfo( b, o.offset, info); return info; --- 844,849 ---- case CLASS_INFO: { ! if( info == null) info = new sClassInfo(); ! o.offset = getClassInfo( b, o.offset, (sClassInfo)info); return info; *************** *** 848,853 **** case CLASS_FIELD_INFO: { ! sClassFieldInfo info = new sClassFieldInfo(); ! o.offset = getClassFieldInfo( b, o.offset, info); return info; --- 852,857 ---- case CLASS_FIELD_INFO: { ! if( info == null) info = new sClassFieldInfo(); ! o.offset = getClassFieldInfo( b, o.offset, (sClassFieldInfo)info); return info; *************** *** 856,861 **** case METHOD_INFO: { ! sMethodInfo info = new sMethodInfo(); ! o.offset = getMethodInfo( b, o.offset, info); return info; --- 860,865 ---- case METHOD_INFO: { ! if( info == null) info = new sMethodInfo(); ! o.offset = getMethodInfo( b, o.offset, (sMethodInfo)info); return info; *************** *** 864,870 **** case TRACE_INFO: { ! sTraceInfo info = new sTraceInfo(); ! o.offset = getTraceInfo( b, o.offset, info); ! return info; } --- 868,874 ---- case TRACE_INFO: { ! if( info == null) info = new sTraceInfo(); ! o.offset = getTraceInfo( b, o.offset, (sTraceInfo)info); ! return info; } *************** *** 872,877 **** case OBJECT_INFO: { ! sObjectInfo info = new sObjectInfo(); ! o.offset = getObjectInfo( b, o.offset, info); return info; --- 876,881 ---- case OBJECT_INFO: { ! if( info == null) info = new sObjectInfo(); ! o.offset = getObjectInfo( b, o.offset, (sObjectInfo)info); return info; *************** *** 880,885 **** case ARENA_INFO: { ! sArenaInfo info = new sArenaInfo(); ! o.offset = getArenaInfo( b, o.offset, info); return info; --- 884,889 ---- case ARENA_INFO: { ! if( info == null) info = new sArenaInfo(); ! o.offset = getArenaInfo( b, o.offset, (sArenaInfo)info); return info; *************** *** 888,893 **** case THREAD_INFO: { ! sThreadInfo info = new sThreadInfo(); ! o.offset = getThreadInfo( b, o.offset, info); return info; --- 892,897 ---- case THREAD_INFO: { ! if( info == null) info = new sThreadInfo(); ! o.offset = getThreadInfo( b, o.offset, (sThreadInfo)info); return info; *************** *** 896,901 **** case THREAD_GROUP_INFO: { ! sThreadGroupInfo info = new sThreadGroupInfo(); ! o.offset = getThreadGroupInfo( b, o.offset, info); return info; --- 900,905 ---- case THREAD_GROUP_INFO: { ! if( info == null) info = new sThreadGroupInfo(); ! o.offset = getThreadGroupInfo( b, o.offset, (sThreadGroupInfo)info); return info; *************** *** 904,909 **** case GC_INFO: { ! sGCInfo info = new sGCInfo(); ! o.offset = getGCInfo( b, o.offset, info); return info; --- 908,913 ---- case GC_INFO: { ! if( info == null) info = new sGCInfo(); ! o.offset = getGCInfo( b, o.offset, (sGCInfo)info); return info; *************** *** 960,964 **** } ! return getInfo( infoType, _buf, new sOffset( pos)); } --- 964,968 ---- } ! return getInfo( infoType, _buf, new sOffset( pos), null); } *************** *** 1393,1526 **** public static final int NO_OPTIONAL_ARG = 0; ! /** Internal implementation of getAll() and getChanged(). This ! ** method is a general implementation of getAll() and getChanged() ! ** methods which generally do the same thing. ! ** ! ** @param funcType type of method called ! ** @param objId identifier of object having a data ! ** @param seqType specified action ! ** @param includeInfo include information about object ! ** @param optionalArg optional argument (depends on type of object) ! ** ! ** @return linked list of sID objects ! ** ! ** @see getAll(), getChanged() */ ! ! private LinkedList getChangedOrAll( int funcType, ! int objId, ! int seqType, ! boolean includeInfo, ! int optionalArg) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! _buf.clear(); ! _buf.putInt( funcType); ! _buf.putInt( objId); ! _buf.putInt( seqType); ! if( includeInfo) _buf.putInt( 1); ! else _buf.putInt( 0); ! ! _buf.putInt( optionalArg); ! _commun.write( _buf); ! if( _commun.hasFailed()) throw new COMMUN_Exception(); ! ! _commun.read( _buf); ! if( _commun.hasFailed()) throw new COMMUN_Exception(); ! ! int pos = 0; ! int len = _buf.getInt( pos); ! ! pos += 4; ! ! if( len < 0) { ! if( len == RC_BAD_OBJ_ID) throw new BAD_OBJ_ID_Exception(); ! if( len == RC_BAD_COMMAND) throw new BAD_COMMAND_Exception(); ! throw new UNKNOWN_Exception(); } ! LinkedList list = new LinkedList(); ! for( int i = 0; i < len; i++) { ! sID stat = new sID(); ! stat.infoId = _buf.getInt( pos); ! pos += 4; ! stat.objId = _buf.getInt( pos); ! pos += 4; ! stat.parentLeftObjId = _buf.getInt( pos); ! pos += 4; ! stat.parentUpObjId = _buf.getInt( pos); ! pos += 4; ! stat.parentRightObjId = _buf.getInt( pos); ! pos += 4; ! stat.active = ( _buf.getInt( pos) != 0); ! pos += 4; ! int hasData = _buf.getInt( pos); ! pos += 4; if( hasData != 0) { ! stat.alloc = new sAllocStatData(); ! pos = getAllocStatData( _buf, pos, stat.alloc); } ! else stat.alloc = null; ! hasData = _buf.getInt( pos); ! pos += 4; if( hasData != 0) { ! stat.cpu = new sCpuStatData(); ! pos = getCpuStatData( _buf, pos, stat.cpu); } ! else stat.cpu = null; ! hasData = _buf.getInt( pos); ! pos += 4; if( hasData != 0) { ! stat.mon = new sMonStatData(); ! pos = getMonStatData( _buf, pos, stat.mon); } ! else stat.mon = null; ! boolean hasInfo = ( _buf.getInt( pos) != 0); ! pos += 4; if( hasInfo) { ! stat.infoType = _buf.getInt( pos); ! pos += 4; ! sOffset o = new sOffset( pos); ! stat.info = getInfo( stat.infoType, _buf, o); ! pos = o.offset; } else { ! stat.infoType = 0; ! stat.info = null; } ! list.addLast( stat); } --- 1397,1661 ---- public static final int NO_OPTIONAL_ARG = 0; ! /** Iterator thru statistic data. This class implements ! ** an iterator which can be used to iterate thru ! ** profiling statistic data returned by the dynamic ! ** profiling library. It implements a standard Iterator ! ** interface. An instance of this class is internally ! ** used by getAllThruIterator() and getChangedThruIterator() ! ** methods. remove() method of the interface is not ! ** implemented. ! ** ! ** @see Iterator */ ! ! private class StatDataIterator implements Iterator { ! ! /// reference to existing binary data buffer ! private Buffer _dataBuf = null; ! ! /** Use still the same object as next() returned value. ! ** It means the same object (of sID class) is used for ! ** storing all statistic data each time next() method ! ** is called. An advantage: only one instance of sID class ! ** exists during whole iteration. A disadvantage: next call ! ** to next() method will overwrite old values, so it is ! ** necessary to copy values stored inside the object somewhere ! ** else (eg. to custom data class etc.). */ ! ! private boolean _sameObject; ! ! /// output structure filled by statistic data ! private sID _stat = null; ! /// current position in the buffer ! private int _pos; ! /// number of items which remain in the buffer yet ! private int _numItems; ! /** Constructor. It initializes internal member variables. ! ** ! ** @param buf reference to existing binary data buffer ! ** @param sameObject use the same output object every time ! ** ! ** @see _sameObject */ ! public StatDataIterator( Buffer buf, boolean sameObject) { ! _dataBuf = buf; ! _sameObject = sameObject; ! ! _pos = 4; ! _numItems = _dataBuf.getInt( 0); } ! /** Next element in the iteration. This method returns ! ** next element in the iteration. First time it returns ! ** first element. NoSuchElementException is thrown when ! ** iteration has no more elements. ! ** ! ** @return next element in the iteration */ ! public Object next() throws NoSuchElementException { ! if( _numItems <= 0) throw new NoSuchElementException(); ! ! _numItems--; ! ! if( !_sameObject || _stat == null) _stat = new sID(); ! _stat.infoId = _dataBuf.getInt( _pos); ! _pos += 4; ! _stat.objId = _dataBuf.getInt( _pos); ! _pos += 4; ! _stat.parentLeftObjId = _dataBuf.getInt( _pos); ! _pos += 4; ! _stat.parentUpObjId = _dataBuf.getInt( _pos); ! _pos += 4; ! _stat.parentRightObjId = _dataBuf.getInt( _pos); ! _pos += 4; ! _stat.active = ( _dataBuf.getInt( _pos) != 0); ! _pos += 4; ! int hasData = _dataBuf.getInt( _pos); ! _pos += 4; if( hasData != 0) { ! if( _stat.alloc == null) _stat.alloc = new sAllocStatData(); ! _pos = getAllocStatData( _dataBuf, _pos, _stat.alloc); } ! else _stat.alloc = null; ! hasData = _dataBuf.getInt( _pos); ! _pos += 4; if( hasData != 0) { ! if( _stat.cpu == null) _stat.cpu = new sCpuStatData(); ! _pos = getCpuStatData( _dataBuf, _pos, _stat.cpu); } ! else _stat.cpu = null; ! hasData = _dataBuf.getInt( _pos); ! _pos += 4; if( hasData != 0) { ! if( _stat.mon == null) _stat.mon = new sMonStatData(); ! _pos = getMonStatData( _dataBuf, _pos, _stat.mon); } ! else _stat.mon = null; ! boolean hasInfo = ( _dataBuf.getInt( _pos) != 0); ! _pos += 4; if( hasInfo) { ! _stat.infoType = _dataBuf.getInt( _pos); ! _pos += 4; ! sOffset o = new sOffset( _pos); ! _stat.info = getInfo( _stat.infoType, _dataBuf, o, _stat.info); ! _pos = o.offset; } else { ! _stat.infoType = 0; ! _stat.info = null; } + + return _stat; + } + + /** Does next item exist in the iteration ? This method returns + ** true if the iteration has more elements. In other words + ** it returns true if next() would return an element rather + ** than throwing an exception. + ** + ** @return true (iterator has more elements); + ** false (no other element) */ + + public boolean hasNext() { ! return ( _numItems != 0); ! } ! ! /** Remove an element from iteration. This method is not ! ** implemented so it throws an UnsupportedOperationException ! ** every time. */ ! ! public void remove() throws UnsupportedOperationException { ! ! throw new UnsupportedOperationException(); ! } ! }; ! ! /** Internal implementation of getAllThruIterator() and ! ** getChangedThruIterator(). This method is a general ! ** implementation of getAllThruIterator() and ! ** getChangedThruIterator() methods which generally do ! ** the same thing. 'sameOutputObject' argument specifies ! ** if an iterator should use still the same output object ! ** filled by statistic data for iterator.next() call. ! ** More about it in #StatDataIterator class. ! ** ! ** @param funcType type of method called ! ** @param objId identifier of object having a data ! ** @param seqType specified action ! ** @param sameOutputObject use still same output object for iterator.next() ! ** @param includeInfo include information about object ! ** @param optionalArg optional argument (depends on type of object) ! ** ! ** @return iterator for objects having statistic data ! ** ! ** @see getAllThruIterator(), getChangedThruIterator(), ! ** StatDataIterator, getChangedOrAll() */ ! ! private Iterator getChangedOrAllThruIterator( int funcType, ! int objId, ! int seqType, ! boolean sameOutputObject, ! boolean includeInfo, ! int optionalArg) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! _buf.clear(); ! _buf.putInt( funcType); ! _buf.putInt( objId); ! _buf.putInt( seqType); ! ! if( includeInfo) _buf.putInt( 1); ! else _buf.putInt( 0); ! ! _buf.putInt( optionalArg); ! ! _commun.write( _buf); ! if( _commun.hasFailed()) throw new COMMUN_Exception(); ! ! _commun.read( _buf); ! if( _commun.hasFailed()) throw new COMMUN_Exception(); ! ! int rc = _buf.getInt( 0); ! ! if( rc < 0) { ! ! if( rc == RC_BAD_OBJ_ID) throw new BAD_OBJ_ID_Exception(); ! if( rc == RC_BAD_COMMAND) throw new BAD_COMMAND_Exception(); ! ! throw new UNKNOWN_Exception(); ! } ! ! Iterator iterator = new StatDataIterator( _buf, sameOutputObject); ! _buf = new Buffer(); ! ! return iterator; ! } ! ! /** Internal implementation of getAll() and getChanged(). This ! ** method is a general implementation of getAll() and getChanged() ! ** methods which generally do the same thing. ! ** ! ** @param funcType type of method called ! ** @param objId identifier of object having a data ! ** @param seqType specified action ! ** @param includeInfo include information about object ! ** @param optionalArg optional argument (depends on type of object) ! ** ! ** @return linked list of sID objects ! ** ! ** @see getAll(), getChanged(), getChangedOrAllThruIterator() */ ! ! private LinkedList getChangedOrAll( int funcType, ! int objId, ! int seqType, ! boolean includeInfo, ! int optionalArg) ! ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! Iterator iterator = getChangedOrAllThruIterator( ! funcType, objId, seqType, false, ! includeInfo, optionalArg); ! ! LinkedList list = new LinkedList(); ! ! while( iterator.hasNext()) { ! ! list.addLast( iterator.next()); } *************** *** 1537,1548 **** ** #CLASS_FIELDS_STATICS, #CLASS_FIELDS_INSTANCES, #CLASS_METHODS, ** #ALLOC_METHOD_TRACES, #ALLOC_METHOD_OBJECTS, #ALLOC_METHOD_THREADS, ! ** #ALLOC_TRACE_OBJECTS, #ALLOC_TRACE_THREADS, #ALLOC_OBJECT_METHODS, ! ** #ALLOC_OBJECT_METHOD_TRACES, #ALLOC_OBJECT_THREADS, ! ** #ALLOC_OBJECT_METHOD_THREADS, #ALLOC_OBJECT_METHOD_TRACE_THREADS, ! ** #ALLOC_THREAD_OBJECTS, #ALLOC_THREAD_OBJECT_METHODS, ! ** #ALLOC_THREAD_OBJECT_METHOD_TRACES, #ALLOC_THREAD_METHODS, ! ** #ALLOC_THREAD_METHOD_TRACES, #ALLOC_THREAD_METHOD_OBJECTS, ! ** #ALLOC_THREAD_METHOD_TRACE_OBJECTS, #CPU_METHOD_TRACES, ! ** #CPU_METHOD_THREADS, #CPU_METHOD_TRACE_THREADS, ** #CPU_THREAD_METHODS, #CPU_THREAD_METHOD_TRACES, ** #MON_METHOD_TRACES, #MON_METHOD_THREADS, --- 1672,1683 ---- ** #CLASS_FIELDS_STATICS, #CLASS_FIELDS_INSTANCES, #CLASS_METHODS, ** #ALLOC_METHOD_TRACES, #ALLOC_METHOD_OBJECTS, #ALLOC_METHOD_THREADS, ! ** #ALLOC_TRACE_OBJECTS, #ALLOC_METHOD_TRACE_THREADS, ! ** #ALLOC_OBJECT_METHODS, #ALLOC_OBJECT_METHOD_TRACES, ! ** #ALLOC_OBJECT_THREADS, #ALLOC_OBJECT_METHOD_THREADS, ! ** #ALLOC_OBJECT_METHOD_TRACE_THREADS, #ALLOC_THREAD_OBJECTS, ! ** #ALLOC_THREAD_OBJECT_METHODS, #ALLOC_THREAD_OBJECT_METHOD_TRACES, ! ** #ALLOC_THREAD_METHODS, #ALLOC_THREAD_METHOD_TRACES, ! ** #ALLOC_THREAD_METHOD_OBJECTS, #ALLOC_THREAD_METHOD_TRACE_OBJECTS, ! ** #CPU_METHOD_TRACES, #CPU_METHOD_THREADS, #CPU_METHOD_TRACE_THREADS, ** #CPU_THREAD_METHODS, #CPU_THREAD_METHOD_TRACES, ** #MON_METHOD_TRACES, #MON_METHOD_THREADS, *************** *** 1561,1565 **** ** @return linked list of sID objects ** ! ** @see getInfo(), getData(), getChanged() */ public synchronized LinkedList getAll( int objId, --- 1696,1702 ---- ** @return linked list of sID objects ** ! ** @see getInfo(), getData(), getAll(), getChanged(), ! ** getAllThruIterator(), getChangedThruIterator(), ! ** getChangedOrAll() */ public synchronized LinkedList getAll( int objId, *************** *** 1579,1583 **** /** Get all objects with all statistic data. ** ! ** @see getAll(), getChanged(), getChangedOrAll() */ public synchronized LinkedList getAll( int objId, int seqType) --- 1716,1721 ---- /** Get all objects with all statistic data. ** ! ** @see getAll(), getChanged(), getChangedOrAll(), ! ** getAllThruIterator(), getChangedThruIterator() */ public synchronized LinkedList getAll( int objId, int seqType) *************** *** 1587,1592 **** BAD_COMMAND_Exception, UNKNOWN_Exception { ! return getChangedOrAll( F_GET_ALL, objId, seqType, false, NO_OPTIONAL_ARG); } --- 1725,1773 ---- BAD_COMMAND_Exception, UNKNOWN_Exception { + + return getChangedOrAll( F_GET_ALL, objId, seqType, + false, NO_OPTIONAL_ARG); + } + + /** Get all objects with all statistic data. + ** + ** @see getAllThruIterator(), getChangedThruIterator(), + ** getChangedOrAllThruIterator(), getAll(), getChanged() */ + + public synchronized + Iterator getAllThruIterator( int objId, + int seqType, + boolean sameOutputObject, + boolean includeInfo, + int optionalArg) + + throws COMMUN_Exception, + BAD_OBJ_ID_Exception, + BAD_COMMAND_Exception, + UNKNOWN_Exception { + + return getChangedOrAllThruIterator( F_GET_ALL, objId, seqType, + sameOutputObject, includeInfo, + optionalArg); + } + + /** Get all objects with all statistic data. + ** + ** @see getAllThruIterator(), getChangedThruIterator(), + ** getChangedOrAllThruIterator(), getAll(), getChanged() */ + + public synchronized + Iterator getAllThruIterator( int objId, + int seqType, + boolean sameOutputObject) ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAllThruIterator( F_GET_ALL, objId, seqType, ! sameOutputObject, false, ! NO_OPTIONAL_ARG); } *************** *** 1601,1612 **** ** #CLASS_FIELDS_STATICS, #CLASS_FIELDS_INSTANCES, #CLASS_METHODS, ** #ALLOC_METHOD_TRACES, #ALLOC_METHOD_OBJECTS, #ALLOC_METHOD_THREADS, ! ** #ALLOC_TRACE_OBJECTS, #ALLOC_TRACE_THREADS, #ALLOC_OBJECT_METHODS, ! ** #ALLOC_OBJECT_METHOD_TRACES, #ALLOC_OBJECT_THREADS, ! ** #ALLOC_OBJECT_METHOD_THREADS, #ALLOC_OBJECT_METHOD_TRACE_THREADS, ! ** #ALLOC_THREAD_OBJECTS, #ALLOC_THREAD_OBJECT_METHODS, ! ** #ALLOC_THREAD_OBJECT_METHOD_TRACES, #ALLOC_THREAD_METHODS, ! ** #ALLOC_THREAD_METHOD_TRACES, #ALLOC_THREAD_METHOD_OBJECTS, ! ** #ALLOC_THREAD_METHOD_TRACE_OBJECTS, #CPU_METHOD_TRACES, ! ** #CPU_METHOD_THREADS, #CPU_METHOD_TRACE_THREADS, ** #CPU_THREAD_METHODS, #CPU_THREAD_METHOD_TRACES, ** #MON_METHOD_TRACES, #MON_METHOD_THREADS, --- 1782,1793 ---- ** #CLASS_FIELDS_STATICS, #CLASS_FIELDS_INSTANCES, #CLASS_METHODS, ** #ALLOC_METHOD_TRACES, #ALLOC_METHOD_OBJECTS, #ALLOC_METHOD_THREADS, ! ** #ALLOC_TRACE_OBJECTS, #ALLOC_METHOD_TRACE_THREADS, ! ** #ALLOC_OBJECT_METHODS, #ALLOC_OBJECT_METHOD_TRACES, ! ** #ALLOC_OBJECT_THREADS, #ALLOC_OBJECT_METHOD_THREADS, ! ** #ALLOC_OBJECT_METHOD_TRACE_THREADS, #ALLOC_THREAD_OBJECTS, ! ** #ALLOC_THREAD_OBJECT_METHODS, #ALLOC_THREAD_OBJECT_METHOD_TRACES, ! ** #ALLOC_THREAD_METHODS, #ALLOC_THREAD_METHOD_TRACES, ! ** #ALLOC_THREAD_METHOD_OBJECTS, #ALLOC_THREAD_METHOD_TRACE_OBJECTS, ! ** #CPU_METHOD_TRACES, #CPU_METHOD_THREADS, #CPU_METHOD_TRACE_THREADS, ** #CPU_THREAD_METHODS, #CPU_THREAD_METHOD_TRACES, ** #MON_METHOD_TRACES, #MON_METHOD_THREADS, *************** *** 1619,1623 **** ** @return linked list of sID objects ** ! ** @see getInfo(), getData(), getAll() */ public synchronized LinkedList getChanged( int objId, --- 1800,1806 ---- ** @return linked list of sID objects ** ! ** @see getInfo(), getData(), getAll(), getChanged(), ! ** getAllThruIterator(), getChangedThruIterator(), ! ** getChangedOrAll() */ public synchronized LinkedList getChanged( int objId, *************** *** 1637,1641 **** /** Get all objects with changed statistic data. ** ! ** @see getChanged(), getAll(), getChangedOrAll() */ public synchronized LinkedList getChanged( int objId, int seqType) --- 1820,1825 ---- /** Get all objects with changed statistic data. ** ! ** @see getChanged(), getAll(), getChangedOrAll(), ! ** getChangedThruIterator(), getAllThruIterator() */ public synchronized LinkedList getChanged( int objId, int seqType) *************** *** 1645,1650 **** BAD_COMMAND_Exception, UNKNOWN_Exception { ! return getChangedOrAll( F_GET_CHANGED, objId, seqType, false, NO_OPTIONAL_ARG); } --- 1829,1877 ---- BAD_COMMAND_Exception, UNKNOWN_Exception { + + return getChangedOrAll( F_GET_CHANGED, objId, seqType, + false, NO_OPTIONAL_ARG); + } + + /** Get all objects with changed statistic data. + ** + ** @see getChangedThruIterator(), getAllThruIterator(), + ** getChangedOrAllThruIterator(), getChanged(), getAll() */ + + public synchronized + Iterator getChangedThruIterator( int objId, + int seqType, + boolean sameOutputObject, + boolean includeInfo, + int optionalArg) + + throws COMMUN_Exception, + BAD_OBJ_ID_Exception, + BAD_COMMAND_Exception, + UNKNOWN_Exception { + + return getChangedOrAllThruIterator( F_GET_CHANGED, objId, seqType, + sameOutputObject, includeInfo, + optionalArg); + } + + /** Get all objects with changed statistic data. + ** + ** @see getChangedThruIterator(), getAllThruIterator(), + ** getChangedOrAllThruIterator(), getChanged(), getAll() */ + + public synchronized + Iterator getChangedThruIterator( int objId, + int seqType, + boolean sameOutputObject) ! throws COMMUN_Exception, ! BAD_OBJ_ID_Exception, ! BAD_COMMAND_Exception, ! UNKNOWN_Exception { ! ! return getChangedOrAllThruIterator( F_GET_CHANGED, objId, seqType, ! sameOutputObject, false, ! NO_OPTIONAL_ARG); } *************** *** 1738,1776 **** } } ! ! /** Returns true if operation extracts objets, which have their own info. ! **(I can call getInfo or getAll with 'includeInfo' argument for them) ! ** ! ** @param opType type of operation for getAll()/getChanged() methods ! ** ! ** @return true if operation extracts objets, which have their own info. ! ** ! ** @see getChanged(), getData(), getAll(), getInfo() ! **/ ! public static boolean isObjWithInfo( int opType ) { ! switch( opType) { ! ! case CLASSES: ! case METHODS: ! case CLASS_METHODS: ! case CPU_METHOD_TRACES: ! case ALLOC_METHOD_TRACES: ! case MON_METHOD_TRACES: ! case CPU_TRACES: ! case ALLOC_TRACES: ! case MON_TRACES: ! case OBJECT_TYPES: ! case GROUPS_OF_THREADS: ! case GROUP_THREADS: ! case THREADS: ! //?? ! case CLASS_FIELDS_STATICS: ! case CLASS_FIELDS_INSTANCES: ! ! return true; ! ! default: ! return false; ! } ! } }; --- 1965,2027 ---- } } ! ! /** Returns true if operation extracts objects which have their own info. ! ** (so getInfo() or getAll()/getChanged() methods with 'includeInfo' argument ! ** set to 'true' can be called for them). ! ** ! ** @param opType type of operation for getAll()/getChanged() methods ! ** ! ** @return true (operation extracts objects which have their own info); ! ** false ! ** ! ** @see getChanged(), getAll(), getInfo(), ! ** getChangedThruIterator(), getAllThruIterator() */ ! ! public static boolean isObjWithInfo( int opType) { ! ! switch( opType) { ! ! // info in sClassInfo ! case CLASSES: ! ! // info in sClassFieldInfo ! case CLASS_FIELDS_STATICS: ! case CLASS_FIELDS_INSTANCES: ! ! // info in sMethodInfo ! case CLASS_METHODS: ! case METHODS: ! ! // info in sTraceInfo ! case ALLOC_METHOD_TRACES: ! case CPU_METHOD_TRACES: ! case MON_METHOD_TRACES: ! ! case ALLOC_TRACES: ! case CPU_TRACES: ! case MON_TRACES: ! ! // info in sObjectInfo ! case OBJECT_TYPES: ! ! // info in sThreadGroupInfo ! case GROUPS_OF_THREADS: ! ! // info in sThreadInfo ! case GROUP_THREADS: ! case THREADS: ! ! // info in sArenaInfo ! case ARENAS: ! ! // info in sGCInfo ! case GCS: ! ! return true; ! ! default: ! ! return false; ! } ! } }; Index: IProfException.java =================================================================== RCS file: /cvsroot/javaprofiler/jpiimpl/net/sourceforge/javaprofiler/jpiimpl/commun/IProfException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** IProfException.java 2001/11/21 22:05:55 1.2 --- IProfException.java 2001/12/03 15:49:56 1.3 *************** *** 41,45 **** ** @see BAD_COMMAND_Exception, BAD_DATA_TYPE_Exception, ** BAD_INFO_ID_Exception, BAD_INFO_TYPE_Exception, ! ** BAD_OBJ_ID_Exception, COMMUN_Exception, UNKNOWN_Exception ** ** @author Marek Przeczek */ --- 41,46 ---- ** @see BAD_COMMAND_Exception, BAD_DATA_TYPE_Exception, ** BAD_INFO_ID_Exception, BAD_INFO_TYPE_Exception, ! ** BAD_OBJ_ID_Exception, COMMUN_Exception, UNKNOWN_Exception, ! ** UNAVAILABLE_Exception ** ** @author Marek Przeczek */ |