Code example for Permissions

Methods: add

0
     * Canonical instance of {@link AccessControlContext} with a single {@link RuntimePermission} for 
     * {@code "getClassLoader"} permission. 
     */ 
    public static final AccessControlContext GET_CLASS_LOADER_CONTEXT;
    static { 
        final Permissions perms = new Permissions();
        perms.add(new RuntimePermission("getClassLoader"));
        GET_CLASS_LOADER_CONTEXT = new AccessControlContext(
                new ProtectionDomain[] { new ProtectionDomain(null, perms) });
    } 
}