How to run this demo
********************

Prerequisites:

a) Read the Implementation Repository Chapter in the Programming 
   Guide :-)

b) Set up your jacorb.properties file:

   - Plan a name (e.g. "ImR_Ref") and location where you will store
     the ImRs reference file, for example /home/noffke/public_html

   - Set the property ORBInitRef.ImplementationRepository accordingly,
     e.g. 
     
ORBInitRef.ImplementationRepository=file:/home/noffke/public_html/ImR_Ref
    
     or

ORBInitRef.ImplementationRepository=http://my.org/~noffke/ImR_Ref
        
   - Set the property jacorb.imr.ior_file accordingly, e.g. 

jacorb.imr.ior_file=/home/noffke/public_html/ImR_Ref
        
   - additionally, you can set the following properties (if not set,
     the ImR will print a warning on startup, but otherwise work
     alright in this demo):

jacorb.imr.table_file=/home/noffke/table.dat
jacorb.imr.backup_file=/home/noffke/backup.dat


1st Scenario: Location transparency (no automatic restarting)
-------------------------------------------------------------

1.) Start the ImR (the -n switch tells it to start with an empty
    server table):
    $> imr -n

2.) Check, if the ImR can be accessed:
    $> imr_mg list servers

    This uses the ImR Manager command line tool to query the ImR for
    server table entries. As we've started with an empty table, it
    should print:
    Servers (total: 0):

3.) Start the server:
    $> jaco demo.imr.Server IOR 60

    The server will write its IOR to a file called "IOR" in the
    current directory, and stay up for 60 seconds. After that, it does
    a clean shutdown. In this case, the server will automatically
    register with the ImR, so you don't have to add an entry via the
    imr_mg yourself.

4.) While the server is still running (maybe you have to restart it),
    run the client from the same directory:
    $> jaco demo.imr.Client IOR

    If you get a TRANSIENT system exception, your server has probably
    gone down in the meantime.

5.) Wait until the server has gone down. NOTE: it is essential that
    the server shuts itself down, because otherwise it doesn't
    correctly unregister with the ImR - DONT USE CTRL-C TO STOP IT!!

6.) After the server's gone down, restart it with a different IOR
    file: 
    $> jaco demo.imr.Server IOR_NEW 60

    The server will now start on a different port, i.e. if no ImR is
    involved, the old IOR file is now useless.

7.) Start the client again with the same old IOR file:
    $> jaco demo.imr.Client IOR

    This should give the same results as you would have seen if used
    with IOR_NEW.


2nd Scenario: Automatic restarting
-------------------------------------------------------------

1.) Start the ImR (the -n switch tells it to start with an empty
    server table):
    $> imr -n

2.) Start the server startup daemon:
    $> imr_ssd

3.) Check, if the ssd correctly registered with the ImR:
    $> imr_mg list hosts
    
    This should print one host entry.

4.) Add the server to the ImRs server table:
    On Unix:
    $> imr_mg add imr_demo -h my.org -c "jaco demo.imr.Server IOR 60"
    
    On Windows (NT or higher):
    $> imr_mg add imr_demo -h my.org -c "cmd /c \"jaco demo.imr.Server
    IOR 60\""

    Please note that the host name supplied via the -h arg must
    exactly match the string that has previously printed by 
    imr_mg list hosts.

5.) Start the server one time. This will make the server tell the ImR
    the POA name it will be using. Starting can either be done the
    "standard" way, like:
    $> jaco demo.imr.Server IOR 10
    
    or by using the imr_mg tool. This has the advantage, that the
    startup command is used to start the server, so you will know
    right away if the command was correct or not. Please note that in
    this case, the IOR file generated by the server will be created in
    the directroy the imr_ssd was started from.

6.) Wait until the server has gone down.

7.) Now, you can finally start the client:
    $> jaco demo.imr.Client IOR
    
    This should also trigger the startup if the server. Output from
    the server will appear prefixed with ">>" at the imr_ssds output.
