/**
* Create the exception analyzer.
* @return the exception analyzer.
*/
public static ExceptionAnalyzer getExceptionAnalyzer() {
ExceptionAnalyzer analyzer = exceptionAnalyzerRef.get();
if (analyzer == null) {
String exceptionAnalyzerName = getConfiguration().getExceptionAnalyzer();
analyzer = new DefaultExceptionAnalyzer();
if (exceptionAnalyzerName != null) {
try {
analyzer = (ExceptionAnalyzer) ClassLoaderUtils.loadClass(exceptionAnalyzerName).newInstance();
} catch (Exception ex) {
log.warn("failed to initialize custom exception analyzer, using default one instead", ex);
}
}
if (!exceptionAnalyzerRef.compareAndSet(null, analyzer)) {
analyzer.shutdown();
analyzer = exceptionAnalyzerRef.get();
}
}
return analyzer;
}