[omniORB] Implementing multiple interfaces in one servant
Chris Newbold
chris.newbold@laurelnetworks.com
Mon, 18 Sep 2000 17:49:55 -0400
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.