use POA policies to create an object with a persistent object reference

use POA policies to create an object with a persistent object reference
Implementation Repository

To test your changes, you need to run four programs. The first step is
to start up the Implementation Repository provided with TAO. The
Implementation Repository is split into one locator at least one
activator. The locator provides the interface visible to the application
intending to use the repository (in our case, the client), while the
activators do the real work of activating and maintaining servers.

First, we start the locator. We need to dump the IOR of the
ImplRepo_Service to a file, so that both the activator and the client
can find the locator.

$ $TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr_locator -o implrepo.ior -d
0 -ORBobjrefstyle URL &

Second, we start the activator, pointing it to the locator's IOR file.

$ $TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr_activator -ORBInitRef
ImplRepoService=file://implrepo.ior

ImR Activator: Starting doc.ece.uci.edu
ImR Activator: Registered with ImR.

Next, we need to register our server with the implementation repository.
We can use the $TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr_locator
application provided with TAO to add our server to the server database
in the implementation repository.

$ $TAO_ROOT/orbsvcs/ImplRepo_Service/tao_imr_locator -ORBInitRef
ImplRepoService=file://implrepo.ior add childPOA -c
"./server -ORBUseIMR 1 -ORBobjrefstyle URL -ORBInitRef
ImplRepoService=file://implrepo.ior"

Successfully registered server

On Windows platforms, use this command instead to register the server in
the implementation repository

$ACE_ROOT/bin/tao_imr -ORBInitRef ImplRepoService=file://implrepo.ior
add childPOA -c "./server -ORBUseIMR 1 -ORBobjrefstyle URL
-ORBInitRef ImplRepoService=file://implrepo.ior"

We specify the -ORBInitRef option to use the IOR in the implrepo.ior
file and the -ORBUseIMR option to tell the server to use the IMR for
notification of its startup and shutdown.

The next step is to generate a simple IOR for our server to be used with
the IMR, using the ior option, and write it to stock_factory.ior.

$tao_imr -ORBInitRef ImplRepoService=file://implrepo.ior ior
childPOA -f stock_factory.ior

corbaloc:iiop:1.1@doc.ece.uci.edu:2690/childPOA

From now, the implementation repository is all set to keep track of our
server and do the needful on a method invocation on our server.

Now, execute the client as usual.

./client file://stock_factory.ior MSFT RHAT

The price of a stock in "Microsoft, Inc." is $91
The price of a stock in "RedHat, Inc." is $210

For testing the persistency of the POA, let's shut down the server and
then run the client.

$tao_imr -ORBInitRef ImplRepoService=file://implrepo.ior
shutdown childPOA

Successfully shutdown server

./client file://stock_factory.ior MSFT RHAT

The price of a stock in "RedHat, Inc." is $210
The price of a stock in "Microsoft, Inc." is $91