Copyright (C) Bull, 2000-2002

--------------------------------------------------------------------------
		WARNING!

o To compile this example, you should have compiled the ../eb example.

o This example may run with or without a database access configured.
  If you have a database and was able to run the ../eb example, just
  modify the jonas.properties file by adding the eb.jar in the
  list of bean descriptors:
  	jonas.service.ejb.descriptors jms.jar,eb.jar

--------------------------------------------------------------------------

Example description
-------------------
This example illustrates an EJB component, the EJbComp stateful session bean,
that sends JMS messages to a JMS Topic. The method sendMsg of EjbComp
publishes a message to a Topic.

The EJB client, EjbCompClient, starts a transaction, calls the method
sendMsg of the EjbComp bean and eventually creates an entity bean Account
(that of the ../eb sample) if this last one has been deployed on the EJB
server (it is not mandatory for running the example), then it
commits or aborts the transaction. In the first case, the message is sent,
and the entity bean is created (i.e. record [222, "JMS Sample OK", 0] is
created in the accountsample table), in the second case, the message is not
sent, and the entity bean is not created.

A pure JMS client, MsgReceptor, receives all messages sent to the Topic.

The administration process is made at EJBServer launch time.

The property jonas.service.jms.mom set to org.objectweb.jonas_jms.JmsAdminForJoram
means that we want use administered objects created by the server

jonas.service.jms.topics sampleTopic
indicates to the server which topic to create.


Compiling this example:
----------------------
You must have compiled ../eb example.

On $JONAS_ROOT/example/src/jms, run the compile script,
 - compile.sh on Unix or
 - compile.bat on Windows.

If the gnu make is installed on your machine you can also build this example
by using the Makefile as it is defined in the $JONAS_ROOT/example/README.

If the Ant 1.4 build tool is installed on your machine you can also build this
example by using the build.xml as it is defined in the $JONAS_ROOT/example/README.


Running this example:
---------------------

You should have in your classpath, access to the JOnAS classes and
prerequired classes for JOnAS:
	. $JONAS_ROOT/bin/unix/config_env	# set CLASSPATH for JOnAS

You may use the run.sh on Unix or run.bat on Windows scripts to execute the
whole example or step by step:


Run the EJB Server [1]:
	EJBServer

Run the JMS client (should be launched in a separate window, as typing any
character will stop the program):
	java jms.MsgReceptor

Run the EJB client:
	java jms.EjbCompClient

[1]: If you want to run the example with the use of the Account entity
     bean (to illustrate a global transaction taking into account message
     sending and database writing), you should have in your jonas.properties
	jonas.service.ejb.descriptors	jms.jar.eb.jar
     else (use only JMS and no database), your jonas.properties should only
     contain:
	jonas.service.ejb.descriptors	jms.jar

Stopping the server
	JonasAdmin -s


You can run the EJBServer and the MOM JMS in separate JVM
To do this:
set the property jonas.service.jms.collocated to false in jonas.properties
then
 . $JONAS_ROOT/bin/unix/config_env	# set CLASSPATH for JOnAS
 JmsServer
 EJBServer
 java jms.MsgReceptor
 java jms.EjbCompClient
