Class PrivilegedActionException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.security.PrivilegedActionException
- All Implemented Interfaces:
Serializable
This exception is thrown by
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.- Since:
- 1.2
- See Also:
-
Constructor Summary
ConstructorDescriptionPrivilegedActionException
(Exception exception) Constructs a newPrivilegedActionException
"wrapping" the specific Exception. -
Method Summary
Modifier and TypeMethodDescriptionReturns the exception thrown by the privileged computation that resulted in thisPrivilegedActionException
.toString()
Returns a short description of this throwable.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
PrivilegedActionException
Constructs a newPrivilegedActionException
"wrapping" the specific Exception.- Parameters:
exception
- The exception thrown
-
-
Method Details
-
getException
Returns the exception thrown by the privileged computation that resulted in thisPrivilegedActionException
.- API Note:
- This method predates the general-purpose exception chaining facility.
The
Throwable.getCause()
method is now the preferred means of obtaining this information. - Returns:
- the exception thrown by the privileged computation that
resulted in this
PrivilegedActionException
. - See Also:
-
toString
Description copied from class:Throwable
Returns a short description of this throwable. The result is the concatenation of:- the name of the class of this object
- ": " (a colon and a space)
- the result of invoking this object's
Throwable.getLocalizedMessage()
method
getLocalizedMessage
returnsnull
, then just the class name is returned.
-