java.security
Class PrivilegedActionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.security.PrivilegedActionException
All Implemented Interfaces:
Serializable

public class PrivilegedActionException
extends Exception

This exception is thrown when an exception is thrown during a privileged action being performed with the AccessController.doPrivileged() method. It wraps the actual exception thrown in the privileged code.

See Also:
PrivilegedExceptionAction, AccessController.doPrivileged(PrivilegedExceptionAction), AccessController.doPrivileged(PrivilegedExceptionAction, AccessControlContext), Serialized Form

Constructor Summary
PrivilegedActionException(Exception e)
          Create a new instance that wraps the specified Exception.
 
Method Summary
 Throwable getCause()
          Gets the cause of this exception.
 Exception getException()
          Get the underlying Exception that caused this one.
 String toString()
          Convert this to a String.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrivilegedActionException

public PrivilegedActionException(Exception e)
Create a new instance that wraps the specified Exception.

Parameters:
e - the Exception to wrap
Method Detail

getException

public Exception getException()
Get the underlying Exception that caused this one. This is a legacy method, the preferred way is getCause().

Returns:
the cause

getCause

public Throwable getCause()
Gets the cause of this exception.

Overrides:
getCause in class Throwable
Returns:
the cause
Since:
1.4

toString

public String toString()
Convert this to a String.

Overrides:
toString in class Throwable
Returns:
the string representation
See Also:
Object.getClass(), Object.hashCode(), Class.getName(), Integer.toHexString(int)