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