1 /***
2 * JFoxSOAF, Service-Oriented Application Framework
3 *
4 * Copyright (C) www.huihoo.org
5 *
6 * Distributable under GNU LGPL license
7 *
8 * For more information, please visit: http://www.huihoo.org/jfox/jfoxsoaf
9 */
10
11 package org.huihoo.jfox.soaf.exception;
12
13 /***
14 * Superclass for all checked Exceptions in JFoxSOAF.
15 *
16 * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
17 * @version $Revision: 1.1 $ $Date: 2004/10/20 07:23:15 $
18 * @version Revision: 1.0
19 */
20
21 public abstract class NestedCheckedException extends Exception {
22
23 /***
24 * The exception that caused this one.
25 */
26 private Throwable cause;
27
28 /***
29 * Construct a new exception with no cause and no detail message. Note
30 * modern JVMs may still track the exception that caused this one.
31 */
32 protected NestedCheckedException() {
33 }
34
35 /***
36 * Construct a new exception with no cause and the specified detail message.
37 * Note modern JVMs may still track the exception that caused this one.
38 *
39 * @param message
40 * the message detailing the exception.
41 */
42 protected NestedCheckedException(final String message) {
43 super(message);
44 }
45
46 /***
47 * Construct a new exception with the specified cause and no detail message.
48 *
49 * @param cause
50 * the exception that caused this one.
51 */
52 protected NestedCheckedException(final Throwable cause) {
53 this.cause = cause;
54 }
55
56 /***
57 * Construct a new exception with the specified cause and the specified
58 * detail message.
59 *
60 * @param message
61 * the message detailing the exception.
62 * @param cause
63 * the exception that caused this one.
64 */
65 protected NestedCheckedException(final String message, final Throwable cause) {
66 super(message);
67 this.cause = cause;
68 }
69
70 /***
71 * Retrieve the exception that caused this one.
72 *
73 * @return the exception that caused this one, or null if it was not set.
74 * @see Throwable#getCause() the method available since JDK 1.3 that is
75 * overridden by this method.
76 */
77 public Throwable getCause() {
78 return cause;
79 }
80
81 }