/** shuts down the report engine */ public void destroy() { logger.fine("ReportEngine.destroy"); rootScope = null; helper = null; synchronized (openedDocuments) { for (ReportDocumentReader document : openedDocuments) { logger.log(Level.WARNING, "{0} is not closed.", document.getName()); document.setEngineCacheEntry(null); document.close(); } openedDocuments.clear(); } IStatusHandler handler = config.getStatusHandler(); if (handler != null) { handler.finish(); } if (extensionManager != null) { extensionManager.close(); extensionManager = null; } EngineLogger.removeSetting(loggerSetting); if (engineClassLoader != null) { engineClassLoader.close(); } }
/** * Create a Report Engine using a configuration. * * <p>The user must set the BIRT_HOME in the EngineConfig. * * @param config an engine configuration object used to configure the engine */ public ReportEngine(EngineConfig config) { if (config == null) { throw new NullPointerException("config is null"); } this.config = config; beans = new HashMap<String, Object>(); mergeConfigToAppContext(); intializeLogger(); logger.log(Level.FINE, "ReportEngine created. EngineConfig: {0} ", config); this.helper = new ReportEngineHelper(this); openedDocuments = new LinkedObjectManager<ReportDocumentReader>(); IStatusHandler handler = config.getStatusHandler(); if (handler != null) { handler.initialize(); } }