2009/05/20 - Apache Shale has been retired.
For more information, please explore the Attic.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shale.view;
19
20 import java.util.ArrayList;
21 import java.util.List;
22
23 /***
24 * <p>Runtime exception encapsulating a <code>List</code> of exceptions that
25 * have occurred during the request processing lifecycle.</p>
26 *
27 * @since 1.0.3
28 */
29 public class ApplicationException extends RuntimeException {
30
31
32
33
34
35 /***
36 * Serial version UID.
37 */
38 private static final long serialVersionUID = 2180307410483666456L;
39
40
41 /***
42 * <p>Construct an exception with no message.</p>
43 */
44 public ApplicationException() {
45 super();
46 }
47
48
49
50 /***
51 * <p>Construct an exception with the specified message.</p>
52 *
53 * @param message The exception message
54 */
55 public ApplicationException(String message) {
56 super(message);
57 }
58
59
60 /***
61 * <p>Construct an exception with the specified message and cause.</p>
62 *
63 * @param message The exception message
64 * @param cause The root cause
65 */
66 public ApplicationException(String message, Throwable cause) {
67 super(message, cause);
68 this.exceptions = new ArrayList(1);
69 this.exceptions.add(cause);
70 }
71
72
73 /***
74 * <p>Construct an exception with the specified cause.</p>
75 *
76 * @param cause The root cause
77 */
78 public ApplicationException(Throwable cause) {
79 super(cause);
80 this.exceptions = new ArrayList(1);
81 this.exceptions.add(cause);
82 }
83
84
85 /***
86 * <p>Construct an exception with the specified <code>List</code> of
87 * causes. The first exception in the list will be logged as the
88 * formal cause of this exception.</p>
89 *
90 * @param exceptions List of exceptions that have been thrown
91 */
92 public ApplicationException(List exceptions) {
93 super((Exception) exceptions.get(0));
94 this.exceptions = exceptions;
95 }
96
97
98
99
100
101 /***
102 * <p><code>List</code> of exceptions that are the cumulative cause of
103 * this exception.</p>
104 */
105 private List exceptions;
106
107
108 /***
109 * <p>Return a <code>List</code> of exceptoins that are the cumulative
110 * cause of this exception.</p>
111 */
112 public List getExceptions() {
113 return this.exceptions;
114 }
115
116
117 }