[Ace-users] [ace-users] HowTo: Servant implementing an interface and an reply handler

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Thu Feb 21 12:05:13 CST 2008


Hi Thomas,

   Thanks for using the PRF.

>    TAO VERSION: 1.6.1
>    ACE VERSION: 5.6.1
>
>    HOST MACHINE and OPERATING SYSTEM:
>        Linux 2.6.22-14-generic i686 GNU/Linux (Ubuntu 7.10)
>    COMPILER NAME AND VERSION (AND PATCHLEVEL):
>        g++ (GCC) 4.2.1 (Ubuntu 4.2.1-5ubuntu4)
>
>    THE $ACE_ROOT/ace/config.h FILE:
>        #include "ace/config-linux.h"
>
>    THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:
>        ami=1
>        corba_messaging=1
>        rt_corba=1
>        no_hidden_visibility=1
>        debug=1
>        optimize=1
>        include ${ACE_ROOT}/include/makeinclude/platform_linux.GNU
>
>> It's not really clear what you're trying to do.  Are you trying to
>> implement a "middle-tier" server with objects that are both servants
>> and AMI clients?  Have you taken a look at the various AMI examples in
>> TAO yet?
>
> I found one example for the usage of AMI (TAO/examples/AMI/
> FL_Callback).

Ok, cool.

> Maybe the best way to explain what I mean is by using that example.
> Basically we have two classes, the Peer_Handler_i (reply handler
> servant?) and the Peer_i (servant?), which inherit from POA_Peer
> (skeleton?) and POA_AMI_PeerHandler (reply handler?), respectively.

I think you might have this backwards, i.e., Peer_Handler inherits
from POA_AMI_PeerHandler and Peer_i inherits from POA_Peer, right?

> Is it possible to let Peer_i inherit from both POA_Peer and
> POA_AMI_PeerHandler without causing other problems?  Since both
> inherit form *_Servant_Base there is a conflict with the methods
> _is_a, _dispatch and _interface_repository_id. I suppose that might
> cause some troubles in the usage of Peer_i later on.

I think you can use virtual inheritance to avoid these sorts of
problems, but you might want to consider using a Tie approach instead
so that you don't need to use multiple inheritance.

Thanks,

        Doug
-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list