user manual

250 BES Developers Guide
Connecting to JMS Connection Factories from Application Components
<!ELEMENT driver-datasource-jndiname (#PCDATA)>
<!ELEMENT datasource-class-name (#PCDATA)>
<!ELEMENT log-writer (#PCDATA)>
<!ELEMENT class-name (#PCDATA)>
You only need to define the <jndi-object> element to register the JMS
connection factory with JNDI. In this element, you specify the following:
jndi-name: this is the name that will be looked up from JNDI to establish
connections with the messaging service. Like JDBC datasources, JMS
resources can and should use the serial:// namespace whenever
possible.
class-name: this is the name of the connection factory class supplied by
the JMS service provider and deployed as libraries in your Partition.
properties: these are properties specific to the JMS provider that need to
be passed to it.
At deployment time, the server creates the physical JMS destinations
specified in the jndi-definitions list.
Refer to Chapter 24, JMS provider pluggability for vendor-specific
information on JMS queues.
Connecting to JMS Connection Factories from Application
Components
Connections to JMS Connection Factories are achieved in much the same
way as those for JDBC. You declare your object references in the Resource
Reference elements of both the standard and Borland-specific deployment
descriptors. However, there are a few differences. First, you also must specify
a Resource Environment Reference that points to a specific queue or topic
contained within the Resource Reference datasource. Again, logical names
are bound to actual JNDI names using the Borland-specific descriptor at
deployment time.
Connecting to JMS Connection Factories from components
other than MDBs
Use of Resource References and Resource Environment References in the
ejb-jar.xml descriptor is described in the J2EE 1.3 Specification. In simple
terms, the Resource Reference (<resource-ref> element) refers to a
connection factory for the component to use to connect to the JMS service
provider. The Resource Environment Reference (<resource-env-ref> element)
points to the specific queue or topic to talk to. Let's look at an XML example for
a session bean from ejb-jar.xml:
<session>
<ejb-name>session_bean</ejb-name>