[omniORB] Working on CosTransactions, but need help
Duncan Grisby
duncan@grisby.org
Wed Feb 12 11:52:01 2003
On Tuesday 11 February, Scott Robertson wrote:
> I've been using omni orb (omniPy) for sometime, and have been dying for
> an implementation of CosTransactions, so much so that I'm attepmting to
> put my money where my mouth is and get the ball rolling.
That's good...
> 1.) I can't compile the CosTransactions.idl because the Current
> interface extends CORBA::Current, which is not defined anywhere in any
> of the IDLs that come with omniOrb as far as I can see. Looking at some
> other ORBs, implementations they seem to just define Current with no
> attributes or methods.
The problem is that Current is not a normal CORBA interface -- it's a
pseudo interface. The implementation of the CosTransactions::Current
interface couldn't be done using the normal CORBA mapping, so it's no
great loss to not be able to compile it with omniidl. You should
#ifdef it out of CosTransactions.idl, and just implement the class in
a way that follows the C++ mapping. The same is done with
PortableServer::Current.
> 2.) What's the best way to add the intrecetpors? Right now I just do the
> add right after calling ORB.init()... This is rather combersome is
> there someway to get omni orb to load this dynamically for me?
Yes. Look at include/omniORB4/internal/initialiser.h. Create an
initialiser then register it using the install static function. The
initialiser's attach() method will then be called during ORB_init(),
at which time it can install its interceptors.
> 3.) I need to add the TransactionFactory to
> orb.resolve_initial_refernces()... I swear I saw how to do this but I
> can't seem to find it anywhere. Can you point me in the right direction?
Either use CORBA::ORB::register_initial_reference(), or the omniORB
specific omniInitialReferences::registerPseudoObjFn, which allows you
to register a function to be called when the reference is asked for.
That way is probably better since you don't need to create the objects
unless they are asked for.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan@grisby.org --
-- http://www.grisby.org --