当前位置: 首页>>代码示例>>Java>>正文


Java Permission.implies方法代码示例

本文整理汇总了Java中java.security.Permission.implies方法的典型用法代码示例。如果您正苦于以下问题:Java Permission.implies方法的具体用法?Java Permission.implies怎么用?Java Permission.implies使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.security.Permission的用法示例。


在下文中一共展示了Permission.implies方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: implies

import java.security.Permission; //导入方法依赖的package包/类
/**
 * Check and see if this collection of permissions implies the permissions
 * expressed in "permission".
 *
 * @param permission the Permission object to compare
 *
 * @return true if "permission" is a proper subset of a permission in
 * the collection, false if not.
 */
public boolean implies(Permission permission) {
    if (! (permission instanceof DelegationPermission))
            return false;

    synchronized (this) {
        for (Permission x : perms) {
            if (x.implies(permission))
                return true;
        }
    }
    return false;

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:DelegationPermission.java

示例2: main

import java.security.Permission; //导入方法依赖的package包/类
public static void main(String[]args) throws Exception {

      Permission p1 = new A("foo");
      Permission p2 = new B("foo");

      if (p1.implies(p2) || p2.implies(p1) || p1.equals(p2)) {
          throw new Exception("Test failed");
      }

      // make sure permissions imply and equal themselves
      if (! (p1.implies(p1) && p1.equals(p1))) {
          throw new Exception("Test failed");
      }

    }
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:16,代码来源:EqualsImplies.java

示例3: checkPermission

import java.security.Permission; //导入方法依赖的package包/类
public final void checkPermission(final Permission perm) {
    for (Permission p : grantedPermissions) {
        if (p.implies(perm)) {
            return;
        }
    }
    throw new SecurityException(perm.toString());
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:9,代码来源:DcmdMBeanPermissionsTest.java

示例4: tmpImplies

import java.security.Permission; //导入方法依赖的package包/类
private boolean tmpImplies(Permission perm) {
    Map<Integer, Permission> tmpPermissions = transientPermissions.get();
    if (tmpPermissions != null) {
        for (Permission p : tmpPermissions.values()) {
            if (p.implies(perm))
                return true;
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:JAXPPolicyManager.java

示例5: checkPermission

import java.security.Permission; //导入方法依赖的package包/类
public void checkPermission(Permission p) {
    if (p.implies(new RuntimePermission("setSecurityManager"))
        || p.implies(new RuntimePermission("getProtectionDomain")))
      return;
    super.checkPermission(p);
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:GetXSpace.java

示例6: checkPermission

import java.security.Permission; //导入方法依赖的package包/类
@Override
public void checkPermission(Permission perm) {
    if (perm.implies(SecurityConstants.AWT.TOPLEVEL_WINDOW_PERMISSION)) {
        throw new SecurityException();
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:7,代码来源:CustomSecurityManager.java

示例7: checkPermission

import java.security.Permission; //导入方法依赖的package包/类
@Override
public void checkPermission(Permission perm) {
    if (perm.implies(AWTPermissions.TOPLEVEL_WINDOW_PERMISSION)) {
        throw new SecurityException();
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:CustomSecurityManager.java


注:本文中的java.security.Permission.implies方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。