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.ServiceException</code> is thrown from the
20 * methods in the <code>javax.xml.rpc.Service</code> interface and
21 * <code>ServiceFactory</code> class.
22 *
23 *
24 * @version 1.0
25 */
26 public class ServiceException extends Exception {
27
28
29
30 /** The cause of this exception. */
31 Throwable cause;
32
33 /**
34 * Constructs a new exception with <code>null</code> as its
35 * detail message. The cause is not initialized.
36 */
37 public ServiceException() {}
38
39 /**
40 * Constructs a new exception with the specified detail
41 * message. The cause is not initialized.
42 *
43 * @param message The detail message which is later
44 * retrieved using the <code>getMessage</code> method
45 */
46 public ServiceException(String message) {
47 super(message);
48 }
49
50 /**
51 * Constructs a new exception with the specified detail
52 * message and cause.
53 *
54 * @param message the detail message which is later retrieved
55 * using the <code>getMessage</code> method
56 * @param cause the cause which is saved for the later
57 * retrieval throw by the <code>getCause</code>
58 * method
59 */
60 public ServiceException(String message, Throwable cause) {
61 super(message);
62 this.cause = cause;
63 }
64
65 /**
66 * Constructs a new exception with the specified cause
67 * and a detail message of <tt>(cause==null ? null :
68 * cause.toString())</tt> (which typically contains the
69 * class and detail message of <tt>cause</tt>).
70 *
71 * @param cause the cause which is saved for the later
72 * retrieval throw by the getCause method.
73 * (A <tt>null</tt> value is permitted, and
74 * indicates that the cause is nonexistent or
75 * unknown.)
76 */
77 public ServiceException(Throwable cause) {
78 super( (cause == null) ? null : cause.toString() );
79 this.cause = cause;
80 }
81
82 /**
83 * Gets the linked cause.
84 *
85 * @return the cause of this Exception or <code>null</code>
86 * if the cause is noexistent or unknown
87 */
88 public Throwable getLinkedCause() {
89 return cause;
90 }
91
92 }