private void updateConfiguration() { if (config != null && config.getModificationCount() != configExpectedMod) { configExpectedMod = config.getModificationCount(); // Update the debug flag protocolManager.setDebug(config.isDebug()); } }
@Override protected Report filterReport(Object sender, Report report, boolean detailed) { try { String canonicalName = ReportType.getReportName(sender, report.getType()); String reportName = Iterables.getLast(Splitter.on("#").split(canonicalName)).toUpperCase(); if (config != null && config.getModificationCount() != lastModCount) { // Update our cached set again reports = Sets.newHashSet(config.getSuppressedReports()); lastModCount = config.getModificationCount(); } // Cancel reports either on the full canonical name, or just the report name if (reports.contains(canonicalName) || reports.contains(reportName)) return null; } catch (Exception e) { // Only report this with a minor message logger.warning("Error filtering reports: " + e.toString()); } // Don't filter anything return report; } };