FileDocCategorySizeDatePackage
MutableSecurityManager.javaAPI DocAndroid 1.5 API3089Wed May 06 22:41:04 BST 2009org.apache.harmony.luni.tests.java.lang

MutableSecurityManager

public class MutableSecurityManager extends SecurityManager

Fields Summary
static final RuntimePermission
SET_SECURITY_MANAGER
private PermissionCollection
enabled
private PermissionCollection
denied
public boolean
isCheckAcceptCalled
public boolean
isCheckAccessThreadCalled
public boolean
isCheckAccessThreadGroupCalled
Constructors Summary
public MutableSecurityManager()


      
        super();
        this.enabled = new Permissions();
    
public MutableSecurityManager(Permission permissions)

        this();
        for (int i = 0; i < permissions.length; i++) {
            this.enabled.add(permissions[i]);
        }
    
Methods Summary
voidaddPermission(java.security.Permission permission)

        enabled.add(permission);
    
public voidcheckAccept(java.lang.String host, int port)

        isCheckAcceptCalled = true;        
        super.checkAccept(host, port);
    
public voidcheckPermission(java.security.Permission permission)

        if (permission != null) {
            if (denied != null && denied.implies(permission)){
                
                throw new SecurityException("Denied " + permission);
            }
    
            if (enabled.implies(permission)) {
                return;
            }
        }

        super.checkPermission(permission);
    
public voidcheckPermission(java.security.Permission permission, java.lang.Object context)

        if (permission != null) {
            if (denied != null && denied.implies(permission)){
                
                throw new SecurityException("Denied " + permission);
            }
    
            if (enabled.implies(permission)) {
                return;
            }
        }

        super.checkPermission(permission, context);
    
voidclearPermissions()

        enabled = new Permissions();
    
voiddenyPermission(java.security.Permission p)

        if (denied == null) {
            denied = p.newPermissionCollection();
        }
        denied.add(p);