[omniORB] Q: objects in own process

Glenn A. Hochberg gah@research.att.com
Wed, 25 Oct 2000 20:56:52 -0400


Sounds like a reasonable approach for transient objects.  If your
objects need to be persistent, though, the new process would have to
listen on the same port embedded in it's IOR (which existed before the
process).  In this case the client would have to explicitly call the
Factory object, pass it the IOR, and ask that the object be activated,
prior to attempting to use the object reference.  Another way might be
to create all your IORs in the Factory process and use a ServantManager
(ServantLocator type I think).  The ServantLocator would be registered
with the POA, and would start the process and point the client there
using an IIOP redirect (I don't have my CORBA book handy to see whether
a ServantLocator can do this, but it sounds right to me).

    -Glenn

Barry Roberts wrote:

> IIRC (and someone with more experience please correct me if necessary)
> the PERSISTENT lifespan policy only allows you to create an object
> that keeps the same IOR even if it is destroyed and then created
> again.
>
> I have done something like what you are asking about, and here's how I
> did it.  There is at least one factory object running in its own
> process.  When it gets a request to create a new object, it spawns a
> process, and passes an IOR on the command line of the new process.
> This IOR is a simple object used to communicate between the
> factory/controller and the child worker processes.  Once the child
> process has started and created its object, it makes a call back to
> the factory with its IOR.  The factory then returns the new object
> back to the process that requested it.
>
> There are probably more elegant ways to do this, but this was easy and
> it works.
>
> FWIW,
> Barry Roberts