01: package com.rimfaxe.thread;
02:
03: import java.io.FileInputStream;
04: import java.util.Enumeration;
05: import java.util.Properties;
06:
07: /** This class is the ReportingExceptionHandler. It is used to handle all Exceptions.
08: * It adds severities and then sends them to the ReportingLogger.
09: */
10:
11: public class ReportingExceptionHandler extends Object {
12: /* Members -------------------------------------------------------------- */
13:
14: /* Constructors --------------------------------------------------------- */
15: /** Creates new ReportingExceptionHandler
16: */
17: public ReportingExceptionHandler() {
18: // ConfigManager must already be initialized
19: }
20:
21: /* External Functions --------------------------------------------------- */
22:
23: /** processes a Reporting exception
24: */
25: public static void processException(
26: ReportingException aReportingException) {
27:
28: try {
29:
30: ReportingException lReportingException = aReportingException;
31: String lStackTrace = null;
32: Throwable lNestedException = lReportingException
33: .getNestedException();
34: String lKey = lReportingException.getMessage();
35: ReportingLogger.logError(lKey);
36:
37: // gives back identifying key for the exception
38: while (lNestedException != null) {
39: lReportingException = (ReportingException) lNestedException;
40: lNestedException = lReportingException
41: .getNestedException();
42: lKey = lReportingException.getMessage();
43: ReportingLogger.logError(lKey);
44: }
45:
46: lStackTrace = lReportingException.getTrace();
47: ReportingLogger.logError(lStackTrace);
48:
49: } catch (Exception eException) {
50: System.out.println("Exception Handler eException");
51: ReportingLogger.logError(eException.getMessage());
52:
53: }
54: }
55: }
|