[omniORB] Is a servant allowed as member variable of another servant?

Carlos carlos at canama.net
Fri Jan 23 12:30:09 GMT 2004


Steinar Bang wrote:
> Platform: Intel PIII, RedHat 8,
> 	  g++ 3.2
> 	  omniORB 3.0.5
> 
> (Replacing the actual interface names with A and B for simplicity)
> 
> The code in the servant for interface B, uses a reference to interface
> A to get some data.
> 
> Currently the servant for interface A and B, run in separate
> processes, and the servant for interface B finds a reference to an
> implementation of A, by using the CORBA naming service.
> 
> I tried to avoid the IIOP overhead by putting both servants into the
> same process (the code of the servants resides in shared libraries).
> 
> I created an instance of the servant for A as a member variable of B,
> and used the _this() function to get a reference.  This didn't work.
> 

If you activate the object A in a POA then you can use references to A, 
but if you want to use the NS for obtaining references to this servant 
you must bind it in the NS.

> The program holding the implementation for B didn't crash, but it
> didn't show up in the CORBA naming service.  In effect it wasn't
> present in the system.
> 

You must register (bind) the object in the NS.

> Is a servant for one interface, allowed to exist as a member variable
> of a servant for another interface?
> 

Yes, I do it and it works fine.

> Or is there something fundamentally wrong with what I tried to do? 
> 
> Ie. should I try to find out what's wrong, or is this something that
> never will work...? ;-)
> 
> Thanx!
> 
> 
> - Steinar
> 
> 

I expect that this be useful.

Carlos.
Canamá Panal.
www.canama.net


> _______________________________________________
> omniORB-list mailing list
> omniORB-list at omniorb-support.com
> http://www.omniorb-support.com/mailman/listinfo/omniorb-list
> 
> 






More information about the omniORB-list mailing list