/** * Handle all statistics AFTER the context was shut down. Depending on {@link * #isHandleStatisticsOnEnd()} this method is called or not. */ @OverrideOnDemand protected void handleStatisticsOnEnd() { // serialize statistics try { final File aDestPath = WebFileIO.getDataIO().getFile(getStatisticsFilename()); final IMicroDocument aDoc = StatisticsExporter.getAsXMLDocument(); aDoc.getDocumentElement().setAttribute("location", "shutdown"); aDoc.getDocumentElement() .setAttribute( "datetime", PDTWebDateHelper.getAsStringXSD(PDTFactory.getCurrentDateTime())); SimpleFileIO.writeFile( aDestPath, MicroWriter.getXMLString(aDoc), XMLWriterSettings.DEFAULT_XML_CHARSET_OBJ); } catch (final Throwable t) { s_aLogger.error("Failed to write statistics on context shutdown.", t); } }