KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > util > launcher > LauncherException


1 /*====================================================================
2
3 ObjectWeb Util Launcher Package.
4 Copyright (C) 2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Romain Rouvoy.
23 Contributor(s): .
24
25 --------------------------------------------------------------------
26 $Id: LauncherException.java,v 1.2 2005/02/03 18:29:13 contrera Exp $
27 ====================================================================*/

28
29 package org.objectweb.util.launcher ;
30
31
32 import java.io.PrintStream JavaDoc ;
33 import java.io.PrintWriter JavaDoc ;
34
35 import org.objectweb.util.misc.api.ExceptionWrapper ;
36 //import org.objectweb.util.trace.TraceSystem;
37

38
39 /**
40  * Wrapping exception for the launcher.
41  *
42  * <p>
43  * the exception is a runtime wrapping of intial exception for avoiding
44  * try catch and throws statements in methods
45  * </p>
46  *
47  * @author <a HREF="mailto:Romain.Rouvoy@lifl.fr">Romain Rouvoy</a>
48  * @version 0.1
49  */

50 public class LauncherException
51      extends ExceptionWrapper
52 {
53     /**
54      * Wrapping constructor.
55      *
56      * @param initial - the wrapped exception.
57      */

58     public LauncherException(Exception JavaDoc initial) {
59         super(initial);
60 // TraceSystem.get("launcher").debug("Exception raised: "+initial);
61
}
62
63 // /**
64
// * Fills in the execution stack trace.
65
// */
66
// public Throwable
67
// fillInStackTrace() {
68
// return getException().fillInStackTrace();
69
// }
70

71     /**
72      * Returns the cause of this throwable or null if the cause
73      * is nonexistent or unknown.
74      */

75 //COMMENTED FOR JAVA 1.3 COMPATIBILITY
76
// public Throwable
77
// getCause() {
78
// return getException().getCause();
79
// }
80

81 // /**
82
// * Creates a localized description of this throwable.
83
// */
84
// public String
85
// getLocalizedMessage() {
86
// return getException().getLocalizedMessage();
87
// }
88

89     /**
90      * Returns the detail message string of this throwable.
91      */

92     public String JavaDoc
93     getMessage() {
94         return getException().getMessage();
95     }
96
97 // /**
98
// * Provides programmatic access to the stack trace information
99
// * printed by printStackTrace().
100
// */
101
// public StackTraceElement[]
102
// getStackTrace() {
103
// return getException().getStackTrace();
104
// }
105

106 // /**
107
// * Initializes the cause of this throwable to the specified value.
108
// */
109
// public Throwable
110
// initCause(Throwable cause) {
111
// return getException().initCause(cause);
112
// }
113

114     /**
115      * Prints this throwable and its backtrace to the standard error stream.
116      */

117     public void
118     printStackTrace() {
119         getException().printStackTrace();
120     }
121
122     /**
123      * Prints this throwable and its backtrace to the specified print stream.
124      */

125     public void
126     printStackTrace(PrintStream JavaDoc s) {
127         getException().printStackTrace(s);
128     }
129
130     /**
131      * Prints this throwable and its backtrace to the specified print writer.
132      */

133     public void
134     printStackTrace(PrintWriter JavaDoc s) {
135         getException().printStackTrace(s);
136     }
137
138 // /**
139
// * Sets the stack trace elements that will be returned by getStackTrace()
140
// * and printed by printStackTrace() and related methods.
141
// */
142
// public void
143
// setStackTrace(StackTraceElement[] stackTrace){
144
// getException().setStackTrace(stackTrace);
145
// }
146

147     /**
148      * Returns a short description of this throwable.
149      */

150     public String JavaDoc
151     toString() {
152         return getException().toString();
153     }
154 }
155
Popular Tags