Does a standard put/get from a XA JMS session.

Requires the following administered objects to be available from
the JNDI namespace:

jms/Samples/QCF1
jms/Samples/Q1

These can be created by passing the following script to JMSAdmin

====== cut here ======

# Example script to insert administered objects for samples into a
# JNDI namespace.
# Ensure that JMSAdmin.config has been correctly configured to access the
# appropriate namespace, and then apply this script using the command
# JMSAdmin < admin.scp

# create the jms subcontext. If the subcontext already exists the def
# command will generate an "unable to create context" error which may
# be safely ignored.
def ctx(jms)
chg ctx(jms)

# create a samples subcontext
def ctx(Samples)
chg ctx(Samples)

# create a WebSphere specific queue connection factory
# This uses all the default settings which map to the default queue manager.
# A non-default queue manager can be specified using the qmgr(name) property.
def wsqcf(QCF1)

# create a Queue. The default queue can be replaced with an alternative local
# queue of your choice.
def q(Q1) queue(SYSTEM.DEFAULT.LOCAL.QUEUE)

# display the current context to provide feedback
dis ctx

# exit
end

====== cut here ======

The putMessage method will connect to the queue manager defined by
'jms/Samples/QCF1' and put a message to 'jms/Samples/Q1'.
The getMessage method will connect to the queue manager defined by
'jms/Samples/QCF1' and get a message from 'jms/Samples/Q1'.


The bean must be deployed with the TX_REQUIRED attribute set for the
getMessage and putMessage methods. See the WebSphere documentation for
details on building and deploying EJBs.

Whilst running the bean it is useful to monitor the stdout log from the
app'server, as it outputs a number of messages describing its activity.

A simple client program is provided to invoke the bean (Sample1Client.java),
along with a bat file to simplify running it. The bat file will need
modification for the location of the WebSphere installation, and the name
of the deployed jar file (DeployedjmsSample1.jar by default).

The client program takes a single parameter which is a string to be put
in the test message output from the EJB.

Here is an example output from the client program:

$ runClient.bat "A test message"

c:\jbk\mqjava\common\jms\com\ibm\mq\jms\wsae\samples\sample1>java -classpath .;c
:\Websphere\Appserver\deployedEJBs\DeployedjmsSample1.jar;c:\Websphere\Appserver
\jdk\jre\lib\rt.jar;c:\Websphere\Appserver\lib\ejs.jar;c:\Websphere\Appserver\li
b\ujc.jar;c:\Websphere\Appserver\lib\iioptools.jar;c:\Websphere\Appserver\lib\se
rvlet.jar;c:\Websphere\Appserver\lib\jms.jar Sample1Client "A test message"
calling Sample1 EJB with string 'A test message'
calling putMessage
calling getMessage
got message 'A test message'
done

And here is the corresponding output from the app'servers stdout:

Sample1EJB.ejbCreate()
request to put message 'A test message'
sending message
done
Sample1EJB.ejbRemove()
Sample1EJB.ejbCreate()
request to get message 'ID:414d51206361726468752e716d3120200c82c33912600000'
getting message
body is >A test message<
closing receiver
closing connection
Sample1EJB.ejbRemove()

