Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The <enterprise-beans> element used to specify references by <entity> EJB's. For example, a EJB Entity Bean would be specified similarly as below in an openejb-jar.xml file:

Code Block
xml
xml
borderStylesolid
title<enterprise-beans> Example
    <enterprise-beans>

        <entity>
            <ejb-name>ExchangeRate</ejb-name>
            <local-jndi-name>ExchangeRate</local-jndi-name>
            <resource-ref>
                <ref-name>jdbc/BankDataSource</ref-name>
                <resource-link>BankPool</resource-link>
            </resource-ref>
        </entity>

    </enterprise-beans>

<ejb-name>

...

The <tssGroup> set of elements is used to contains CORBA security settings (i.e., for EJBs exposed as CORBA objects). It is not necessary if the EJB will not be accessed via CORBA.

JNDI Environment References

...

The <naming:message-destination> element is used to map resource references to a message-destination which is used within the deployed web application. These are typically a JMS queue or topic which acts like a destination for the messages delivered. Like all the JNDI references in this section, this element will not cause the creation of a message-destination, references an existing message-destination used within the deployed web EJB application.

EJB Session Entity Beans

<enterprise-beans>

The <enterprise-beans> element used to specify references by <entity> EJB's. For example, a EJB Entity Bean would be specified similarly as below in an openejb-jar.xml file:

Code Block
xml
xml
borderStylesolid
title<enterprise-beans> Example

    <enterprise-beans>

        <session>
            <ejb-name>RetrieveEmployeeInfoBean</ejb-name>
            <business-remote>examples.session.stateless_dd.RetrieveEmployeeInfo</business-remote>
            <ejb-class>examples.session.stateless_dd.RetrieveEmployeeInfoBean</ejb-class>
            <session-type>Stateless</session-type>
            <transaction-type>Container</transaction-type>

            <resource-ref>
                <res-ref-name>jdbc/DataSource</res-ref-name>
                <res-type>javax.sql.DataSource</res-type>
                <res-auth>Container</res-auth>
                <res-sharing-scope>Shareable</res-sharing-scope>
            </resource-ref>
        </session>

    </enterprise-beans>

<ejb-name>

The <ejb-name> element identifies the EJB that these settings apply to and must match the <ejb-name> for the EJB in ejb-jar.xml file.

<jndi-name>

The Home interface for the EJB is registered in JNDI at the address specified here. This global JNDI name is used by application clients to connect to this EJB. It is only meaningful if the EJB has a (remote) Home interface.

<local-jndi-name>

The LocalHome interface for the EJB is registered in JNDI at the address specified here. It is only meaningful if the EJB has a LocalHome interface.

<tssGroup>

The <tssGroup> set of elements is used to contains CORBA security settings (i.e., for EJBs exposed as CORBA objects). It is not necessary if the EJB will not be accessed via CORBA.

JNDI Environment References

All the JNDI reference elements in this section use the Geronimo Naming namespace, which is used to identify the common elements for resolving EJB references, resource references, and Web services references, and is documented here:

Additionally, more information and details about JNDI references can be found here: JNDI.

<naming:abstract-naming-entry>

The <abstract-naming-entry> element is not technically a JNDI reference element. It is included in this section because it is an abstract element used for containing these JNDI reference types:

  • <gbean-ref>

    The <gbean-ref> element is used to map GBean references to GBeans configured outside the current module

  • <persistenceunit-ref>

    The <persistenceunit-ref> element is used to map persistence unit references to persistence units configured outside the current module

  • <persistencecontext-ref>

    The <persistencecontext-ref> element is used to map persistence context references to persistence contexts configured outside the current module
<naming:ejb-ref>

The <naming:ejb-ref> element is used to map EJB references to EJB's in other applications using remote home and remote interface. The application which contains the EJB being referenced should either be in same EAR or should be included in dependency list of this application. Also note as the EJB's referenced are in a different JVM all the client interfaces should also be included in the current application.

<naming:ejb-local-ref>

The <naming:ejb-local-ref> element is used to map EJB references to EJB's in other applications using local home and local interface. The application which contains the EJB being referenced should either be in same EAR or should be included in dependency list of this application. Also note as the EJB's referenced are in a different JVM all the client interfaces should also be included in the current application.

<naming:service-ref>

The <naming:service-ref> is used to map service references to service's in other applications. The application which contains the EJB being referenced should either be in same EAR or should be included in dependency list of this application.

<naming:resource-ref>

The <naming:resource-ref> element is used to map resource references to resources like JDBC resources, JMS resources, etc. configured outside the current application.

<naming:resource-env-ref>

The <naming:resource-env-ref> element is used to map resource references to administrative objects deployed as a part of connectors.

<naming:message-destination>

The <naming:message-destination> element is used to map resource references to a message-destination which is used within the deployed web application. These are typically a JMS queue or topic which acts like a destination for the messages delivered. Like all the JNDI references in this section, this element will not cause the creation of a message-destination, references an existing message-destination used within the deployed EJB application.

EJB Message-driven Beans

Entity, Session, Message-driven EJB XML Elements:

...