01: /*
02: *
03: * Copyright 1990-2007 Sun Microsystems, Inc. All Rights Reserved.
04: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License version
08: * 2 only, as published by the Free Software Foundation.
09: *
10: * This program is distributed in the hope that it will be useful, but
11: * WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * General Public License version 2 for more details (a copy is
14: * included at /legal/license.txt).
15: *
16: * You should have received a copy of the GNU General Public License
17: * version 2 along with this work; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
22: * Clara, CA 95054 or visit www.sun.com if you need additional
23: * information or have any questions.
24: */
25:
26: package javax.xml.rpc;
27:
28: /** The <code>javax.xml.rpc.JAXRPCException</code> is thrown from
29: * the core JAX-RPC APIs to indicate an exception related to the
30: * JAX-RPC runtime mechanisms.
31: *
32: * @version 1.0
33: **/
34:
35: public class JAXRPCException extends java.lang.RuntimeException {
36:
37: /** The Throwable associated with this rpc exception */
38: private Throwable cause;
39:
40: /** Constructs a new exception with <code>null</code> as its
41: * detail message. The cause is not initialized.
42: **/
43: public JAXRPCException() {
44: super ();
45: }
46:
47: /** Constructs a new exception with the specified detail
48: * message. The cause is not initialized.
49: * @param message The detail message which is later
50: * retrieved using the getMessage method
51: **/
52: public JAXRPCException(String message) {
53: super (message);
54: }
55:
56: /** Constructs a new exception with the specified detail
57: * message and cause.
58: *
59: * @param message The detail message which is later retrieved
60: * using the getMessage method
61: * @param cause The cause which is saved for the later
62: * retrieval throw by the getLinkedCause method
63: **/
64: public JAXRPCException(String message, Throwable cause) {
65: super (message);
66: this .cause = cause;
67: }
68:
69: /** Constructs a new JAXRPCException with the specified cause
70: * and a detail message of <tt>cause.toString()</tt> (if cause
71: * is non-null) which typically contains the
72: * class and detail message of <tt>cause</tt>.
73: *
74: * @param cause The cause which is saved for the later
75: * retrieval throw by the getLinkedCause method.
76: * (A <tt>null</tt> value is permitted, and
77: * indicates that the cause is nonexistent or
78: * unknown.)
79: **/
80: public JAXRPCException(Throwable cause) {
81: super (cause == null ? null : cause.toString());
82: this .cause = cause;
83: }
84:
85: /** Gets the Linked cause
86: *
87: * @return The cause of this Exception or <code>null</code>
88: * if the cause is noexistent or unknown
89: **/
90: public Throwable getLinkedCause() {
91: return this.cause;
92: }
93:
94: }
|