1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.example.errorhandler; |
12 | |
|
13 | |
import org.mule.config.i18n.MessageFactory; |
14 | |
import org.mule.util.ObjectUtils; |
15 | |
import org.mule.util.StringMessageUtils; |
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | 0 | public class LocaleMessage extends MessageFactory |
23 | |
{ |
24 | |
private static final String BUNDLE_PATH = "messages.errorhandler-example-messages"; |
25 | |
|
26 | |
public static String unretrievedException(Exception e) |
27 | |
{ |
28 | 0 | return getString(BUNDLE_PATH, 1, e); |
29 | |
} |
30 | |
|
31 | |
public static String unhandledException(Class class1, Class class2) |
32 | |
{ |
33 | 0 | return getString(BUNDLE_PATH, 2, StringMessageUtils.toString(class1), |
34 | |
StringMessageUtils.toString(class2)); |
35 | |
} |
36 | |
|
37 | |
public static String businessErrorManagerError() |
38 | |
{ |
39 | 0 | return getString(BUNDLE_PATH, 3); |
40 | |
} |
41 | |
|
42 | |
public static String errorDetail(String detailMessage) |
43 | |
{ |
44 | 0 | return getString(BUNDLE_PATH, 4, detailMessage); |
45 | |
} |
46 | |
|
47 | |
public static String errorClass(Class class1) |
48 | |
{ |
49 | 0 | return getString(BUNDLE_PATH, 5, class1.getName()); |
50 | |
} |
51 | |
|
52 | |
public static String handlerFailure(ExceptionHandler eh) |
53 | |
{ |
54 | 0 | String handlerDescription = ObjectUtils.toString(eh.getClass().getName(), "null"); |
55 | 0 | return getString(BUNDLE_PATH, 6, handlerDescription); |
56 | |
} |
57 | |
|
58 | |
public static String defaultFatalHandling(Class class1) |
59 | |
{ |
60 | 0 | return getString(BUNDLE_PATH, 7, StringMessageUtils.toString(class1)); |
61 | |
} |
62 | |
|
63 | |
public static String fatalHandling(Exception e) |
64 | |
{ |
65 | 0 | return getString(BUNDLE_PATH, 8, e); |
66 | |
} |
67 | |
|
68 | |
public static String defaultHandling(Class class1, ExceptionHandler eh, Exception e) |
69 | |
{ |
70 | 0 | return getString(BUNDLE_PATH, 9, StringMessageUtils.toString(class1), |
71 | |
ObjectUtils.toString(eh.getClass().getName() + " : " + e, "null")); |
72 | |
} |
73 | |
|
74 | |
public static String defaultException(Exception e) |
75 | |
{ |
76 | 0 | return getString(BUNDLE_PATH, 10, e); |
77 | |
} |
78 | |
|
79 | |
public static String defaultHandlerException(HandlerException e) |
80 | |
{ |
81 | 0 | return getString(BUNDLE_PATH, 11, e); |
82 | |
} |
83 | |
|
84 | |
public static String fatalException(Throwable t) |
85 | |
{ |
86 | 0 | return getString(BUNDLE_PATH, 12, t); |
87 | |
} |
88 | |
|
89 | |
public static String businessHandlerMessage() |
90 | |
{ |
91 | 0 | return getString(BUNDLE_PATH, 13); |
92 | |
} |
93 | |
|
94 | |
public static String defaultHandlerMessage() |
95 | |
{ |
96 | 0 | return getString(BUNDLE_PATH, 14); |
97 | |
} |
98 | |
|
99 | |
public static String fatalHandlerMessage() |
100 | |
{ |
101 | 0 | return getString(BUNDLE_PATH, 15); |
102 | |
} |
103 | |
|
104 | |
public static String fatalHandlerException(Throwable t) |
105 | |
{ |
106 | 0 | return getString(BUNDLE_PATH, 16, t); |
107 | |
} |
108 | |
} |