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
.Methods declared in class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
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:
-