1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package javax.xml.rpc;
17
18 /**
19 * The <code>javax.xml.rpc.JAXRPCException</code> is thrown from
20 * the core JAX-RPC APIs to indicate an exception related to the
21 * JAX-RPC runtime mechanisms.
22 *
23 * @version 1.0
24 */
25 public class JAXRPCException extends RuntimeException {
26
27
28
29 /** The cause of this error. */
30 Throwable cause;
31
32 /**
33 * Constructs a new exception with <code>null</code> as its
34 * detail message. The cause is not initialized.
35 */
36 public JAXRPCException() {}
37
38 /**
39 * Constructs a new exception with the specified detail
40 * message. The cause is not initialized.
41 *
42 * @param message The detail message which is later
43 * retrieved using the getMessage method
44 */
45 public JAXRPCException(String message) {
46 super(message);
47 }
48
49 /**
50 * Constructs a new exception with the specified detail
51 * message and cause.
52 *
53 * @param message The detail message which is later retrieved
54 * using the getMessage method
55 * @param cause The cause which is saved for the later
56 * retrieval throw by the getCause method
57 */
58 public JAXRPCException(String message, Throwable cause) {
59 super(message);
60 this.cause = cause;
61 }
62
63 /**
64 * Constructs a new JAXRPCException with the specified cause
65 * and a detail message of <tt>(cause==null ? null :
66 * cause.toString())</tt> (which typically contains the
67 * class and detail message of <tt>cause</tt>).
68 *
69 * @param cause The cause which is saved for the later
70 * retrieval throw by the getCause method.
71 * (A <tt>null</tt> value is permitted, and
72 * indicates that the cause is nonexistent or
73 * unknown.)
74 */
75 public JAXRPCException(Throwable cause) {
76 super( (cause == null) ? null : cause.toString() );
77 this.cause = cause;
78 }
79
80 /**
81 * Gets the linked cause.
82 *
83 * @return The cause of this Exception or <code>null</code>
84 * if the cause is noexistent or unknown
85 */
86 public Throwable getLinkedCause() {
87 return cause;
88 }
89
90 }