Skip to content

Package: StoreClosedException

StoreClosedException

nameinstructionbranchcomplexitylinemethod
StoreClosedException(Store)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
StoreClosedException(Store, String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
StoreClosedException(Store, String, Exception)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getStore()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*
2: * Copyright (c) 1997, 2023 Oracle and/or its affiliates. All rights reserved.
3: *
4: * This program and the accompanying materials are made available under the
5: * terms of the Eclipse Public License v. 2.0, which is available at
6: * http://www.eclipse.org/legal/epl-2.0.
7: *
8: * This Source Code may also be made available under the following Secondary
9: * Licenses when the conditions for such availability set forth in the
10: * Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
11: * version 2 with the GNU Classpath Exception, which is available at
12: * https://www.gnu.org/software/classpath/license.html.
13: *
14: * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15: */
16:
17: package jakarta.mail;
18:
19: /**
20: * This exception is thrown when a method is invoked on a Messaging object
21: * and the Store that owns that object has died due to some reason.
22: * This exception should be treated as a fatal error; in particular any
23: * messaging object belonging to that Store must be considered invalid. <p>
24: *
25: * The connect method may be invoked on the dead Store object to
26: * revive it. <p>
27: *
28: * The getMessage() method returns more detailed information about the
29: * error that caused this exception.
30: *
31: * @author John Mani
32: */
33:
34: public class StoreClosedException extends MessagingException {
35: transient private Store store;
36:
37: private static final long serialVersionUID = -3145392336120082655L;
38:
39: /**
40: * Constructs a StoreClosedException with no detail message.
41: *
42: * @param store The dead Store object
43: */
44: public StoreClosedException(Store store) {
45: this(store, null);
46: }
47:
48: /**
49: * Constructs a StoreClosedException with the specified
50: * detail message.
51: *
52: * @param store The dead Store object
53: * @param message The detailed error message
54: */
55: public StoreClosedException(Store store, String message) {
56: super(message);
57: this.store = store;
58: }
59:
60: /**
61: * Constructs a StoreClosedException with the specified
62: * detail message and embedded exception. The exception is chained
63: * to this exception.
64: *
65: * @param store The dead Store object
66: * @param message The detailed error message
67: * @param e The embedded exception
68: * @since JavaMail 1.5
69: */
70: public StoreClosedException(Store store, String message, Exception e) {
71: super(message, e);
72: this.store = store;
73: }
74:
75: /**
76: * Returns the dead Store object.
77: *
78: * @return the dead Store object
79: */
80: public Store getStore() {
81: return store;
82: }
83: }