#################
#               #
# basic example #
#               #
#################

# $Id: README.txt,v 1.12 2005/04/18 16:49:34 rogerperey Exp $


Scenario:
---------

The basic example is a very simple example showing how to
setup and use a transaction manager on either RMI/JRMP or RMI/IIOP

Setup:
------

o a name server (RMI registry or IIOP nameserver)
o JOTM as the Transaction Manager

o BasicExample is the client using UserTransaction.
  it makes 2 transactions:
  - the first one with a commit result
  - the second one is rolled back because of the expiration
    of a transaction timeout

Set JOTM_HOME to the directory of your JOTM distribution (e.g.,
.../jotm/output/dist from CVS)


Compilation:
---------------------
To compile the example, in JOTM_HOME/examples/basic directory type

     ant compile
---------------------

Running the example under RMI/JRMP:
----------------------------

To run the example using RMI/JRMP, 

NOTE:
    o to utilize JOTM_HOME as parameter substitution in the below examples:
       UNIX = $JOTM_HOME
       WINDOWS = %JOTM_HOME%

o in ../../conf/carol.properties (JOTM_HOME/conf), change carol.protocols:

       carol.protocols=jrmp
       (only RMI/JRMP is activated and is the default protocol)

In JOTM_HOME/lib/ directory, type

UNIX:
   $ rmiregistry -J-classpath -Jjotm.jar:jotm_jrmp_stubs.jar:commons-cli-1.0.jar:connector-1_5.jar:howl.jar -J-Djava.security.policy=../conf/java.policy &

WINDOWS:
     rmiregistry -J-classpath -Jjotm.jar;jotm_jrmp_stubs.jar;commons-cli-1.0.jar;connector-1_5.jar;howl.jar -J-Djava.security.policy=../conf/java.policy 

In JOTM_HOME/lib/ directory, type

UNIX:
   $ java -classpath jotm.jar:jotm_jrmp_stubs.jar:commons-cli-1.0.jar:connector-1_5.jar:howl.jar:../conf/ org.objectweb.jotm.Main -u UserTransaction &

WINDOWS:
     java -classpath jotm.jar;jotm_jrmp_stubs.jar;commons-cli-1.0.jar;connector-1_5.jar;howl.jar;../conf/ org.objectweb.jotm.Main -u UserTransaction 

In the JOTM_HOME/examples/basic/ directory, type

     ant run.rmi.jrmp
----------------------------


Runing the example under RMI/IIOP:
----------------------------

!!!!! NOTE  !!!!!
    Windows must have Java Console (if configured) to refer to Java 1.4 or IIOP fails on the Java command with a ConText
    error (Null pointer.)

To run the example on RMI/IIOP, first change the setting of JOTM
to activate RMI/IIOP support:

o in ../../conf/carol.properties (JOTM_HOME/conf), change carol.protocols:

   carol.protocols=iiop
   (only RMI/IIOP is activated and is the default protocol)

In JOTM_HOME/lib/ directory, type

UNIX:
   $ tnameserv -ORBInitialPort 19751 &

WINDOWS
     tnameserv -ORBInitialPort 19751

In JOTM_HOME/lib/ directory, type

UNIX:
   $ java -classpath jotm.jar:jotm_iiop_stubs.jar:commons-cli-1.0.jar:connector-1_5.jar:howl.jar:../conf/ org.objectweb.jotm.Main -u UserTransaction &

WINDOWS:
     java -classpath jotm.jar;jotm_iiop_stubs.jar;commons-cli-1.0.jar;connector-1_5.jar;howl.jar;../conf/ org.objectweb.jotm.Main -u UserTransaction 


In the basic/ directory, type

    ant run.rmi.iiop

Enjoy!

