KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > error > ChainedThrowable


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  * Contributor(s):
20  *
21  * $Id: ChainedThrowable.java,v 1.1.1.1 2003/03/10 16:36:15 taweili Exp $
22  */

23
24 package org.enhydra.error;
25
26 import java.io.PrintStream JavaDoc;
27 import java.io.PrintWriter JavaDoc;
28
29 /**
30  * Interface base for all of the <code>Chained*</code> classes. The chain
31  * throwables provide a linked list of throw objects, providing a complex
32  * description of an error, with information from each layer handling the
33  * error. This paradigm also allows for conversion from one error type to
34  * another without losing information.
35  * <P>
36  * Classes are provided that server as a base of implementing chained
37  * throwable classes. When it is necessary to extend an existing throwable
38  * class that is not chained, say to conform to an interface, and one wants to
39  * also also add ChainedThrowable support, this interface is implemented. The
40  * static methods in {@link ChainedThrowableSupport ChainedExceptionSupport}
41  * are used to implemented the required ChainedThrowable methods in such
42  * classes.
43  *
44  * @see ChainedError
45  * @see ChainedException
46  * @see ChainedRuntimeException
47  * @see ChainedThrowableSupport
48  */

49 public interface ChainedThrowable {
50     /**
51      * Return the message associated with this exception. If causes
52      * are included, they will be appended to the message.
53      */

54     public String JavaDoc getMessage();
55
56     /**
57      * Creates a localized description of this Throwable.
58      */

59     public String JavaDoc getLocalizedMessage();
60
61     /**
62      * Get the causing exception associated with this exception.
63      * @return The causing exception or null if no cause is specified.
64      */

65     public Throwable JavaDoc getCause();
66
67     /**
68      * Prints this ChainedException and its backtrace, and the causes
69      * and their stack traces to the standard error stream.
70      */

71     public void printStackTrace();
72
73     /**
74      * Prints this ChainedException and its backtrace, and the causes
75      * and their stack traces to the e specified print stream.
76      */

77     public void printStackTrace(PrintStream JavaDoc s);
78
79     /**
80      * Prints this ChainedException and its backtrace, and the causes
81      * and their stack traces to the e specified print writer.
82      */

83     public void printStackTrace(PrintWriter JavaDoc s);
84 }
85
Popular Tags