|
|
In addition, WebLogic Enterprise (WLE) provides the WebLogic EJB Extensions, which are XML elements used to further customize EJBs. For more information, see WebLogic EJB Extensions Reference. For more information about deploying EJBs in the WLE environment, see Building and Deploying Enterprise JavaBeans (EJBs).
A deployment descriptor is a file in the ejb-jar file that defines the following kinds of information:
About Deployment Descriptors
For a complete discussion of the EJB deployment descriptor, see Chapter 16, "Deployment Descriptor," in Sun Microsystem's Enterprise JavaBeans Specification 1.1.
Specifying deployment descriptor information is a required task that a Bean Provider performs. The Bean Provider creates a standard EJB deployment descriptor file using the XML markup conventions in accordance with the syntax described in Sun Microsystem's Enterprise JavaBeans Specification 1.1. Multiple EJBs can be defined in a single deployment descriptor. For more information about creating deployment descriptors, see Building and Deploying Enterprise JavaBeans (EJBs).
An Application Assembler or Deployer may subsequently modify only certain information (such as the EJB name, values of environment entries, and description entries) in the deployment descriptor. The Deployer may use the WebLogic EJB Deployer to update certain settings in the deployment descriptor.
Thereafter, the Application Assembler creates a deployable ejb-jar file using the ejbc
command-line tool, specifying the -i
parameter and passing this filename (ejb-jar.xml
). For more information about the ejbc
command-line tool, see the Command Reference.
Deployment descriptors are stored in the ejb-jar file. The WebLogic EJB Deployer accepts standard, extended, and deployable ejb-jar files.
All valid ejb-jar deployment descriptors must contain the following DOCTYPE declaration:
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd"> EJB Roles and Deployment Descriptors
File Formats
DOCTYPE Declaration
Summary of Deployment Descriptor Elements
Synopsis
Contains application-assembly information.
Syntax
<!ELEMENT assembly-descriptor (security-role*, method-permission*, container-transaction*)>
EJB Role
Application Assembler
Used In
Synopsis
Describes a container-managed field.
Syntax
<!ELEMENT cmp-field (description?, field-name)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies how the container must manage transaction scopes for the EJB's method invocations.
Syntax
<!ELEMENT container-transaction (description?, method+, trans-attribute)>
EJB Role
Application Assembler
Used In
Synopsis
Provides text describing the parent element.
Syntax
<!ELEMENT description (#PCDATA)>
EJB Role
Bean Provider or Application Assembler, and
Used In
Synopsis
Specifies a short name that is intended to be displayed by tools.
Syntax
<!ELEMENT display-name (#PCDATA)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies the fully qualified name of the EJB's class.
Syntax
<!ELEMENT ejb-class (#PCDATA)>
EJB Role
Bean Provider
Used In
Synopsis
Root element of the EJB deployment descriptor.
Syntax
<!ELEMENT ejb-jar (description?, display-name?, small-icon?, large-icon?, enterprise-beans, assembly-descriptor?)>
EJB Role
All
Synopsis
Used in the ejb-ref element to specify that an EJB reference is linked to another EJB in the ejb-jar file.
Syntax
<!ELEMENT ejb-link (#PCDATA)>
Valid Values
The value of the ejb-link element must be the ejb-name of an EJB in the same ejb-jar file, or in another ejb-jar file in the same J2EE application unit.
EJB Role
Application Assembler
Used In
Synopsis
Specifies an EJB's name.
Syntax
<!ELEMENT ejb-name (#PCDATA)>
Valid Values
- The name must be unique among the names of the EJBs in the same ejb-jar file.
- The name must conform to the lexical rules for an NMTOKEN.
Synopsis
Declares a reference to another EJB's home.
Syntax
<!ELEMENT ejb-ref (description?, ejb-ref-name, ejb-ref-type, home, remote, ejb-link?)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies the name of an EJB reference, which is an entry in the EJB's environment.
Syntax
<!ELEMENT ejb-ref-name (#PCDATA)>
Valid Values
It is recommended that name is prefixed with ejb/ .
EJB Role
Bean Provider
Used In
Synopsis
Specifies the expected type (entity or session) of the referenced EJB.
Syntax
<!ELEMENT ejb-ref-type (#PCDATA)>
Valid Values
One of the following values:
- Entity
- Session
Synopsis
Declares one or more EJBs.
Syntax
EJB Role
Bean Provider
Synopsis
Declares an entity bean.
Syntax
<!ELEMENT entity (description?, display-name?, small-icon?, large-icon?, ejb-name, home, remote, ejb-class, persistence-type, prim-key-class, reentrant, cmp-field*, primkey-field?, env-entry*, ejb-ref*, security-role-ref*, resource-ref*)>
Valid Values
- The optional primkey-field may be present in the descriptor if the entity's persistence-type is Container.
- At least one cmp-field element must be present in the descriptor if the entity's persistency-type is Container, and none must not be present if the entity's persistence-type is Bean.
Synopsis
Declares an EJB's environment entries.
Syntax
<!ELEMENT env-entry (description?, env-entry-name, env-entry-type, env-entry-value?)>
EJB Role
Bean Provider or Application Assembler
Used In
Specifies the name of an EJB's environment entry.
Syntax
<!ELEMENT env-entry-name (#PCDATA)>
EJB Role
Bean Provider or Application Assembler
Used In
Synopsis
Specifies the fully qualified Java type of the environment entry value that is expected by the EJB's code.
Syntax
<!ELEMENT env-entry-type (#PCDATA)>
Valid Values
One of the following values:
- java.lang.Boolean
- java.lang.String
- java.lang.Integer
- java.lang.Double
- java.lang.Byte
- java.lang.Short
- java.lang.Long
- java.lang.Float
Synopsis
Specifies the value of an EJB's environment entry.
Syntax
<!ELEMENT env-entry-value (#PCDATA)>
EJB Role
Bean Provider or Application Assembler
Used In
Synopsis
Specifies the name of a container-managed field.
Syntax
<!ELEMENT field-name (#PCDATA)>
Valid Values
The name must be a public field of the EJB class or one of its superclasses.
EJB Role
Bean Provider
Used In
Synopsis
Specifies the fully qualified name of the EJB's home interface.
Syntax
<!ELEMENT home (#PCDATA)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies the name of a file containing a large (32 x 32) icon image. The file name is a relative path within the ejb-jar file.
Syntax
<!ELEMENT large-icon (#PCDATA)>
Valid Values
- The image must be either in the JPEG or GIF format.
- The file name must end with the suffix.jpg or .gif respectively.
Synopsis
Denotes a method of an EJB's home or remote interface, or a set of methods.
Syntax
<!ELEMENT method (description?, ejb-name, method-intf?, method-name, method-params?)>
Valid Values
The ejb-name element must be the name of one of the EJBs declared in the deployment descriptor.
EJB Role
Application Assembler
Used In
Synopsis
Allows a method element to differentiate between the methods, with the same name and signature, that are defined in both the remote and home interfaces.
Syntax
<!ELEMENT method-intf (#PCDATA)>
Valid Values
One of the following values:
- Home
- Remote
Synopsis
Specifies the name of an EJB method, or the asterisk (*) character, which is used when the element denotes all the methods of an EJB's remote and home interfaces.
Syntax
<!ELEMENT method-name (#PCDATA)>
EJB Role
Application Assembler
Used In
Synopsis
Specifies the fully qualified Java type name of a method parameter.
Syntax
<!ELEMENT method-param (#PCDATA)>
EJB Role
Application Assembler
Used In
Synopsis
Contains a list of the fully qualified Java type names of the method parameters.
Syntax
<!ELEMENT method-params (method-param*)>
EJB Role
Application Assembler
Used In
Synopsis
Specifies one or more security roles that are allowed to invoke one or more EJB methods.
Syntax
<!ELEMENT method-permission (description?, role-name+, method+)>
Valid Values
- The security roles used in the method-permission element must be defined in the security-role element of the deployment descriptor.
- The methods must be methods defined in the EJB's remote and/or home interfaces.
Synopsis
Specifies an entity bean's persistence management type (bean- or container-managed).
Syntax
<!ELEMENT persistence-type (#PCDATA)>
Valid Values
One of the following values:
- Bean
- Container
Synopsis
Specifies the fully qualified name of an entity bean's primary key class.
Syntax
<!ELEMENT prim-key-class (#PCDATA)>
Valid Values
If the definition of the primary key class is deferred to deployment time, the prim-key-class element should specify java.lang.Object .
EJB Role
Bean Provider
Used In
Synopsis
Specifies the name of the primary key field for an entity with container-managed persistence.
Syntax
<!ELEMENT primkey-field (#PCDATA)>
Valid Values
- The primkey-field must be one of the fields declared in the cmp-field element.
- The type of the field must be the same as the primary key type.
Synopsis
Specifies whether an entity bean is reentrant (True) or not (False).
Syntax
<!ELEMENT reentrant (#PCDATA)>
Valid Values
One of the following values:
- True
- False
Synopsis
Specifies the fully qualified name of the EJB's remote interface.
Syntax
<!ELEMENT remote (#PCDATA)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies whether the EJB code signs on programmatically to the resource manager, or whether the Container will sign on to the resource manager on behalf of the bean. In the latter case, the Container uses information that is supplied by the Deployer.
Syntax
<!ELEMENT res-auth (#PCDATA)>
Valid Values
One of the following values:
- Application
- Container
Synopsis
Specifies the name of a resource manager connection factory reference.
Syntax
<!ELEMENT res-ref-name (#PCDATA)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies the type of the data source, which is the Java interface (or class) expected to be implemented by the data source.
Syntax
<!ELEMENT res-type (#PCDATA)>
EJB Role
Bean Provider
Used In
Synopsis
Declares the EJB's reference to an external resource.
Syntax
<!ELEMENT resource-ref (description?, res-ref-name, res-type, res-auth)>
EJB Role
Bean Provider
Used In
Synopsis
Links a security role reference to a defined security role.
Syntax
<!ELEMENT role-link (#PCDATA)>
Valid Values
The role-link element must contain the name of one of the security roles defined in the security-role elements.
EJB Role
Application Assembler
Used In
Synopsis
Specifies the name of a security role.
Syntax
<!ELEMENT role-name (#PCDATA)>
Valid Values
The name must conform to the lexical rules for an NMTOKEN.
EJB Role
Application Assembler
Used In
Synopsis
Defines a security role.
Syntax
<!ELEMENT security-role (description?, role-name)>
EJB Role
Application Assembler
Used In
Synopsis
Declares a security role reference in the EJB's code.
Syntax
<!ELEMENT security-role-ref (description?, role-name, role-link?)>
Valid Values
- The value of the role-name element must be the String used as the parameter to the EJBContext.isCallerInRole(String roleName) method.
- The value of the role-link element must be the name of one of the security roles defined in the security-role elements.
Synopsis
Specifies the type of a session bean (stateful or stateless).
Syntax
<!ELEMENT session-type (#PCDATA)>
Valid Values
One of the following values:
- Stateful
- Stateless
Synopsis
Declares a session bean.
Syntax
<!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*)>
EJB Role
Bean Provider
Used In
Synopsis
Specifies the name of a file containing a small (16 x 16) icon image. The file name is relative path within the ejb-jar file.
Syntax
<!ELEMENT small-icon (#PCDATA)>
Valid Values
- The image must be either in the JPEG or GIF format.
- The file name must end with the suffix .jpg or .gif respectively.
Synopsis
Specifies the transaction management type of an EJB (bean- or container-managed).
Syntax
<!ELEMENT transaction-type (#PCDATA)>
Valid Values
One of the following values:
- Bean
- Container
Synopsis
Specifies how the container must manage the transaction boundaries when delegating a method invocation to an EJB's business method.
Syntax
<!ELEMENT trans-attribute (#PCDATA)>
Valid Values
One of the following values:
- NotSupported
- Supports
- Required
- RequiresNew
- Mandatory
- Never
Synopsis
The ID mechanism allows tools that produce additional deployment information (such as information beyond the standard EJB deployment descriptor information) to store the non-standard information in a separate file, and easily refer from these tools-specific files to the information in the standard deployment descriptor.
The EJB architecture does not allow the tools to add the nonstandard information into the EJB deployment descriptor.
Syntax
<!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-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>
Copyright © 1999 BEA Systems, Inc. All rights reserved.
Required browser: Netscape 4.0 or higher, or Microsoft Internet Explorer 4.0 or higher.