background image

Editing and Running the Programs

<< The Connection Factory | Repackaging the SynchConsumer Example >>
<< The Connection Factory | Repackaging the SynchConsumer Example >>

Editing and Running the Programs

Editing, Recompiling, Repackaging, and Running the Programs
These steps assume that you have the tutorial installed on only one of the two systems you are
using and that you are able to access the file system of jupiter from earth or vice versa.
After you create the connection factories, edit the source files to specify the new connection
factory. Then recompile, repackage, and run the programs. Perform the following steps:
1. Open the following file in a text editor:
tut-installjavaeetutorial5/examples/jms/simple/producer/src/java/Producer.java
2. Find the following line:
@Resource(mappedName=
"jms/ConnectionFactory")
3. Change the line to the following:
@Resource(mappedName=
"jms/JupiterConnectionFactory")
4. Recompile and repackage the Producer example on earth.
If you are using NetBeans IDE, right-click the producer project and choose Clean and Build
Project.
If you are using Ant, type the following:
Queue
CF
Java EE Server on Earth
CF that
points
to Jupiter
Earth
Queue
CF
Java EE Server on Jupiter
Jupiter
Sends
Msg
Delivers
Msg
Producer
SynchConsumer
FIGURE 31­6
Sending Messages from One System to Another
Writing Simple JMS Client Applications
Chapter 31 · The Java Message Service API
933