[omniORB] Implementing multiple interfaces in one servant

Gary D. Duzan gdd0@gte.com
Mon, 18 Sep 2000 18:00:12 -0400


   Ties would be one way. An implementation-specific IDL of the
form:

	interface foobar: foo, bar { };

could get you where you want to be, as well. You can keep it in a
separate IDL file and #include the real one to keep it separate.
You are right that inheriting from multiple skeletons is not going
to work and probably never will.

					Gary Duzan
					Verizon Laboratories



In Message <39C68E03.97FD02C@laurelnetworks.com> ,
   Chris Newbold <chris.newbold@laurelnetworks.com> wrote:

=>I have a servant which I'd like to use to implement two unrelated
=>interfaces. My first attempt went something like this:
=>
=>IDL:
=>	interface foo {
=>		...
=>	};
=>
=>	interface bar {
=>		...
=>	};
=>
=>C++:
=>
=>	class foobar_i : public POA::foo, public POA::bar
=>	{
=>		...
=>	};
=>
=>Which all compiles fine and appears to work at first: after
=>activating the object, you can get a "foo" reference which
=>works. However, attempts to generate a "bar" reference fail
=>with an assertion:
=>
=>	omniORB: Assertion failed.  This indicates a bug in omniORB.
=>	  file: ../portableserver.cc
=>	  line: 235
=>	  info: ref
=>
=>	(this is omniORB 3.0.0, patched through bug #11)
=>
=>Further investigation reveals (I believe) that this approach
=>at least cannot work, and may indeed not be intended to work.
=>
=>Much of the servant handling code seems to key of the most-derived
=>repository id for a servant and does not allow for a servant 
=>having more than one such id.
=>
=>I can of course readily implement the architecture I want using
=>ties, but I was hoping to avoid that approach. Do I have any
=>other options or is that the proper way to do this?
=>
=>-Chris Newbold
=>Laurel Networks, Inc.
=>