// che qualcuno ha chiamato la getGlobalInstance passando null E
// non era ancora stata creata una istanza del Monitor. Questo e'
// sintomo di errore, quindi fermo tutto!
if (cfg == null) {
logger.fatal("Monitor.getGlobalInstance called for the first time with null parameter! FATAL ERROR!");
throw new CannotCompileException("Monitor.getGlobalInstance called for the first time with null parameter! FATAL ERROR!");
}
theLoader = thaLoader;
try {
cfgFile = SystemEnvironmentVariables.getEnvironmentVariable("JAFIMON_HOME") + File.separator + "data" + File.separator + "configurations" + File.separator + cfg.getName();
} catch (IOException e1) {
throw new CannotCompileException(cfgFile,e1);
}
// Ora effettuo il parsing della configurazione ed inizializzo
// gli oggetti necessari
theTranslator = new CustomTranslator();
SAXParser parser;
ConfigurationSAXParser ch = new ConfigurationSAXParser(theTranslator,thePool);
try {
parser = SAXParserFactory.newInstance().newSAXParser();
parser.parse(cfgFile, ch);
} catch (ParserConfigurationException e1) {
throw new CannotCompileException(cfgFile,e1);
} catch (SAXException e1) {
throw new CannotCompileException(cfgFile,e1);
} catch (FactoryConfigurationError e1) {
throw new CannotCompileException(cfgFile,e1);
} catch (IOException e) {
throw new CannotCompileException(cfgFile,e);
}
theLoader.addTranslator(thePool, theTranslator); // Chiama xlat.start()
}