// load factory
String factoryName = Util.getValue("factory.name");
String prefix = "factory." + factoryName + ".";
String className = Util.getValue(prefix + "classname");
StatisticsFactory factory =
(StatisticsFactory) Util.createObject(className);
Properties p = Util.createProperties(prefix);
factory.init(p);
// load stats to collect/calculate
Statistic[] stats = factory.loadStatistics();
// load alerts
Alert[] alerts = factory.loadAlerts();
for (int i = 0; i < alerts.length; ++i) {
Alert a = alerts[i];
this.alerts.put(a.getStatisticName(), a);
}
HashMap filterMap = new HashMap();
// Map statistics
for (int i = 0; i < stats.length; ++i) {
Statistic s = stats[i];
statistics.put(s.getName(), s);
Calculator c = factory.createCalculator(s.getCalculator(), s);
calculators.put(s.getName(), c);
// Map filters by regexpression
// to ensure we only match on a given
// expression once