protected void writeReport()

in src/java/org/apache/fulcrum/yaafi/interceptor/jamon/JamonInterceptorServiceImpl.java [272:298]


	protected void writeReport(File reportFile) {
		PrintWriter printWriter = null;

		if (this.isJamonAvailable()) {
			try {
				if (this.getLogger().isDebugEnabled()) {
					this.getLogger().debug("Writing JAMOM report to " + reportFile.getAbsolutePath());
				}

				// Update to eliminate reliance on default encoding (DM_DEFAULT_ENCODING)
				Writer w = new OutputStreamWriter(new FileOutputStream(reportFile), "UTF-8");
				printWriter = new PrintWriter(w);

				JamonPerformanceMonitor monitor = this.createJamonPerformanceMonitor(null, null, true);
				String report = monitor.createReport();
				printWriter.write(report);
				printWriter.close();
			} catch (Throwable t) {
				String msg = "Generating the JAMON report failed for " + reportFile.getAbsolutePath();
				this.getLogger().error(msg, t);
			} finally {
				if (printWriter != null) {
					printWriter.close();
				}
			}
		}
	}