|
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g Release 3 (10.1.3) B14428-01 |
|
![]() Previous |
![]() Next |
You can access a JMS destination (queue or topic) and JMS connection resource manager connection factory by creating an environment reference to them.
|
Note: In EJB 3.0, an environment reference to a resource manager connection factory is not needed. You can access a resource manager connection factory directly using annotations and resource injection (see "Looking Up an EJB 3.0 Resource Manager Connection Factory"). |
For information on looking up a resource manager connection factory, see:
To define a reference to a JMS destination and JMS connection resource manager connection factory:
Configure your JMS service provider.
For more information, see:
Define the JNDI name for the JMS destination and connection factory.
For more information, see:
Define a logical name for the JMS destination and JMS connection factory.
How you define the logical names is the same regardless of what type of JMS provider you use.
Define a <resource-env-ref> element in the appropriate client deployment descriptor (see "Where Do You Configure an EJB Environment Reference?") and configure the following sub-elements:
<resource-env-ref-name>: a logical name for the JMS destination resource manager connection factory.
<resource-env-ref-type>: The destination class type; either javax.jms.Queue or javax.jms.Topic.
Example 19-7 shows a <resource-env-ref> element for a JMS topic resource manager connection factory.
Define a <resource-ref> element in the same client deployment descriptor and configure the following sub-elements:
<res-ref-name>: a logical name for the JMS connection resource manager connection factory.
<res-type>: the connection factory class type; either javax.jms.QueueConnectionFactory or javax.jms.TopicConnectionFactory.
<res-auth>: the authentication responsibility; either Container or Bean.
<res-sharing-scope>: the sharing scope; either Shareable or Unshareable.
Example 19-8 shows a <resource-ref> element for a JMS topic connection resource manager connection factory.
Map the logical names to the actual JNDI names.
Define a <resource-env-ref-mapping> element in the corresponding OC4J-specific deployment descriptor (see "Where Do You Configure an EJB Environment Reference?") and configure its name attribute to the JMS destination logical name (defined in the <resource-env-ref>) and its location attribute to the JNDI name defined when you configured your JMS provider (see step 2).
Example 19-9 shows a <resource-env-ref-mapping> element for OracleAS JMS.
Define a <resource-ref-mapping> element in the same OC4J-specific deployment descriptor (see "Where Do You Configure an EJB Environment Reference?") and configure its name attribute to the JMS connection factory logical name (defined in the <resource-ref>) and its location attribute to the JNDI name defined when you configured your JMS provider (see step 2).
Example 19-10 shows a <resource-ref-mapping> element for OracleAS JMS.