< prev index next >

## src/java.base/share/classes/java/security/AccessControlContext.java

Print this page

     58  * the following:
     59  *
     60  * <pre>
     61  *   AccessControlContext acc = AccessController.getContext()
     62  * </pre>
     63  *
     64  * <p>
     65  * Code within a different context can subsequently call the
     66  * {@code checkPermission} method on the
     67  * previously-saved AccessControlContext object. A sample call is the
     68  * following:
     69  *
     70  * <pre>
     71  *   acc.checkPermission(permission)
     72  * </pre>
     73  *
     74  * @see AccessController
     75  *
     76  * @author Roland Schemers
     77  * @since 1.2

     78  */
     79

     80 public final class AccessControlContext {
     81
     82     private ProtectionDomain[] context;
     83     // isPrivileged and isAuthorized are referenced by the VM - do not remove
     84     // or change their names
     85     private boolean isPrivileged;
     86     private boolean isAuthorized = false;
     87
     88     // Note: This field is directly used by the virtual machine
     89     // native codes. Don't touch it.
     90     private AccessControlContext privilegedContext;
     91
     92     private DomainCombiner combiner = null;
     93
     94     // limited privilege scope
     95     private Permission[] permissions;
     96     private AccessControlContext parent;
     97     private boolean isWrapped;
     98
     99     // is constrained by limited privilege scope?
     58  * the following:
     59  *
     60  * <pre>
     61  *   AccessControlContext acc = AccessController.getContext()
     62  * </pre>
     63  *
     64  * <p>
     65  * Code within a different context can subsequently call the
     66  * {@code checkPermission} method on the
     67  * previously-saved AccessControlContext object. A sample call is the
     68  * following:
     69  *
     70  * <pre>
     71  *   acc.checkPermission(permission)
     72  * </pre>
     73  *
     74  * @see AccessController
     75  *
     76  * @author Roland Schemers
     77  * @since 1.2
     78  * @deprecated This class is only useful in conjunction with
     79  *       {@linkplain SecurityManager the Security Manager}, which is deprecated
     80  *       and subject to removal in a future release. Consequently, this class
     81  *       is also deprecated and subject to removal. There is no replacement for
     82  *       the Security Manager or this class.
     83  */
     84
     85 @Deprecated(since="17", forRemoval=true)
     86 public final class AccessControlContext {
     87
     88     private ProtectionDomain[] context;
     89     // isPrivileged and isAuthorized are referenced by the VM - do not remove
     90     // or change their names
     91     private boolean isPrivileged;
     92     private boolean isAuthorized = false;
     93
     94     // Note: This field is directly used by the virtual machine
     95     // native codes. Don't touch it.
     96     private AccessControlContext privilegedContext;
     97
     98     private DomainCombiner combiner = null;
     99
    100     // limited privilege scope
    101     private Permission[] permissions;
    102     private AccessControlContext parent;
    103     private boolean isWrapped;
    104
    105     // is constrained by limited privilege scope?

< prev index next >