📄 ejb-jar.dtd
字号:
Style 1: The following method element refers to all the methods of the EmployeeService bean's home and remote interfaces: <method> <ejb-name>EmployeeService</ejb-name> <method-name>*</method-name> </method> Style 2: The following method element refers to all the create methods of the EmployeeService bean's home interface: <method> <ejb-name>EmployeeService</ejb-name> <method-name>create</method-name> </method> Style 3: The following method element refers to the create(String firstName, String LastName) method of the EmployeeService bean's home interface. <method> <ejb-name>EmployeeService</ejb-name> <method-name>create</method-name> <method-params> <method-param>java.lang.String</method-param> <method-param>java.lang.String</method-param> </method-params> </method> The following example illustrates a Style 3 element with more complex parameter types. The method foobar(char s, int i, int[] iar, mypackage.MyClass mycl, mypackage.MyClass[][] myclaar) would be specified as: <method> <ejb-name>EmployeeService</ejb-name> <method-name>foobar</method-name> <method-params> <method-param>char</method-param> <method-param>int</method-param> <method-param>int[]</method-param> <method-param>mypackage.MyClass</method-param> <method-param>mypackage.MyClass[][]</method-param> </method-params> </method> The optional method-intf element can be used when it becomes necessary to differentiate between a method defined in the home interface and a method with the same name and signature that is defined in the remote interface. For example, the method element <method> <ejb-name>EmployeeService</ejb-name> <method-intf>Remote</method-intf> <method-name>create</method-name> <method-params> <method-param>java.lang.String</method-param> <method-param>java.lang.String</method-param> </method-params> </method> can be used to differentiate the create(String, String) method defined in the remote interface from the create(String, String) method defined in the home interface, which would be defined as <method> <ejb-name>EmployeeService</ejb-name> <method-intf>Home</method-intf> <method-name>create</method-name> <method-params> <method-param>java.lang.String</method-param> <method-param>java.lang.String</method-param> </method-params> </method>--><!ELEMENT method (description?, ejb-name, method-intf?, method-name, method-params?)><!--The method-intf element allows a method element to differentiatebetween the methods with the same name and signature that are definedin both the remote and home interfaces.The method-intf element must be one of the following: <method-intf>Home</method-intf> <method-intf>Remote</method-intf>Used in: method--><!ELEMENT method-intf (#PCDATA)><!--The method-name element contains a name of an enterprise bean method,or the asterisk (*) character. The asterisk is used when the elementdenotes all the methods of an enterprise bean's remote and homeinterfaces.Used in: method--><!ELEMENT method-name (#PCDATA)><!--The method-param element contains the fully-qualified Java type name ofa method parameter.Used in: method-params--><!ELEMENT method-param (#PCDATA)><!--The method-params element contains a list of the fully-qualified Javatype names of the method parameters.Used in: method--><!ELEMENT method-params (method-param*)><!--The method-permission element specifies that one or more security rolesare allowed to invoke one or more enterprise bean methods. Themethod-permission element consists of an optional description, a listof security role names, and a list of method elements.The security roles used in the method-permission element must bedefined in the security-role element of the deployment descriptor, andthe methods must be methods defined in the enterprise bean's remoteand/or home interfaces.Used in: assembly-descriptor--><!ELEMENT method-permission (description?, role-name+, method+)><!--The persistence-type element specifies an entity bean's persistencemanagement type.The persistence-type element must be one of the two following: <persistence-type>Bean</persistence-type> <persistence-type>Container</persistence-type>Used in: entity--><!ELEMENT persistence-type (#PCDATA)><!--The prim-key-class element contains the fully-qualified name of anentity bean's primary key class.If the definition of the primary key class is deferred to deploymenttime, the prim-key-class element should specify java.lang.Object.Used in: entityExamples: <prim-key-class>java.lang.String</prim-key-class> <prim-key-class>com.wombat.empl.EmployeeID</prim-key-class> <prim-key-class>java.lang.Object</prim-key-class>--><!ELEMENT prim-key-class (#PCDATA)><!--The primkey-field element is used to specify the name of the primarykey field for an entity with container-managed persistence.The primkey-field must be one of the fields declared in the cmp-fieldelement, and the type of the field must be the same as the primary keytype.The primkey-field element is not used if the primary key maps tomultiple container-managed fields (i.e. the key is a compound key). Inthis case, the fields of the primary key class must be public, andtheir names must correspond to the field names of the entity bean classthat comprise the key.Used in: entityExample: <primkey-field>EmployeeId</primkey-field>--><!ELEMENT primkey-field (#PCDATA)><!--The reentrant element specifies whether an entity bean is reentrant or not.The reentrant element must be one of the two following: <reentrant>True</reentrant> <reentrant>False</reentrant>Used in: entity--><!ELEMENT reentrant (#PCDATA)><!--The remote element contains the fully-qualified name of the enterprisebean's remote interface.Used in: ejb-ref, entity, and sessionExample: <remote>com.wombat.empl.EmployeeService</remote>--><!ELEMENT remote (#PCDATA)><!--The res-auth element specifies whether the enterprise bean code signson programmatically to the resource manager, or whether the Containerwill sign on to the resource manager on behalf of the bean. In thelatter case, the Container uses information that is supplied by theDeployer.The value of this element must be one of the two following: <res-auth>Application</res-auth> <res-auth>Container</res-auth>--><!ELEMENT res-auth (#PCDATA)><!--The res-ref-name element specifies the name of a resource managerconnection factory reference.Used in: resource-ref--><!ELEMENT res-ref-name (#PCDATA)><!--The res-type element specifies the type of the data source. The type isspecified by the Java interface (or class) expected to be implementedby the data source.Used in: resource-ref--><!ELEMENT res-type (#PCDATA)><!--The resource-ref element contains a declaration of enterprise bean'sreference to an external resource. It consists of an optionaldescription, the resource manager connection factory reference name,the indication of the resource manager connection factory type expectedby the enterprise bean code, and the type of authentication (bean orcontainer).Used in: entity and sessionExample: <resource-ref> <res-ref-name>EmployeeAppDB</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> </resource-ref>--><!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)><!--The role-link element is used to link a security role reference to adefined security role. The role-link element must contain the name ofone of the security roles defined in the security-role elements.Used in: security-role-ref--><!ELEMENT role-link (#PCDATA)><!--The role-name element contains the name of a security role.The name must conform to the lexical rules for an NMTOKEN.Used in: method-permission, security-role, and security-role-ref--><!ELEMENT role-name (#PCDATA)><!--The security-role element contains the definition of a security role.The definition consists of an optional description of the securityrole, and the security role name.Used in: assembly-descriptorExample: <security-role> <description> This role includes all employees who are authorized to access the employee service application. </description> <role-name>employee</role-name> </security-role>--><!ELEMENT security-role (description?, role-name)><!--The security-role-ref element contains the declaration of a securityrole reference in the enterprise bean's code. The declaration consistsof an optional description, the security role name used in the code,and an optional link to a defined security role.The value of the role-name element must be the String used as theparameter to the EJBContext.isCallerInRole(String roleName) method.The value of the role-link element must be the name of one of thesecurity roles defined in the security-role elements.Used in: entity and session--><!ELEMENT security-role-ref (description?, role-name, role-link?)><!--The session-type element describes whether the session bean is astateful session, or stateless session.The session-type element must be one of the two following: <session-type>Stateful</session-type> <session-type>Stateless</session-type>--><!ELEMENT session-type (#PCDATA)><!--The session element declares an session bean. The declaration consistsof: an optional description; optional display name; optional small iconfile name; optional large icon file name; a name assigned to theenterprise bean in the deployment description; the names of the sessionbean's home and remote interfaces; the session bean's implementationclass; the session bean's state management type; the session bean'stransaction management type; an optional declaration of the bean'senvironment entries; an optional declaration of the bean's EJBreferences; an optional declaration of the security role references;and an optional declaration of the bean's resource manager connectionfactory references.The elements that are optional are "optional" in the sense that theyare omitted when if lists represented by them are empty.Used in: enterprise-beans--><!ELEMENT session (description?, display-name?, small-icon?, large-icon?, ejb-name, home, remote, ejb-class, session-type, transaction-type, env-entry*, ejb-ref*, security-role-ref*, resource-ref*)><!--The small-icon element contains the name of a file containing a small(16 x 16) icon image. The file name is relative path within the ejb-jarfile.The image must be either in the JPEG or GIF format, and the file namemust end with the suffix ".jpg" or ".gif" respectively.The icon can be used by tools.Example: <small-icon>employee-service-icon16x16.jpg</small-icon>--><!ELEMENT small-icon (#PCDATA)><!--The transaction-type element specifies an enterprise bean's transactionmanagement type.The transaction-type element must be one of the two following: <transaction-type>Bean</transaction-type> <transaction-type>Container</transaction-type>Used in: session--><!ELEMENT transaction-type (#PCDATA)><!--The trans-attribute element specifies how the container must manage thetransaction boundaries when delegating a method invocation to anenterprise bean's business method.The value of trans-attribute must be one of the following: <trans-attribute>NotSupported</trans-attribute> <trans-attribute>Supports</trans-attribute> <trans-attribute>Required</trans-attribute> <trans-attribute>RequiresNew</trans-attribute> <trans-attribute>Mandatory</trans-attribute> <trans-attribute>Never</trans-attribute>Used in: container-transaction--><!ELEMENT trans-attribute (#PCDATA)><!--The ID mechanism is to allow tools that produce additional deploymentinformation (i.e information beyond the standard EJB deploymentdescriptor information) to store the non-standard information in aseparate file, and easily refer from these tools-specific files to theinformation in the standard deployment descriptor.The EJB architecture does not allow the tools to add the non-standardinformation into the EJB deployment descriptor.--><!ATTLIST assembly-descriptor id ID #IMPLIED><!ATTLIST cmp-field id ID #IMPLIED><!ATTLIST container-transaction id ID #IMPLIED><!ATTLIST description id ID #IMPLIED><!ATTLIST display-name id ID #IMPLIED><!ATTLIST ejb-class id ID #IMPLIED><!ATTLIST ejb-client-jar id ID #IMPLIED><!ATTLIST ejb-jar id ID #IMPLIED><!ATTLIST ejb-link id ID #IMPLIED><!ATTLIST ejb-name id ID #IMPLIED><!ATTLIST ejb-ref id ID #IMPLIED><!ATTLIST ejb-ref-name id ID #IMPLIED><!ATTLIST ejb-ref-type id ID #IMPLIED><!ATTLIST enterprise-beans id ID #IMPLIED><!ATTLIST entity id ID #IMPLIED><!ATTLIST env-entry id ID #IMPLIED><!ATTLIST env-entry-name id ID #IMPLIED><!ATTLIST env-entry-type id ID #IMPLIED><!ATTLIST env-entry-value id ID #IMPLIED><!ATTLIST field-name id ID #IMPLIED><!ATTLIST home id ID #IMPLIED><!ATTLIST large-icon id ID #IMPLIED><!ATTLIST method id ID #IMPLIED><!ATTLIST method-intf id ID #IMPLIED><!ATTLIST method-name id ID #IMPLIED><!ATTLIST method-param id ID #IMPLIED><!ATTLIST method-params id ID #IMPLIED><!ATTLIST method-permission id ID #IMPLIED><!ATTLIST persistence-type id ID #IMPLIED><!ATTLIST prim-key-class id ID #IMPLIED><!ATTLIST primkey-field id ID #IMPLIED><!ATTLIST reentrant id ID #IMPLIED><!ATTLIST remote id ID #IMPLIED><!ATTLIST res-auth id ID #IMPLIED><!ATTLIST res-ref-name id ID #IMPLIED><!ATTLIST res-type id ID #IMPLIED><!ATTLIST resource-ref id ID #IMPLIED><!ATTLIST role-link id ID #IMPLIED><!ATTLIST role-name id ID #IMPLIED><!ATTLIST security-role id ID #IMPLIED><!ATTLIST security-role-ref id ID #IMPLIED><!ATTLIST session-type id ID #IMPLIED><!ATTLIST session id ID #IMPLIED><!ATTLIST small-icon id ID #IMPLIED><!ATTLIST transaction-type id ID #IMPLIED><!ATTLIST trans-attribute id ID #IMPLIED>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -