Oracle9iAS Containers for J2EE Enterprise JavaBean Developer's Guide and Reference Release 2 (9.0.2) Part Number A95881-01 |
|
This appendix describes the elements contained within the OC4J-specific EJB deployment descriptor: orion-ejb-jar.dtd
. Some of the elements within this deployment descriptor are too complex for this appendix, so references to another source may be mentioned.
The description of this deployment descriptor has been divided into the following sections:
Whenever you deploy an application, OC4J automatically generates the OC4J-specific XML file with the default elements. If you want to change these defaults, you must copy the orion-ejb-jar.xml
file to where your original ejb-jar.xml
file is located and change it in this location. If you change the XML file within the deployed location, OC4J simply overwrites these changes when the application is deployed again. The changes only stay constant when changed in the development directories.
Oracle recommends that you add your OC4J-specific XML files within the recommended development structure as shown in Figure A-1.
The OC4J-specific deployment descriptor contains extended deployment information for session beans, entity beans, message driven beans, and security for these EJBs. The major element structure within this deployment descriptor has the following structure:
<orion-ejb-jar deployment-time=... deployment-version=...> <enterprise-beans> <session-deployment ...></session-deployment> <entity-deployment ...></entity-deployment> <message-driven-deployment ...></message-driven-deployment> <jem-deployment ...></jem-deployment> <jem-server-extension ...></jem-server-extension> </enterprise-beans> <assembly-descriptor> <security-role-mapping ...></security-role-mapping> <default-method-access></default-method-access> </assembly-descriptor> </orion-ejb-jar>
Each section under the <orion-ejb-jar>
main tag has its own purpose. These are described in the sections below:
The <enterprise-beans>
section defines additional deployment information for all EJBs: session beans, entity beans, and message driven beans. There is a section for each type of EJB.
The following sections describe the elements within <enterprise-beans>
element;
The <session-bean>
section provides additional deployment information for a session bean deployed within this JAR file. The <session-bean>
section contains the following structure:
<session-deployment call-timeout=... copy-by-value=... location=... max-tx-retries=... name=... persistence-filename=... timeout=... wrapper=... <env-entry-mapping name=...> </env-entry-mapping <ejb-ref-mapping location=... name=... /> <resource-ref-mapping location=... name=... > <lookup-context location=...> <context-attribute name=... value=... /> </lookup-context> </resource-ref-mapping> </session-deployment>
The <entity-bean>
section provides additional deployment information for an entity bean deployed within this JAR file. The <entity-bean>
section contains the following structure:
<entity-deployment call-timeout=... clustering-schema=... copy-by-value=... data-source=... exclusive-write-access=... isolation=... location=... max-tx-retries=... name=... table=... validity-timeout=... wrapper=...> <primkey-mapping> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </primkey-mapping> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...> </cmp-field-mapping> <finder-method partial=... query=... > <method></method> </finder-method> <env-entry-mapping name=...></env-entry-mapping> <ejb-ref-mapping location=... name=... /> <resource-ref-mapping location=... name=... > <lookup-context location=...> <context-attribute name=... value=... /> </lookup-context> </resource-ref-mapping> </entity-deployment>
The <message-driven-bean>
section provides additional deployment information for a message driven bean deployed within this JAR file. The <message-driven-bean>
section contains the following structure:
<message-driven-deployment connection-factory-location=...
destination-location=... name=...> <env-entry-mapping name=...></env-entry-mapping> <ejb-ref-mapping location=... name=... /> <resource-ref-mapping location=... name=... > <lookup-context location=...> <context-attribute name=... value=... /> </lookup-context> </resource-ref-mapping> </message-driven-deployment>
The <jem-server-extension>
section defines the JNDI name of the database where the AC4J Databus is installed. The <jem-server-extension> contains the following structure:
<jem-server-extension data-source-location=...> <description></description> </jem-server-extension>
The <jem-deployment>
section provides additional deployment information for an active EJB deployed within this JAR file. The <jem-deployment>
section contains the following structure:
<jem-deployment jem-name=... ejb-name=...> <description></description> <called-by> <caller caller-identity=.../> </called-by> <security-identity> <description></description> <use-caller-identity></use-caller-identity> </security-identity> </jem-deployment>
The mapping of logical names to actual names can be a complex process. See "Object-Relational Mapping of Persistent Fields" for a discussion on mapping CMP data fields.
The following are the XML elements used for CMP persistent data field mapping within the orion-ejb-jar.xml
file:
<cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...> <fields> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </fields> <properties> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </properties> <entity-ref home=...> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </entity-ref> <list-mapping table=...> <primkey-mapping> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </primkey-mapping> <value-mapping immutable="true|false" type=...> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </value-mapping> </list-mapping> <collection-mapping table=...> <primkey-mapping> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </primkey-mapping> <value-mapping immutable="true|false" type=...> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </value-mapping> </collection-mapping> <set-mapping table=...> <primkey-mapping> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </primkey-mapping> <value-mapping immutable="true|false" type=...> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </value-mapping> </set-mapping> <map-mapping table=...> <primkey-mapping> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </primkey-mapping> <map-key-mapping type=...> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </map-key-mapping> <value-mapping immutable="true|false" type=...> <cmp-field-mapping ejb-reference-home=... name=... persistence-name=... persistence-type=...></cmp-field-mapping> </value-mapping> </map-mapping> </cmp-field-mapping>
The following structure is used to specify the methods (and possibly parameters of that method) of the bean.
<method> <description></description> <ejb-name></ejb-name> <method-intf></method-intf> <method-name></method-name> <method-params> <method-param></method-param> </method-params> </method>
The style used can be one of the following:
<method> <ejb-name>EJBNAME</ejb-name> <method-name>*</method-name> </method>
<method> <ejb-name>EJBNAME</ejb-name> <method-name>METHOD</method-name> </method>>
<method> <ejb-name>EJBNAME</ejb-name> <method-name>METHOD</method-name> <method-params> <method-param>PARAM-1</method-param> <method-param>PARAM-2</method-param> ... <method-param>PARAM-n</method-param> </method-params> <method>
In addition to specifying deployment information for individual beans, you can also specify addition deployment information for security in the <assembly-descriptor>
section. The <assembly-descriptor>
section contains the following structure:
<assembly-descriptor> <security-role-mapping impliesAll=... name=...> <group name=... /> <user name=... /> </security-role-mapping> <default-method-access> <security-role-mapping impliesAll=... name=...> <group name=... /> <user name=... /> </security-role-mapping> </default-method-access> </assembly-descriptor>
The following lists the orion-ejb-jar.xml
DTD to show the ordering required, and optional parameters for each element. The definitions for each element is described in "Element Description".
<!ELEMENT properties (cmp-field-mapping*)> <!ELEMENT fields (cmp-field-mapping*)> <!ELEMENT session-deployment (env-entry-mapping*, ejb-ref-mapping*, resource-ref-mapping*)> <!ATTLIST session-deployment call-timeout CDATA #IMPLIED copy-by-value CDATA #IMPLIED location CDATA #IMPLIED max-tx-retries CDATA #IMPLIED name CDATA #IMPLIED persistence-filename CDATA #IMPLIED timeout CDATA #IMPLIED wrapper CDATA #IMPLIED replication CDATA #IMPLIED> <!ELEMENT collection-mapping (primkey-mapping, value-mapping)> <!ATTLIST collection-mapping table CDATA #IMPLIED> <!ELEMENT resource-ref-mapping (lookup-context?)> <!ATTLIST resource-ref-mapping location CDATA #IMPLIED name CDATA #REQUIRED> <!ELEMENT method-intf (#PCDATA)> <!ELEMENT entity-ref (cmp-field-mapping)> <!ATTLIST entity-ref home CDATA #IMPLIED> <!ELEMENT enterprise-beans ((session-deployment | entity-deployment | message-driven-deployment | jem-deployment)+, jem-server-extension?)> <!ELEMENT ejb-ref-mapping (#PCDATA)> <!ATTLIST ejb-ref-mapping location CDATA #IMPLIED name CDATA #REQUIRED> <!ELEMENT primkey-mapping (cmp-field-mapping)> <!ELEMENT description (#PCDATA)> <!ELEMENT env-entry-mapping (#PCDATA)> <!ATTLIST env-entry-mapping name CDATA #IMPLIED> <!ELEMENT security-role-mapping (group*, user*)> <!ATTLIST security-role-mapping impliesAll CDATA #IMPLIED name CDATA #IMPLIED> <!ELEMENT method-params (method-param*)> <!ELEMENT cmp-field-mapping (fields|properties|entity-ref|list-mapping|collection-mapping|set-mapping| map-mapping|field-persistence-manager)?> <!ATTLIST cmp-field-mapping ejb-reference-home CDATA #IMPLIED name CDATA #IMPLIED persistence-name CDATA #IMPLIED persistence-type CDATA #IMPLIED> <!ELEMENT list-mapping (primkey-mapping, value-mapping)> <!ATTLIST list-mapping table CDATA #IMPLIED> <!ELEMENT group (#PCDATA)> <!ATTLIST group name CDATA #IMPLIED> <!ELEMENT default-method-access (security-role-mapping)> <!ELEMENT map-key-mapping (cmp-field-mapping)> <!ATTLIST map-key-mapping type CDATA #IMPLIED> <!ELEMENT map-mapping (primkey-mapping, map-key-mapping, value-mapping)> <!ATTLIST map-mapping table CDATA #IMPLIED> <!ELEMENT value-mapping (cmp-field-mapping)> <!ATTLIST value-mapping immutable CDATA #IMPLIED type CDATA #IMPLIED> <!ELEMENT method-param (#PCDATA)> <!ELEMENT user (#PCDATA)> <!ATTLIST user name CDATA #IMPLIED> <!ELEMENT lookup-context (context-attribute+)> <!ATTLIST lookup-context location CDATA #IMPLIED> <!ELEMENT context-attribute (#PCDATA)> <!ATTLIST context-attribute name CDATA #IMPLIED value CDATA #IMPLIED> <!ELEMENT set-mapping (primkey-mapping, value-mapping)> <!ATTLIST set-mapping table CDATA #IMPLIED> <!ELEMENT message-driven-deployment (env-entry-mapping*, ejb-ref-mapping*, resource-ref-mapping*)> <!ATTLIST message-driven-deployment cache-timeout CDATA #IMPLIED connection-factory-location CDATA #IMPLIED destination-location CDATA #IMPLIED max-instances CDATA #IMPLIED min-instances CDATA #IMPLIED name CDATA #IMPLIED> <!ELEMENT jem-server-extension (description?, data-bus?)> <!ATTLIST jem-server-extension data-source-location CDATA #REQUIRED scheduling-threads CDATA #IMPLIED> <!ELEMENT data-bus EMPTY> <!ATTLIST data-bus data-bus-name CDATA #REQUIRED url CDATA #IMPLIED> <!ELEMENT jem-deployment (description?, data-bus?, called-by, security-identity)> <!ATTLIST jem-deployment jem-name CDATA #REQUIRED ejb-name CDATA #REQUIRED> <!ELEMENT called-by (caller+)> <!ELEMENT caller EMPTY> <!ATTLIST caller caller-identity CDATA #REQUIRED> <!ELEMENT security-identity (description?,(use-caller-identity|run-as-specified-identity))> <!ELEMENT use-caller-identity EMPTY> <!ELEMENT run-as-specified-identity (description?, role-name)> <!ELEMENT role-name (#PCDATA)> <!ELEMENT ejb-name (#PCDATA)> <!ELEMENT field-persistence-manager (property)> <!ATTLIST field-persistence-manager class CDATA #IMPLIED> <!ELEMENT property (#PCDATA)> <!ATTLIST property name CDATA #IMPLIED value CDATA #IMPLIED> <!ELEMENT finder-method (method)> <!ATTLIST finder-method partial CDATA #IMPLIED query CDATA #IMPLIED> <!ELEMENT method (description?, ejb-name, method-intf?, method-name, method-params?)> <!ELEMENT entity-deployment (primkey-mapping?, cmp-field-mapping*, finder-method*, env-entry-mapping*, ejb-ref-mapping*, resource-ref-mapping*)> <!ATTLIST entity-deployment call-timeout CDATA #IMPLIED clustering-schema CDATA #IMPLIED copy-by-value CDATA #IMPLIED data-source CDATA #IMPLIED exclusive-write-access CDATA #IMPLIED instance-cache-timeout CDATA #IMPLIED location CDATA #IMPLIED isolation (commited | serializable | uncommited | repeatable_reads) CDATA #IMPLIED locking-mode (pessimistic | optimistic | read-only | old_pessimistic) max-instances CDATA #IMPLIED min-instances CDATA #IMPLIED max-instances-per-pk CDATA #IMPLIED min-instances-per-pk CDATA #IMPLIED max-tx-retries CDATA #IMPLIED update-changed-fields-only (true | false) "true" name CDATA #IMPLIED pool-cache-timeout CDATA #IMPLIED table CDATA #IMPLIED validity-timeout CDATA #IMPLIED wrapper CDATA #IMPLIED> <!ELEMENT orion-ejb-jar (enterprise-beans, assembly-descriptor)> <!ATTLIST orion-ejb-jar deployment-time CDATA #IMPLIED deployment-version CDATA #IMPLIED> <!ELEMENT assembly-descriptor (security-role-mapping*, default-method-access?)> <!ELEMENT method-name (#PCDATA)>
The mapping of the assembly descriptor elements.
Deployment information for a container-managed persistence field. If no subtags are used to define different behavior, the field is persisted through serialization or native handling of "recognized" primitive types.
Attributes:
Specifies a relational mapping of a Collection type. A Collection consists of n unordered items (order isnt specified and not relevant). The field containing the mapping must be of type java.util.Collection.
Attiributes:
An attribute sent to the context. The only mandatory attribute in JNDI is the 'java.naming.factory.initial
' which is the classname of the context factory implementation.
Attributes:
The default method access policy for methods not tied to a method-permission.
A short description.
The ejb-name element specifies an enterprise bean's name. This name is assigned by the ejb-jar file producer to name the enterprise bean in the ejb-jar file's deployment descriptor. The name must be unique among the names of the enterprise beans in the same ejb-jar file. The enterprise bean code does not depend on the name; therefore the name can be changed during the application-assembly process without breaking the enterprise bean's function. There is no architected relationship between the ejb-name in the deployment descriptor and the JNDI name that the Deployer will assign to the enterprise bean's home. The name must conform to the lexical rules for an NMTOKEN.
The ejb-ref
element that is used for the declaration of a reference to another enterprise bean's home. The ejb-ref-mapping
element ties this to a JNDI-location when deploying.
Attributes:
The beans contained in this EJB JAR file.
Deployment information for an entity bean.
Attributes:
RemoteException
, treating it as a deadlock). This is also used as a SQL query timeout. If the timeout occurs before the SQL query finishes, a SQL exception is thrown. If zero, the timeout is disabled. The default is 90 seconds.
read_only
" locking mode. In this case, it increases the performance for common bean operations and enables better caching. The default is false.
PESSIMISTIC
: This manages resource contention and does not allow parallel execution. Only one user at a time is allowed to execute the entity bean at a single time.
OPTIMISTIC
: Multiple users can execute the entity bean in parallel. It does not monitor resource contention; thus, the burden of the data consistency is placed on the database isolation modes. This is the default.
READ-ONLY
: Multiple users can execute the entity bean in parallel. The container does not allow any updates to the bean's state.
ejb-jar.xml
).
read_only
and when exclusive-write-access="true" (the default).
ejbStore
is invoked. The default is true, which specifies to only update modified fields.
Specified the configuration for persisting an entity reference via it's primary key. The child-tag of this tag is the specification of how to persist the primary key.
Attributes:
Overrides the value of an env-entry
in the assembly descriptor. It is used to keep the EAR clean from deployment-specific values. The body is the value.
Attribute:
Specifies the configuration of a field-based (java class field) mapping persistence for this field. The fields that are to be persisted have to be public, non-static, non-final and the type of the containing object has to have an empty constructor.
The definition of a container-managed finder method. This defines the selection criteria in a findByXXX
() method in the bean's home.
Attributes:
A group that this <security-role-mapping>
implies. That is, all members of the specified group are included in this role.
Attributes:
Specifies an active EJB for deployment into the AC4J container.
Attributes:
Describes the database server where the Databus is installed
Attributes:
data-sources.xml
file.
Specifies a relational mapping of a List type. A List is a sequential (where order/index is important) Collection of items. The field containing the mapping must be of type java.util.List or the legacy types java.util.Vector or Type[].
Attributes:
The specification of an optional javax.naming.Context
implementation used for retrieving the resource. This is useful when using third party modules, such as a third party JMS server. Either use the context implementation supplied by the resource vendor or, if none exists, write an implementation that negotiates with the vendor software.
Attribute:
Specifies a mapping of the map key. Map keys are always immutable.
Attributes:
Specifies a relational mapping of a Map type. A Map consists of n unique keys and their mapping to values. The field containing the mapping must be of type java.util.Map or the legacy types java.util.Hashtable or java.util.Properties.
Attributes:
Deployment information for a MDB.
Attributes:
ejb-jar.xml
).
Specify the methods (and possibly parameters of that method) of the bean.
The method-intf element 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. The method-intf element must be one of the following: Home or Remote.
The method-name element contains a name of an enterprise bean method, or the asterisk (*) character. The asterisk is used when the element denotes all the methods of an enterprise bean's remote and home interfaces.
The method-param element contains the fully-qualified Java type name of a method parameter.
The method-params element contains a list of the fully-qualified Java type names of the method parameters.
An orion-ejb-jar.xml
file contains the OC4J-specific deployment information for an EJB. It is used to specify initial deployment properties. After each deployment the deployment file is reformatted and altered by the server for additional information.
Attributes:
Designates how the primary key is mapped.
Specifies the configuration of a property-based (bean properties) mapping persistence for this field. The properties have to adhere to the usual JavaBeans specification and the type of the containing object has to have an empty constructor This is also designated within the EJB specification.
The resource-ref
element is used for the declaration of a reference to an external resource such as a data source, JMS queue, or mail session. The resource-ref-mapping
ties this to a JNDI-location when deploying.
Attributes:
ejb-jar.xml
.
The runtime mapping (to groups and users) of a role. Maps to a security-role of the same name in the assembly descriptor.
Attributes:
Deployment information for a session bean.
Attributes:
never
'.
RemoteException
is thrown and the EJB is treated as involved in a deadlock. If value is set to 0, OC4J waits for the EJB "forever". This is the default.
ejb-jar.xml
).
Specifies a relational mapping of a Set type. A Set consists of n unique unordered items (order is not specified and not relevant). The field containing the mapping must be of type java.util.Set.
Attributes:
A user that this security-role-mapping implies.
Attributes:
Specified a mapping of the primary key part of a set of fields.
Attributes:
Collection/Map
. Setting this to true will optimize database operations extensively. The default value is "true" for set-mapping and map-mappings and "false" for collection-mapping and list-mapping.
com.acme.OrderEntry
, java.lang.String
, and so on.
|
Copyright © 2002 Oracle Corporation. All Rights Reserved. |
|