KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > mail > StoreClosedException


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
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
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 in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21
22 /*
23  * @(#)StoreClosedException.java 1.6 05/08/29
24  *
25  * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
26  */

27
28 package javax.mail;
29
30 /**
31  * This exception is thrown when a method is invoked on a Messaging object
32  * and the Store that owns that object has died due to some reason.
33  * This exception should be treated as a fatal error; in particular any
34  * messaging object belonging to that Store must be considered invalid. <p>
35  *
36  * The connect method may be invoked on the dead Store object to
37  * revive it. <p>
38  *
39  * The getMessage() method returns more detailed information about the
40  * error that caused this exception. <p>
41  *
42  * @author John Mani
43  */

44
45 public class StoreClosedException extends MessagingException JavaDoc {
46     transient private Store JavaDoc store;
47
48     private static final long serialVersionUID = -3145392336120082655L;
49
50     /**
51      * Constructor
52      * @param store The dead Store object
53      */

54     public StoreClosedException(Store JavaDoc store) {
55     this(store, null);
56     }
57
58     /**
59      * Constructor
60      * @param store The dead Store object
61      * @param message The detailed error message
62      */

63     public StoreClosedException(Store JavaDoc store, String JavaDoc message) {
64     super(message);
65     this.store = store;
66     }
67
68     /**
69      * Returns the dead Store object
70      */

71     public Store JavaDoc getStore() {
72     return store;
73     }
74 }
75
Popular Tags