CLDC 1.1.1

java.security
Class AccessController

java.lang.Object
  extended byjava.security.AccessController

public final class AccessController
extends Object

The AccessController class is used to decide whether an access to a critical system resource is to be allowed or denied, based on the security policy currently in effect.

The checkPermission method determines whether the access request indicated by a specified permission should be granted or denied. A sample call appears below. In this example, checkPermission will determine whether or not to permit the Java Virtual Machine to be halted.

 
    RuntimePermission perm = new RuntimePermission("exitVM");
    AccessController.checkPermission(perm);
 
 

If a requested access is allowed, checkPermission returns quietly. If denied, an AccessControlException is thrown. AccessControlException can also be thrown if the requested permission is of an incorrect type or contains an invalid value. Such information is given whenever possible.


Method Summary
static void checkPermission(Permission perm)
          Determines whether the access request indicated by the specified permission should be allowed or denied, based on the security policy currently in effect.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkPermission

public static void checkPermission(Permission perm)
                            throws AccessControlException
Determines whether the access request indicated by the specified permission should be allowed or denied, based on the security policy currently in effect. This method quietly returns if the access request is permitted, or throws a suitable AccessControlException otherwise.

Parameters:
perm - the requested permission.
Throws:
AccessControlException - if the specified permission is not permitted, based on the current security policy.
NullPointerException - if the specified permission is null.

CLDC 1.1.1

Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved. Use of this specification is subject to license terms.