hps-java/src/main/java/org/lcsim/hps/monitoring
diff -u -r1.1 -r1.2
--- MonitoringAnalysisFactory.java 5 Jun 2012 18:21:06 -0000 1.1
+++ MonitoringAnalysisFactory.java 5 Jun 2013 19:06:43 -0000 1.2
@@ -3,12 +3,17 @@
import hep.aida.IPlotterFactory;
import hep.aida.ref.AnalysisFactory;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author Jeremy McCormick <[log in to unmask]>
- * @version $Id: MonitoringAnalysisFactory.java,v 1.1 2012/06/05 18:21:06 jeremy Exp $
+ * @version $Id: MonitoringAnalysisFactory.java,v 1.2 2013/06/05 19:06:43 jeremy Exp $
*/
public class MonitoringAnalysisFactory extends AnalysisFactory {
-
+
+ Map<String,IPlotterFactory> plotFactories = new HashMap<String,IPlotterFactory>();
+
/**
* Register this class as the default AnalysisFactory for AIDA by setting the magic property string.
*/
@@ -17,10 +22,13 @@
}
/**
- * Create a named plotter factory for the monitoring application.
+ * Create a named plotter factory for the monitoring application.
*/
public IPlotterFactory createPlotterFactory(String name) {
- return new MonitoringPlotFactory(name);
+ if (plotFactories.get(name) == null) {
+ plotFactories.put(name, new MonitoringPlotFactory(name));
+ }
+ return plotFactories.get(name);
}
/**