Lines 25-33
Link Here
|
25 |
import java.io.FileInputStream; |
25 |
import java.io.FileInputStream; |
26 |
import java.io.FileNotFoundException; |
26 |
import java.io.FileNotFoundException; |
27 |
import java.io.IOException; |
27 |
import java.io.IOException; |
|
|
28 |
import java.util.Iterator; |
29 |
import java.util.List; |
28 |
import java.util.Properties; |
30 |
import java.util.Properties; |
29 |
|
31 |
|
30 |
import org.apache.jorphan.logging.LoggingManager; |
32 |
import org.apache.jorphan.logging.LoggingManager; |
|
|
33 |
import org.apache.jorphan.reflect.ClassFinder; |
31 |
import org.apache.jorphan.util.JOrphanUtils; |
34 |
import org.apache.jorphan.util.JOrphanUtils; |
32 |
import org.apache.log.Logger; |
35 |
import org.apache.log.Logger; |
33 |
|
36 |
|
Lines 53-59
Link Here
|
53 |
} finally { |
56 |
} finally { |
54 |
JOrphanUtils.closeQuietly(fis); |
57 |
JOrphanUtils.closeQuietly(fis); |
55 |
} |
58 |
} |
|
|
59 |
|
60 |
//add additional translation rules from plugins |
61 |
try { |
62 |
List<String> additionalNameMapClasses = ClassFinder.findClassesThatExtend(JMeterUtils.getSearchPaths(), new Class[]{ |
63 |
AdditionalNameUpdaterInterface.class}); |
64 |
Iterator<String> iter = additionalNameMapClasses.iterator(); |
65 |
while (iter.hasNext()) { |
66 |
String name = iter.next(); |
67 |
AdditionalNameUpdaterInterface c = (AdditionalNameUpdaterInterface) Class.forName(name).newInstance(); |
68 |
Properties map = c.getNameMap(); |
69 |
Iterator<String> items = map.stringPropertyNames().iterator(); |
70 |
while (items.hasNext()) { |
71 |
String key = items.next(); |
72 |
if (!nameMap.contains(key)) { |
73 |
nameMap.put(key, map.get(key)); |
74 |
log.info("Added additional nameMap entry: " + key); |
75 |
} else { |
76 |
log.warn("Additional nameMap entry: '" + key + "' rejected as already defined."); |
56 |
} |
77 |
} |
|
|
78 |
} |
79 |
} |
80 |
} catch (IOException e) { |
81 |
log.error("", e); |
82 |
} catch (ClassNotFoundException e) { |
83 |
log.error("", e); |
84 |
} catch (InstantiationException e) { |
85 |
log.error("", e); |
86 |
} catch (IllegalAccessException e) { |
87 |
log.error("", e); |
88 |
} |
89 |
} |
57 |
|
90 |
|
58 |
public static String getCurrentName(String className) { |
91 |
public static String getCurrentName(String className) { |
59 |
if (nameMap.containsKey(className)) { |
92 |
if (nameMap.containsKey(className)) { |