01: /**
02: * JOnAS: Java(TM) Open Application Server
03: * Copyright (C) 1999-2004 Bull S.A.
04: * Contact: jonas-team@objectweb.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: GenICException.java 5447 2004-09-17 08:40:04Z joaninh $
23: * --------------------------------------------------------------------------
24: */package org.objectweb.jonas_ejb.genic;
25:
26: /**
27: * This class represents the exception that can be throwned by the GenIC tool.
28: *
29: * @author Helene Joanin : Initial developer
30: */
31: public class GenICException extends Exception {
32:
33: protected Exception inner = null;
34:
35: /**
36: * Constructs an GenICException with no specified detail message.
37: */
38: public GenICException() {
39: super ();
40: }
41:
42: /**
43: * Constructs an GenICException with the specified detail message.
44: */
45: public GenICException(String msg) {
46: super (msg);
47: }
48:
49: public GenICException(String msg, Exception inner) {
50: super (msg);
51: this .inner = inner;
52:
53: }
54:
55: public String toString() {
56: String s = GenICException.class.getName() + ": "
57: + super .getMessage();
58: if (inner == null) {
59: return (s);
60: } else {
61: return (s + " (" + inner.toString() + ")");
62: }
63: }
64:
65: public String getMessage() {
66: String s = super .getMessage();
67: if (inner == null) {
68: return (s);
69: } else {
70: return (s + " (" + inner.getMessage() + ")");
71: }
72: }
73:
74: public void printStackTrace() {
75: System.out.println(getMessage());
76: if (inner != null) {
77: inner.printStackTrace();
78: }
79: }
80:
81: public void printStackTrace(java.io.PrintStream s) {
82: s.println(getMessage());
83: if (inner != null) {
84: inner.printStackTrace(s);
85: }
86: }
87:
88: public void printStackTrace(java.io.PrintWriter s) {
89: s.println(getMessage());
90: if (inner != null) {
91: inner.printStackTrace(s);
92: }
93: }
94: }
|