< prev index next >

src/java.base/share/classes/java/security/PrivilegedActionException.java

Print this page




  26 package java.security;
  27 
  28 /**
  29  * This exception is thrown by
  30  * {@code doPrivileged(PrivilegedExceptionAction)} and
  31  * {@code doPrivileged(PrivilegedExceptionAction,
  32  * AccessControlContext context)} to indicate
  33  * that the action being performed threw a checked exception.  The exception
  34  * thrown by the action can be obtained by calling the
  35  * {@code getException} method.  In effect, an
  36  * {@code PrivilegedActionException} is a "wrapper"
  37  * for an exception thrown by a privileged action.
  38  *
  39  * <p>As of release 1.4, this exception has been retrofitted to conform to
  40  * the general purpose exception-chaining mechanism.  The "exception thrown
  41  * by the privileged computation" that is provided at construction time and
  42  * accessed via the {@link #getException()} method is now known as the
  43  * <i>cause</i>, and may be accessed via the {@link Throwable#getCause()}
  44  * method, as well as the aforementioned "legacy method."
  45  *

  46  * @see PrivilegedExceptionAction
  47  * @see AccessController#doPrivileged(PrivilegedExceptionAction)
  48  * @see AccessController#doPrivileged(PrivilegedExceptionAction,AccessControlContext)
  49  */
  50 public class PrivilegedActionException extends Exception {
  51     // use serialVersionUID from JDK 1.2.2 for interoperability
  52     private static final long serialVersionUID = 4724086851538908602L;
  53 
  54     /**
  55      * @serial
  56      */
  57     private Exception exception;
  58 
  59     /**
  60      * Constructs a new PrivilegedActionException &quot;wrapping&quot;
  61      * the specific Exception.
  62      *
  63      * @param exception The exception thrown
  64      */
  65     public PrivilegedActionException(Exception exception) {




  26 package java.security;
  27 
  28 /**
  29  * This exception is thrown by
  30  * {@code doPrivileged(PrivilegedExceptionAction)} and
  31  * {@code doPrivileged(PrivilegedExceptionAction,
  32  * AccessControlContext context)} to indicate
  33  * that the action being performed threw a checked exception.  The exception
  34  * thrown by the action can be obtained by calling the
  35  * {@code getException} method.  In effect, an
  36  * {@code PrivilegedActionException} is a "wrapper"
  37  * for an exception thrown by a privileged action.
  38  *
  39  * <p>As of release 1.4, this exception has been retrofitted to conform to
  40  * the general purpose exception-chaining mechanism.  The "exception thrown
  41  * by the privileged computation" that is provided at construction time and
  42  * accessed via the {@link #getException()} method is now known as the
  43  * <i>cause</i>, and may be accessed via the {@link Throwable#getCause()}
  44  * method, as well as the aforementioned "legacy method."
  45  *
  46  * @since 1.2
  47  * @see PrivilegedExceptionAction
  48  * @see AccessController#doPrivileged(PrivilegedExceptionAction)
  49  * @see AccessController#doPrivileged(PrivilegedExceptionAction,AccessControlContext)
  50  */
  51 public class PrivilegedActionException extends Exception {
  52     // use serialVersionUID from JDK 1.2.2 for interoperability
  53     private static final long serialVersionUID = 4724086851538908602L;
  54 
  55     /**
  56      * @serial
  57      */
  58     private Exception exception;
  59 
  60     /**
  61      * Constructs a new PrivilegedActionException &quot;wrapping&quot;
  62      * the specific Exception.
  63      *
  64      * @param exception The exception thrown
  65      */
  66     public PrivilegedActionException(Exception exception) {


< prev index next >