KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > config > backup > BackupException


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * BackupException.java
26  *
27  * Created on January 21, 2004, 3:51 PM
28  */

29
30
31 package com.sun.enterprise.config.backup;
32
33 import com.sun.enterprise.config.backup.util.StringUtils;
34
35 /**
36  * Backup-Restore <strong>guarantees</strong> that this will be the one and only one kind of
37  * Exception that will ever be thrown. All fatal errors will
38  * result in this Exception being thrown. This is a checked Exception so callers
39  * will be forced to deal with it. <p>
40  * the class features built-in i18n. I.e. any String passed to a BackupException
41  * constructor will first be used as a key into the i18n Strings. If it is not
42  * found, the String itself will be used as the messsage.
43  *
44  * @author bnevins
45  */

46
47 public class BackupException extends Exception JavaDoc
48 {
49     /**
50      * Constructs a BackupException with a possibly i18n'd detail message.
51      * @param s the detail message which is first checked for as a key for an i18n string.
52      * If not found it will be used as the message itself.
53      */

54     public BackupException(String JavaDoc s)
55     {
56         super(StringHelper.get(s));
57     }
58     
59     /**
60      * @param s the detail message which is first checked for as a key for an i18n string.
61      * If not found it will be used as the message itself.
62      * @param o the parameter for the recovered i18n string. I.e. "{0}" will be
63      * replaced with o.toString(). If there is no i18n string located
64      * o will be ignored.
65      */

66     public BackupException(String JavaDoc s, Object JavaDoc o)
67     {
68         super(StringHelper.get(s, o));
69     }
70
71     /**
72      * @param s the detail message which is first checked for as a key for an i18n string.
73      * If not found it will be used as the message itself.
74      * @param t the cause.
75      */

76     public BackupException(String JavaDoc s, Throwable JavaDoc t)
77     {
78         super(StringHelper.get(s), t);
79     }
80
81     /**
82      * @param s the detail message which is first checked for as a key for an i18n string.
83      * If not found it will be used as the message itself.
84      * @param t the cause.
85      * @param o the parameter for the recovered i18n string. I.e. "{0}" will be
86      * replaced with o.toString(). If there is no i18n string located
87      * o will be ignored.
88      */

89     public BackupException(String JavaDoc s, Throwable JavaDoc t, Object JavaDoc o)
90     {
91         super(StringHelper.get(s, o), t);
92     }
93 }
94
Popular Tags