next up previous
Next: Activation Modes Up: Implementation Repository Previous: Forcing Activation of an

Examples

Assume we want to register the account server account_server2 from section 3.3.3 as a shared server. Furthermore assume that neither micod nor ird have been started yet, so we have to get them running first. Assuming the hostname is zirkon, you have to do the following:

  # create .micorc (only do that once)
  echo -ORBIfaceRepoAddr inet:zirkon:9000 > ~/.micorc
  echo -ORBImplRepoAddr inet:zirkon:9001 >> ~/.micorc

  # run ird
  ird -ORBIIOPAddr inet:zirkon:9000

  # run micod in a different shell
  micod -ORBIIOPAddr inet:zirkon:9001

Now we are prepared to create the implementation repository entry for account_server2. Recall that this server implemented the interface Account whose repository id is IDL:Account:1.0. Assuming account_server2 has been copied to /usr/bin you can create the implementation repository entry using the following command:

  imr create Account shared /usr/bin/account_server2 IDL:Account:1.0

If account_server2 is located on host diamant (i.e., not on zirkon) you have to use the rsh command. This requires of course that you have entries in your .rhosts file that allow micod to execute programs on diamant. Here is the command to create the implementation repository entry:

  imr create Account shared "rsh diamant /usr/bin/account_server2" \
    IDL:Account:1.0

Now you should change account_client2.cc to bind to the address of micod. Note that you no longer need to know the address of the account server account_server2, you only need to know the address of micod. Here is the part of account_client2.cc that has to be changed:

  // account_client2.cc
  ...
    CORBA::Object_var obj =
      orb->bind ("IDL:Account:1.0", "inet:zirkon:9001");
  ...

Running the recompiled client will automatically activate account_server2.

Creating an entry for a loadable module (library activation mode) looks like this if /usr/local/lib/module.so is the path to the module:

  imr create Account library /usr/local/lib/module.so IDL:Account:1.0

Note that you have to make sure that a loadable module and a client that wants to make use of the module reside on the same machine.



MICO
Tue Nov 10 11:04:45 CET 1998