10.12.2012 Views

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

The Java EE 5 Tutorial (PDF) - Oracle Software Downloads

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

32<br />

CHAPTER 32<br />

<strong>Java</strong> <strong>EE</strong> Examples Using the JMS API<br />

This chapter provides examples that show how to use the JMS API within a <strong>Java</strong> <strong>EE</strong> application<br />

in the following ways:<br />

■ Using a session bean to send messages that are consumed by a message-driven bean using a<br />

message selector and a durable subscription<br />

■ Using an application client to send messages that are consumed by two message-driven<br />

beans; the information from them is stored in a <strong>Java</strong> Persistence API entity<br />

■ Using an application client to send messages that are consumed by a message-driven bean<br />

on a remote server<br />

■ Using an application client to send messages that are consumed by message-driven beans on<br />

two different servers<br />

<strong>The</strong> examples are in the following directory:<br />

tut-install/javaeetutorial5/examples/jms/<br />

To build and run the examples, you will do the following:<br />

1. Use NetBeans IDE or the Ant tool to compile and package the example.<br />

2. Use the Ant tool to create resources.<br />

3. Use NetBeans IDE or the Ant tool to deploy the example.<br />

4. Use NetBeans IDE or the Ant tool to run the client.<br />

Each example has a build.xml file that refers to files in the following directory:<br />

tut-install/javaeetutorial5/examples/bp-project/<br />

See Chapter 23, “A Message-Driven Bean Example,” for a simpler example of a <strong>Java</strong> <strong>EE</strong><br />

application that uses the JMS API.<br />

955

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

Saved successfully!

Ooh no, something went wrong!