java.security.Permissions.setReadOnly()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中java.security.Permissions.setReadOnly()方法的一些代码示例,展示了Permissions.setReadOnly()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Permissions.setReadOnly()方法的具体详情如下:
包路径:java.security.Permissions
类名称:Permissions
方法名:setReadOnly

Permissions.setReadOnly介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

/**
   * Get a read-only collection of the given permissions.
   *
   * @param permissions the permissions to assign
   * @return the read-only collection
   */
  public static PermissionCollection readOnlyCollectionOf(Permission... permissions) {
    final int length = permissions.length;
    if (length == 0) {
      return EMPTY_PERMISSION_COLLECTION;
    } else {
      Permissions collection = new Permissions();
      addAll(collection, Arrays.asList(permissions));
      collection.setReadOnly();
      return collection;
    }
  }
}

代码示例来源:origin: org.rhq/rhq-script-bindings

public void setReadOnly() {
    perms.setReadOnly();
  }
}

代码示例来源:origin: org.jboss.modules/jboss-modules

private static PermissionCollection noPermissions() {
  final Permissions permissions = new Permissions();
  permissions.setReadOnly();
  return permissions;
}

代码示例来源:origin: org.jboss.modules/jboss-modules

private static PermissionCollection copyPermissions(PermissionCollection permissionCollection) {
  final Permissions permissions = new Permissions();
  final Enumeration<Permission> elements = permissionCollection.elements();
  while (elements.hasMoreElements()) {
    permissions.add(elements.nextElement());
  }
  permissions.setReadOnly();
  return permissions;
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
   * Get a read-only collection of the given permissions.
   *
   * @param permissions the permissions to assign
   * @return the read-only collection
   */
  public static PermissionCollection readOnlyCollectionOf(Permission... permissions) {
    final int length = permissions.length;
    if (length == 0) {
      return EMPTY_PERMISSION_COLLECTION;
    } else {
      Permissions collection = new Permissions();
      addAll(collection, Arrays.asList(permissions));
      collection.setReadOnly();
      return collection;
    }
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron

/**
   * Get a read-only collection of the given permissions.
   *
   * @param permissions the permissions to assign
   * @return the read-only collection
   */
  public static PermissionCollection readOnlyCollectionOf(Permission... permissions) {
    final int length = permissions.length;
    if (length == 0) {
      return EMPTY_PERMISSION_COLLECTION;
    } else {
      Permissions collection = new Permissions();
      addAll(collection, Arrays.asList(permissions));
      collection.setReadOnly();
      return collection;
    }
  }
}

代码示例来源:origin: org.wildfly.security/wildfly-elytron-permission

/**
   * Get a read-only collection of the given permissions.
   *
   * @param permissions the permissions to assign
   * @return the read-only collection
   */
  public static PermissionCollection readOnlyCollectionOf(Permission... permissions) {
    final int length = permissions.length;
    if (length == 0) {
      return EMPTY_PERMISSION_COLLECTION;
    } else {
      Permissions collection = new Permissions();
      addAll(collection, Arrays.asList(permissions));
      collection.setReadOnly();
      return collection;
    }
  }
}

代码示例来源:origin: org.jboss.modules/jboss-modules

Permissions getAssembled() {
  if (assembled == null) {
    synchronized (this) {
      if (assembled == null) {
        final Permissions assembled = new Permissions();
        for (PermissionFactory factory : factories) {
          if (factory != null) {
            final Permission permission = factory.construct();
            if (permission != null) {
              assembled.add(permission);
            }
          }
        }
        assembled.setReadOnly();
        this.assembled = assembled;
      }
    }
  }
  return assembled;
}

代码示例来源:origin: org.jboss.forge/jboss-modules

Permissions getAssembled() {
  if (assembled == null) {
    synchronized (this) {
      if (assembled == null) {
        final Permissions assembled = new Permissions();
        for (PermissionFactory factory : factories) {
          if (factory != null) {
            final Permission permission = factory.construct();
            if (permission != null) {
              assembled.add(permission);
            }
          }
        }
        assembled.setReadOnly();
        this.assembled = assembled;
      }
    }
  }
  return assembled;
}

代码示例来源:origin: freeplane/freeplane

permissions.setReadOnly();
checkRequiredPermissions();

相关文章