Changeset 359


Ignore:
Timestamp:
01/27/12 11:19:08 (12 years ago)
Author:
sherbold
Message:
  • adapted de.ugoe.cs.eventbench.jfc.data.JFCEvent and de.ugoe.cs.eventbench.jfc.JFCLogParser create JFCEvents with more detailed information about the message target
Location:
trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/JFCLogParser.java

    r353 r359  
    5858         */ 
    5959        private List<JFCEvent> currentSequence = null; 
     60         
     61        /** 
     62         * <p> 
     63         * Internally used string to build a string representing a component-node. 
     64         * </p> 
     65         */ 
     66        private String componentString; 
    6067 
    6168        /** 
     
    6976         */ 
    7077        private enum ParamSource { 
    71                 EVENT, SOURCE, PARENT 
     78                EVENT, SOURCE, PARENT, COMPONENT 
    7279        }; 
    7380 
     
    132139                                currentEvent.addParentInformation(atts.getValue("name"), 
    133140                                                atts.getValue("value")); 
     141                        } else if (paramSource == ParamSource.COMPONENT) { 
     142                                componentString += "'" + atts.getValue("value") + "',"; 
    134143                        } 
    135144                } else if (qName.equals("source")) { 
     
    137146                } else if (qName.equals("parent")) { 
    138147                        paramSource = ParamSource.PARENT; 
     148                } else if (qName.equals("component")) { 
     149                        paramSource = ParamSource.COMPONENT; 
     150                        componentString = "["; 
    139151                } 
    140152        } 
     
    160172                        } 
    161173                        currentSequence = null; 
     174                } else if (qName.equals("component")) { 
     175                        paramSource.equals(ParamSource.SOURCE); 
     176                        currentEvent.extendTarget(componentString.substring(0, componentString.length()-1)+"]"); 
    162177                } 
    163178        } 
  • trunk/EventBenchConsole/src/de/ugoe/cs/eventbench/jfc/data/JFCEvent.java

    r318 r359  
    66import de.ugoe.cs.eventbench.data.IReplayable; 
    77import de.ugoe.cs.eventbench.data.ReplayableEvent; 
     8import de.ugoe.cs.eventbench.jfc.JFCLogParser; 
    89 
    910/** 
     
    9899         */ 
    99100        public void addSourceInformation(String name, String value) { 
    100                 if( "toString".equals(name) ) { 
    101                         setTarget(value); 
    102                 } 
    103101                sourceParameters.put(name, value); 
    104102        } 
     
    129127        public void addParentInformation(String name, String value) { 
    130128                parentParameters.put(name, value); 
     129        } 
     130 
     131        /** 
     132         * <p> 
     133         * Used by the {@link JFCLogParser} to extend the target string of the 
     134         * current event with a further ancestor. The resulting target string will 
     135         * have the structure {@code etc.grandparent.parent.eventtarget}. 
     136         * </p> 
     137         *  
     138         * @param extension 
     139         *            extension for the target. 
     140         */ 
     141        public void extendTarget(String extension) { 
     142                if (target == null || "".equals(target)) { 
     143                        target = extension; 
     144                } else { 
     145                        target += "." + extension; 
     146                } 
    131147        } 
    132148 
Note: See TracChangeset for help on using the changeset viewer.