1
2
3
4
5
6
7
8
9
10
11 package org.mule.samples.errorhandler;
12
13 import java.util.HashMap;
14 import java.util.Map;
15
16
17
18
19 public class ErrorMessage
20 {
21
22 private ExceptionBean exception;
23
24 private Throwable throwable;
25
26 private Map properties = new HashMap();
27
28
29
30
31 public ErrorMessage()
32 {
33 super();
34 }
35
36 public ErrorMessage(ExceptionBean exception) throws InstantiationException
37 {
38 setException(exception);
39 }
40
41 public ErrorMessage(Throwable exception)
42 {
43 setThrowable(exception);
44 }
45
46 public ErrorMessage(Throwable exception, Map props)
47 {
48 setThrowable(exception);
49 setProperties(props);
50 }
51
52
53
54
55 public ExceptionBean getException()
56 {
57 return exception;
58 }
59
60
61
62
63 public void setException(ExceptionBean exception) throws InstantiationException
64 {
65 this.exception = exception;
66 throwable = exception.toException();
67 }
68
69
70
71
72 public Map getProperties()
73 {
74 return properties;
75 }
76
77
78
79
80 public void setProperties(Map properties)
81 {
82 this.properties = properties;
83 }
84
85
86
87
88 public Throwable getThrowable()
89 {
90 return throwable;
91 }
92
93
94
95
96 public void setThrowable(Throwable throwable)
97 {
98 this.throwable = throwable;
99 exception = new ExceptionBean(throwable);
100 }
101
102 }