/** * Interface method implementation. Creates and loads a Spring ApplicationContext for each * property specified in {@link #getAllProperties()} * * @see org.trpr.platform.runtime.spi.bootstrapext.BootstrapExtension#init() */ public void init() { // Iterate through the properties to get ApplicationContext name and the corresponding file name for (String key : this.getAllProperties().keySet()) { String fileName = this.getAllProperties().get(key); try { File springBeansFile = FileLocator.findUniqueFile(fileName); // add the "file:" prefix to file names to get around strange behavior of // FileSystemXmlApplicationContext that converts // absolute path to relative path // Set the commons beans context as the parent of all application contexts created through // this ApplicationContextFactory AbstractApplicationContext appContext = new FileSystemXmlApplicationContext( new String[] {FILE_PREFIX + springBeansFile.getAbsolutePath()}, getCommonBeansContext()); ApplicationContextFactory.appContextMap.put(key.toLowerCase(), appContext); } catch (Exception e) { // blanket catch for all checked and unchecked exceptions LOGGER.error( "Error loading ApplicationContext. [Name][Path] : [" + key + "][" + fileName + "].Error is : " + e.getMessage(), e); this.bootstrapOutcome = BootstrapExtension.VETO_BOOTSTRAP; return; } } }