1 |
/* BackingStoreException - Chained exception thrown when backing store fails |
/* BackingStoreException.java - chained exception thrown when backing store |
2 |
Copyright (C) 2001 Free Software Foundation, Inc. |
fails |
3 |
|
Copyright (C) 2001, 2002 Free Software Foundation, Inc. |
4 |
|
|
5 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
6 |
|
|
8 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
9 |
the Free Software Foundation; either version 2, or (at your option) |
the Free Software Foundation; either version 2, or (at your option) |
10 |
any later version. |
any later version. |
11 |
|
|
12 |
GNU Classpath is distributed in the hope that it will be useful, but |
GNU Classpath is distributed in the hope that it will be useful, but |
13 |
WITHOUT ANY WARRANTY; without even the implied warranty of |
WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
38 |
|
|
39 |
package java.util.prefs; |
package java.util.prefs; |
40 |
|
|
41 |
|
import java.io.ObjectOutputStream; |
42 |
|
import java.io.ObjectInputStream; |
43 |
|
import java.io.NotSerializableException; |
44 |
|
|
45 |
/** |
/** |
46 |
* Chained exception thrown when backing store fails. |
* Chained exception thrown when backing store fails. This exception is |
47 |
* This exception is only thrown from methods that actually have to access |
* only thrown from methods that actually have to access the backing store, |
48 |
* the backing store such as <code>clear(), keys(), childrenNames(), |
* such as <code>clear(), keys(), childrenNames(), nodeExists(), removeNode(), |
49 |
* nodeExists(), removeNode(), flush(), sync(), exportNode(), exportSubTree() |
* flush(), sync(), exportNode(), exportSubTree()</code>; normal operations |
50 |
* </code>, normal operations do not throw BackingStoreExceptions. |
* do not throw BackingStoreExceptions. |
51 |
* |
* |
52 |
|
* <p>Note that although this class inherits the Serializable interface, an |
53 |
|
* attempt to serialize will fail with a <code>NotSerializableException</code>. |
54 |
|
* |
55 |
|
* @author Mark Wielaard <mark@klomp.org> |
56 |
* @since 1.4 |
* @since 1.4 |
57 |
* @author Mark Wielaard (mark@klomp.org) |
* @status updated to 1.4 |
58 |
*/ |
*/ |
59 |
public class BackingStoreException extends Exception { |
public class BackingStoreException extends Exception |
60 |
|
{ |
61 |
/** |
/** |
62 |
* Creates a new exception with a descriptive message. |
* Creates a new exception with a descriptive message. |
63 |
*/ |
* |
64 |
public BackingStoreException(String message) { |
* @param message the message |
65 |
super(message); |
*/ |
66 |
} |
public BackingStoreException(String message) |
67 |
|
{ |
68 |
/** |
super(message); |
69 |
* Create a new exception with the given cause. |
} |
70 |
*/ |
|
71 |
public BackingStoreException(Throwable cause) { |
/** |
72 |
// XXX - use when we have 1.4 Throwable support |
* Create a new exception with the given cause. |
73 |
// super(cause); |
* |
74 |
super(); |
* @param cause the cause |
75 |
} |
*/ |
76 |
|
public BackingStoreException(Throwable cause) |
77 |
|
{ |
78 |
|
super(cause); |
79 |
|
} |
80 |
|
|
81 |
|
/** |
82 |
|
* This class should not be serialized. |
83 |
|
* |
84 |
|
* @param o the output stream |
85 |
|
*/ |
86 |
|
private void writeObject(ObjectOutputStream o) |
87 |
|
{ |
88 |
|
throw new NotSerializableException |
89 |
|
("java.util.prefs.BackingStoreException"); |
90 |
|
} |
91 |
|
|
92 |
|
/** |
93 |
|
* This class should not be serialized. |
94 |
|
* |
95 |
|
* @param i the input stream |
96 |
|
*/ |
97 |
|
private void readObject(ObjectInputStream i) |
98 |
|
{ |
99 |
|
throw new NotSerializableException |
100 |
|
("java.util.prefs.BackingStoreException"); |
101 |
|
} |
102 |
} |
} |