EJBRoleRefPermission (Java EE 5)

Java EE API


javax.security.jacc Class EJBRoleRefPermission

java.lang.Object
  extended by java.security.Permission
      extended by javax.security.jacc.EJBRoleRefPermission
All Implemented Interfaces:
Serializable, Guard

public final class EJBRoleRefPermission
extends Permission
implements Serializable

Extends: java.security.Permission
Implements: java.io.Serializable

EJB isCallerInRole (String reference) 权限的类。EJBRoleRefPermission 是一个指定的权限,它具有各种操作。

EJBRoleRefPermission 的名称包含在应用程序部署描述符中标识 EJB(在其上下文中获得权限)的 ejb-name 元素的值。

EJBRoleRefPermission 的 actions 标识权限所应用到的角色引用。检查 EJBRoleRefPermission 以确定主体是否是引用所标识的角色的成员。

此类的实现可能实现 newPermissionCollection,也可能从超类继承其实现。

英文文档:

Class for EJB isCallerInRole (String reference) permissions. An EJBRoleRefPermission is a named permission and has actions.

The name of an EJBRoleRefPermission contains the value of the ejb-name element in the application's deployment descriptor that identifies the EJB in whose context the permission is being evalutated.

the actions of an EJBRoleRefPermission identifies the role reference to which the permission applies. An EJBRoleRefPermission is checked to determine if the subject is a member of the role identified by the reference.

Implementations of this class MAY implement newPermissionCollection or inherit its implementation from the super class.

Author:
Ron Monzillo, Gary Ellison
See Also:
Permission, Serialized Form

Constructor Summary
 
Method Summary
 boolean
 String
 int
 boolean
 
Methods inherited from class java.security.Permission
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public EJBRoleRefPermission(String name, String actions)
使用指定名称和操作创建新的 EJBRoleRefPermission。
name 标识在其上下文中获得角色引用的 EJB 的 ejb-name。

actions 标识应用权限的角色引用。角色引用的范围限定为在名称参数中标识的 EJB。角色引用的值不得为 null 或空字符串。
英文文档:

EJBRoleRefPermission

public EJBRoleRefPermission(String name,
                            String actions)
Creates a new EJBRoleRefPermission with the specified name and actions.

Parameters:
name - the ejb-name that identifies the EJB in whose context the role references are to be evaluated.

actions - identifies the role reference to which the permission pertains. The role reference is scoped to the EJB identified in the name parameter. The value of the role reference must not be null or the empty string.

Method Detail

public boolean equals(Object o)
检查两个 EJBRoleRefPermission 对象是否相等。如果 EJBRoleRefPermission 对象具有相同的名称和 actions 值(区分大小写),则它们相等。

当且仅当 P1.implies(P2) && P2.implies(P1) 时,这两个 Permission 对象(P1 和 P2)才是相等的。

o 要测试是否与此 EJBRoleRefPermission 相等的 EJBRoleRefPermission 对象

return 如果参数 EJBRoleRefPermission 对象与此 EJBRoleRefPermission 相等,则返回 true。

英文文档:

equals

public boolean equals(Object o)
Checks two EJBRoleRefPermission objects for equality. EJBRoleRefPermission objects are equivalent if they have case equivalent name and actions values.

Two Permission objects, P1 and P2, are equivalent if and only if P1.implies(P2) && P2.implies(P1).

Specified by:
equals in class Permission
Parameters:
o - the EJBRoleRefPermission object being tested for equality with this EJBRoleRefPermission.

Returns:
true if the argument EJBRoleRefPermission object is equivalent to this EJBRoleRefPermission.

public String getActions()
返回此 EJBRoleRefPermission 的 actions 的规范 String 表示形式。

return 包含此 EJBRoleRefPermission 的规范化 actions 的 String。

英文文档:

getActions

public String getActions()
Returns a canonical String representation of the actions of this EJBRoleRefPermission.

Specified by:
getActions in class Permission
Returns:
a String containing the canonicalized actions of this EJBRoleRefPermission.

public int hashCode()
返回此 EJBRoleRefPermission 的哈希码值。所返回哈希码的属性必须如下所示:

  • 在 Java 应用程序的生命周期中,每次对 EJBRoleRefPermission 对象调用 hashCode 方法,该方法都必须返回相同的整数值。应用程序每次对特定 EJBRoleRefPermission 对象执行 hashCode 调用所返回的值不必保持一致。
  • 如果根据 equals 方法,两个 EJBRoleRefPermission 对象是相等的,那么对两个 Permission 对象中每个对象调用 hashCode 方法必须生成相同的整数结果(在应用程序内)。

return 此对象的整数哈希码值。

英文文档:

hashCode

public int hashCode()
Returns the hash code value for this EJBRoleRefPermission. The properties of the returned hash code must be as follows:

  • During the lifetime of a Java application, the hashCode method must return the same integer value, every time it is called on a EJBRoleRefPermission object. The value returned by hashCode for a particular EJBRoleRefPermission need not remain consistent from one execution of an application to another.
  • If two EJBRoleRefPermission objects are equal according to the equals method, then calling the hashCode method on each of the two Permission objects must produce the same integer result (within an application).

Specified by:
hashCode in class Permission
Returns:
the integer hash code value for this object.

public boolean implies(java.security.Permission permission)
确定此 EJBRoleRefPermission 是否“隐含有”参数 Permission。要实现这一点:

  • 参数必须是 EJBRoleRefPermission 的实例
  • 名称等于此 EJBRoleRefPermission 的名称,并且
  • 角色引用等于此 EJBRoleRefPermission 应用到的角色引用。

    上述名称和 actions 比较是区分大小写的。

    permission 检查“此”EJBRoleRefPermission,了解它是否隐含有参数 Permission。

    return 如果此对象隐含指定的权限,则返回 true;否则返回 false。

    英文文档:

    implies

  • public boolean implies(Permission permission)
    Determines if the argument Permission is "implied by" this EJBRoleRefPermission. For this to be the case,

  • The argument must be an instanceof EJBRoleRefPermission
  • with name equivalent to that of this EJBRoleRefPermission, and
  • with the role reference equivalent to that of this EJBRoleRefPermission applies.

    The name and actions comparisons described above are case sensitive.

  • Specified by:
    implies in class Permission
    Parameters:
    permission - "this" EJBRoleRefPermission is checked to see if it implies the argument permission.

    Returns:
    true if the specified permission is implied by this object, false if not.


    Submit a bug or feature

    Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

    一看就知道只有菜鸟才干这么无知的事啦。

    PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!