KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > util > scheduler > SchedulerException


1 package de.webman.util.scheduler;
2
3 import java.io.PrintStream JavaDoc;
4 import java.io.PrintWriter JavaDoc;
5
6
7 /**
8  * This exception is thrown if to indicate failure of a SchedulerService
9  * configuration or execution.
10  *
11  * @author <a HREF="mailto:gregor@webman.de">Gregor Klinke</a>
12  * @version $Revision: 1.2 $
13  **/

14 public class SchedulerException
15     extends Exception JavaDoc
16 {
17     /* $Id: SchedulerException.java,v 1.2 2002/04/12 12:45:53 gregor Exp $ */
18
19     /**
20      * The cause for this exception.
21      */

22     private Exception JavaDoc cause = null;
23
24     /**
25      * constructor
26      **/

27     public SchedulerException () {
28     }
29
30     public SchedulerException (String JavaDoc s) {
31         super(s);
32     }
33     
34     public SchedulerException (Exception JavaDoc _cause) {
35         cause = _cause;
36     }
37     
38     
39     /**
40      * Returns the error message of this exception.
41      *
42      * @return the error message of this exception.
43      */

44     public String JavaDoc getMessage () {
45         return (cause == null
46                 ? super.getMessage()
47                 : cause.getMessage());
48     }
49     
50     /**
51      * Returns the localized description of this exception.
52      *
53      * @return the localized description of this exception.
54      */

55     public String JavaDoc getLocalizedMessage () {
56         return (cause == null
57                 ? super.getLocalizedMessage()
58                 : cause.getLocalizedMessage());
59     }
60     
61     /**
62      * Returns the short description of this exception.
63      *
64      * @return the short description of this exception.
65      */

66     public String JavaDoc toString ()
67     {
68         return (cause == null
69                 ? super.toString()
70                 : cause.toString());
71     }
72     
73     /**
74      * Prints this exception and its backtrace to the
75      * standard error stream.
76      */

77     public void printStackTrace ()
78     {
79         if (cause == null) {
80             super.printStackTrace();
81         }
82         else {
83             printStackTrace();
84         }
85     }
86     
87     /**
88      * Prints this exception and its backtrace to the
89      * given print stream.
90      *
91      * @param ps the print stream.
92      */

93     public void printStackTrace (PrintStream JavaDoc ps)
94     {
95         if (cause == null) {
96             super.printStackTrace(ps);
97         }
98         else {
99             cause.printStackTrace(ps);
100         }
101     }
102
103     /**
104      * Prints this exception and its backtrace to the
105      * given print writer.
106      *
107      * @param ps the print writer.
108      */

109     public void printStackTrace (PrintWriter JavaDoc pw)
110     {
111         if (cause == null) {
112             super.printStackTrace(pw);
113         }
114         else {
115             cause.printStackTrace(pw);
116         }
117     }
118 }
119
Popular Tags