12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Obtaining JMS Connection Factories and Destinations in J2EE Application Components<br />

the element in the deployed DAR where the connection factory is<br />

defined.<br />

Just as the element is used to map logical names for JMS connection<br />

factories to actual JNDI location of desired connection factory definition, the <br />

element maps the logical name for JMS destinations, such as Queues and<br />

Topics, to actual JNDI location of destination definition. The DTD representation of this<br />

element for <strong>Borland</strong> deployment descriptors is as follows:<br />

<br />

Two elements are specified:<br />

■<br />

resource-env-ref-name: this is the logical name of the Topic or Queue, and its<br />

value must be identical to the value of the of J2EE standard<br />

descriptor.<br />

■<br />

jndi-name: this is the JNDI name of the topic or queue that resolves the logical<br />

name.<br />

The final contents for <strong>Borland</strong> descriptor ejb-borland.xml accompanying the ejbjar.xml<br />

defined above is:<br />

<br />

session_bean<br />

...<br />

<br />

jms/MyJMSQueueConnectionFactory<br />

resources/qcf<br />

<br />

<br />

jms/MyJMSQueue<br />

resources/q<br />

<br />

...<br />

<br />

Note that the elements from both descriptor files are identical.<br />

Keep in mind that and elements can be used for all<br />

J2EE components that require JMS related resource objects. For instance, application<br />

clients using JMS APIs should obtain connection factories and destinations the same<br />

way as EJBs, through JNDI lookup or Resource References in application code and<br />

specification of and elements in the clients<br />

deployment descriptors. For example, in the J2EE standard descriptor, applicationclient.xml:<br />

<br />

...<br />

<br />

jms/MyJMSTopicConnectionFactory<br />

javax.jms.TopicConnectionFactory<br />

Application<br />

<br />

<br />

jms/MyJMSTopic<br />

javax.jms.Topic<br />

<br />

...<br />

<br />

Chapter 23: Using JMS 215

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!