KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > syncclient > spap > ApplicationManagementException


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package sync4j.syncclient.spap;
19
20 import java.io.PrintStream JavaDoc;
21 import java.io.PrintWriter JavaDoc;
22
23 /**
24  * Application management error condition
25  *
26  * @author Stefano Fornari
27  */

28 public class ApplicationManagementException extends Exception JavaDoc {
29     Throwable JavaDoc cause;
30     
31     public ApplicationManagementException(final String JavaDoc strMsg) {
32         super(strMsg);
33     }
34         
35     public ApplicationManagementException(final String JavaDoc strMsg, final Throwable JavaDoc cause) {
36         super(strMsg);
37         
38         this.cause = cause;
39     }
40      
41     public ApplicationManagementException(final Throwable JavaDoc cause) {
42         this("", cause);
43     }
44     
45     public Throwable JavaDoc getCause() {
46         return cause;
47     }
48     
49     public void printStackTrace() {
50         super.printStackTrace();
51         if (cause != null) {
52             System.err.println("Caused by:");
53             cause.printStackTrace();
54         }
55     }
56     
57     public void printStackTrace(PrintStream JavaDoc ps) {
58         super.printStackTrace(ps);
59         if (cause != null) {
60             System.err.println("Caused by:");
61             cause.printStackTrace(ps);
62         }
63     }
64     
65     public void printStackTrace(PrintWriter JavaDoc pw) {
66         super.printStackTrace(pw);
67         if (cause != null) {
68             System.err.println("Caused by:");
69             cause.printStackTrace(pw);
70         }
71     }
72
73 }
Popular Tags