EJB3的XML Schema第十讲

本文介绍了企业级Java Bean (EJB) 中方法权限配置的细节,包括如何使用method-intf元素来区分不同接口中的方法,method-nameType的定义及用途,method-paramsType的作用,以及method-permissionType如何指定哪些安全角色可以调用特定的企业bean方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

紧接上文:
<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="method-intfType">
<xsd:annotation>
<xsd:documentation>
method-intf 元素可以从定义在多个home 和组件接口以及组件和web 服务终端接口等等中(例如,同时在企业bean 的local 和remote 接口,或同时在企业bean 的home 和remote 接口中,等等)的具有相同名字和标识符的方法中区分出一个method 元素; Local 既应用到本地组件接口也应用到本地业务接口。同样,Remote 既应用到远程组件接口也应用到远程业务接口。method-intf element的值必须是下面之一:
Home
Remote
LocalHome
Local
ServiceEndpoint
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="javaee:string">
<xsd:enumeration value="Home"/>
<xsd:enumeration value="Remote"/>
<xsd:enumeration value="LocalHome"/>
<xsd:enumeration value="Local"/>
<xsd:enumeration value="ServiceEndpoint"/>
</xsd:restriction>
</xsd:simpleContent>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="method-nameType">
<xsd:annotation>
<xsd:documentation>
method-nameType 包含了企业bean 方法的名称或字符”*”。字符”*”用于声明企业bean 客户端视图接口内的所有方法。
</xsd:documentation>
</xsd:annotation>
<xsd:simpleContent>
<xsd:restriction base="javaee:string"/>
</xsd:simpleContent>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="method-paramsType">
<xsd:annotation>
<xsd:documentation>
method-paramsType 定义了方法参数的Java 类型全称列表。
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="method-param" type="javaee:java-typeType" minOccurs="0" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>
method-param 元素包含一个方法参数的原始类型名称或java 类型全称。
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="method-permissionType">
<xsd:annotation>
<xsd:documentation>
method-permissionType 指定了可以调用一到多个企业bean 方法的一到多个安全角色 。method-permissionType 有下面内容组成:可选的描述,安全角色名称列表或一个表明方法是不受检查的指示器,以及method 元素的列表。用于method-permissionType 的安全角色必须定义在部署描述的security-role 元素中,且那些方法必须是定义在企业bean 业务、home、组件和/或web 服务终端接口中的方法。
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:choice>
<xsd:element name="role-name" type="javaee:role-nameType" maxOccurs="unbounded"/>
<xsd:element name="unchecked" type="javaee:emptyType">
<xsd:annotation>
<xsd:documentation>
Unchecked 元素指定方法在方法调用之前不被容器进行认证检查。
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:choice>
<xsd:element name="method" type="javaee:methodType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="methodType">
<xsd:annotation>
<xsd:documentation>
<![CDATA[
methodType 用于表示企业bean 的业务、home、组件和/或web 服务终端接口中的方法,或消息驱动bean 的消息监听器方法,或这些方法的集合。 ejb-name元素必须是声明在部署描述中的企业bean 之一;可选的method-intf 元素用于区分分别定义在业务、home、组件和/或web 服务终端接口中且具有相同名字的方法: method-name 元素指定了方法名;可选的 method-params 元素在多个同名方法中标识其中的一个方法 。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值