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

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

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

An Application ExampleThat Deploys a Message-Driven Bean onTwo Servers<br />

Sent message: text: id=9 to local app server<br />

ReplyListener: Received message: id=9, text=ReplyMsgBean processed message: text: id=9 to local<br />

app server<br />

Sent message: text: id=10 to remote app server<br />

ReplyListener: Received message: id=10, text=ReplyMsgBean processed message: text: id=10 to remote<br />

app server<br />

Waiting for 0 message(s) from local app server<br />

Waiting for 0 message(s) from remote app server<br />

Finished<br />

Closing connection 1<br />

Closing connection 2<br />

986<br />

On the local system, where the message-driven bean receives the odd-numbered messages, the<br />

output in the server log looks like this (wrapped in logging information):<br />

ReplyMsgBean: Received message: text: id=1 to local app server<br />

ReplyMsgBean: Received message: text: id=3 to local app server<br />

ReplyMsgBean: Received message: text: id=5 to local app server<br />

ReplyMsgBean: Received message: text: id=7 to local app server<br />

ReplyMsgBean: Received message: text: id=9 to local app server<br />

On the remote system, where the bean receives the even-numbered messages, the output in the<br />

server log looks like this (wrapped in logging information):<br />

ReplyMsgBean: Received message: text: id=2 to remote app server<br />

ReplyMsgBean: Received message: text: id=4 to remote app server<br />

ReplyMsgBean: Received message: text: id=6 to remote app server<br />

ReplyMsgBean: Received message: text: id=8 to remote app server<br />

ReplyMsgBean: Received message: text: id=10 to remote app server<br />

Undeploy the modules after you finish running the client. To undeploy the multiclient<br />

module, perform these steps:<br />

1. Verify that you are still in the directory multiclient.<br />

2. Type the following command:<br />

ant undeploy<br />

To undeploy the replybean module, perform these steps:<br />

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

cd ../replybean<br />

2. Type the following command:<br />

ant undeploy<br />

3. Type the following command:<br />

ant undeploy-remote -Dsys=remote-system-name<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!