doPrivileged(PrivilegedExceptionAction) and
doPrivileged(PrivilegedExceptionAction,
AccessControlContext context) to indicate
that the action being performed threw a checked exception. The exception
thrown by the action can be obtained by calling the
getException method. In effect, an
PrivilegedActionException is a "wrapper"
for an exception thrown by a privileged action.
PrivilegedExceptionAction, AccessController#doPrivileged(PrivilegedExceptionAction), AccessController#doPrivileged(PrivilegedExceptionAction, AccessControlContext)
| Modifier and Type | Field and Description |
|---|---|
| private static final ObjectStreamField[] | serialPersistentFields
The exception thrown by the computation that resulted
in this |
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | PrivilegedActionException(Exception
The exception thrown exception)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public Exception | Returns: the exception thrown by the computation that resulted in thisPrivilegedActionException.Returns the exception thrown by the computation that
resulted in this |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readHides java. Reconstitutes the |
| public String | |
| private void | writeObject(ObjectOutputStream
the out)ObjectOutputStream to which data is writtenHides java. To maintain compatibility with older implementation, write a serial "exception" field with the cause as the value. |
| serialPersistentFields | back to summary |
|---|---|
| private static final ObjectStreamField[] serialPersistentFields The exception thrown by the computation that resulted
in this
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. | |
| PrivilegedActionException | back to summary |
|---|---|
| public PrivilegedActionException(Exception exception) Constructs a new
| |
| getException | back to summary |
|---|---|
| public Exception getException() Returns the exception thrown by the computation that
resulted in this API Note This method predates the general-purpose exception chaining facility.
The
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Hides java. Reconstitutes the The getException and getCause method returns the private "exception"
field in the older implementation and
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a short description of this throwable. The result is the concatenation of:
getLocalizedMessage returns null, then just
the class name is returned.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException Hides java. To maintain compatibility with older implementation, write a serial "exception" field with the cause as the value.
| |