EJB3的XML Schema第二讲

本文详细解析了EJB配置中的关键元素,如ejb-name的作用及唯一性要求,security-role-ref如何建立角色链接,以及消息驱动bean的配置属性等。

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

紧接上文:
<xsd:key name="ejb-name-key">
<xsd:annotation>
<xsd:documentation>
ejb-name 元素包含了企业bean 的名字。在ejb-jar 文件中,这个名字必须唯一。
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:enterprise-beans/*"/>
<xsd:field xpath="javaee:ejb-name"/>
</xsd:key>
<xsd:keyref name="ejb-name-references" refer="javaee:ejb-name-key">
<xsd:annotation>
<xsd:documentation>
keyref 表示来自relationship-role-source 的引用必须是一个定义在enterprise-beans 元素范围内的ejb-name。
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath=".//javaee:ejb-relationship-role/javaee:relationship-role-source"/>
<xsd:field xpath="javaee:ejb-name"/>
</xsd:keyref>
<xsd:key name="role-name-key">
<xsd:annotation>
<xsd:documentation>
指定role-name-key 是为了在security-role-refs 中引用。
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:assembly-descriptor/javaee:security-role"/>
<xsd:field xpath="javaee:role-name"/>
</xsd:key>
<xsd:keyref name="role-name-references" refer="javaee:role-name-key">
<xsd:annotation>
<xsd:documentation>
keyref 表示security-role-ref 到role-name 的引用.
</xsd:documentation>
</xsd:annotation>
<xsd:selector xpath="javaee:enterprise-beans/*/javaee:securityrole-ref"/>
<xsd:field xpath="javaee:role-link"/>
</xsd:keyref>
</xsd:element>
<!-- **************************************************** -->
<xsd:complexType name="activation-config-propertyType">
<xsd:annotation>
<xsd:documentation>
activation-config-propertyType 包含了一个用于消息驱动bean 的名称/值配置属性对。由消息类型来识别的这些用于消息驱动bean 的属性。
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="activation-config-property-name" type="javaee:xsdStringType">
<xsd:annotation>
<xsd:documentation>
activation-config-property-name 元素包含了消息驱动bean 的激活配置属性的名字。对于JMS 消息驱动bean 来说,下面的属性是可以被识别的:
acknowledgeMode,messageSelector,destinationType, subscriptionDurability
</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="activation-config-property-value" type="javaee:xsdStringType">
<xsd:annotation>
<xsd:documentation>
activation-config-property-value 元素包含消息驱动bean 激活配置属性的值。
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="activation-configType">
<xsd:annotation>
<xsd:documentation>
activation-configType 定义了关于消息驱动bean 在操作环境中期望的配置属性信息。它可以包括消息确认,消息选择器,期望的目的地类型等等信息。
配置信息用名称/值配置属性来表达。
根据消息类型来识别这些用于特定消息驱动bean 的属性。
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="description" type="javaee:descriptionType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="activation-config-property" type="javaee:activation-config-propertyType" maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID"/>
</xsd:complexType>
<!-- **************************************************** -->
<xsd:complexType name="application-exceptionType">
<xsd:annotation>
<xsd:documentation>
application-exceptionType 声明一个应用异常。这个声明包括:
-异常类。当容器收到这种类型的异常时,它将它作为应用异常转发到客户端,而不管它是受检查异常还是不检查的异常。
-一个可选的rollback 元素。如果这个元素被设置成true,那么容器必须在转发异常之前回滚事务。如果没有指定,则缺省是false。
</xsd:documentation>
</xsd:annotation>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值