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.

An Application ExampleThat Consumes Messages from a Remote Server<br />

976<br />

4. Type the following command:<br />

ant<br />

This target creates a JAR file that contains the client class file and a manifest file.<br />

To deploy the earthmdb module, perform these steps:<br />

1. Change to the directory earthmdb:<br />

cd ../earthmdb<br />

2. Type the following command:<br />

ant deploy<br />

To copy the jupiterclient module to the remote system, perform these steps:<br />

1. Change to the directory jupiterclient/dist:<br />

cd ../jupiterclient/dist<br />

2. Type a command like the following:<br />

cp jupiterclient.jar F:/<br />

That is, copy the client JAR file to a location on the remote filesystem.<br />

To run the client, perform the following steps:<br />

1. Go to the directory on the remote system (jupiter) where you copied the client JAR file.<br />

2. Use the following command:<br />

appclient -client jupiterclient.jar<br />

On jupiter, the output of the appclient command looks like this:<br />

Sending message: This is message 1<br />

Sending message: This is message 2<br />

Sending message: This is message 3<br />

On earth, the output in the server log looks something like this (wrapped in logging<br />

information):<br />

MESSAGE BEAN: Message received: This is message 1<br />

MESSAGE BEAN: Message received: This is message 2<br />

MESSAGE BEAN: Message received: This is message 3<br />

Undeploy the message-driven bean after you finish running the client. To undeploy the<br />

earthmdb module, perform these steps:<br />

1. Change to the directory earthmdb.<br />

2. Type the following command:<br />

<strong>The</strong> <strong>Java</strong> <strong>EE</strong> 5<strong>Tutorial</strong> • June 2010

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

Saved successfully!

Ooh no, something went wrong!