[omniORB] Standard ?
Mark Little
M.C.Little@ncl.ac.uk
Thu, 09 Apr 1998 08:59:03 +0000
> The Environment parameter is an optional value, required only for those
> ORB implementations which support compilers that don't handle C++
> exceptions. omniORB uses C++ built-in exception handling on all of the
> platforms (to the best of my knowledge), and therefore does not need an
> Environment variable. The use of Environment is ORB-dependent (see CORBA
> 2.1 sec 16.17 p16-45).
True, but I believe the spec. still refers to it as an "implicit
parameter". (Haven't checked 2.1, but 2.0 did do so.) So, some ORB
vendors implement it as such, whereas others simply don't provide it at
all.
>
> We use a couple of macros to handle this portably:
>
> #define CENV_DECL Environment& =(*some ORB default value*)
> #define c_CENV_DECL , Environment& =(*some ORB default value*)
> #define CENV_IMPL Environment&
> #define c_CENV_IMPL , Environment&
>
> where *some ORB default value* is CORBA::IT_chooseDefaultEnv() on Orbix.
But since some ORBs still don't use native exception handling (e.g.,
Nortel's RCP-ORB) it means that your server/object code needs to support
both types of signatures (assuming you want to make it "portable").
We have similar macros to you to try to get round this, but at present
omniORB doesn't provide an Environment class implementation. When it
does, I'd assume that the server stub code will have to be made
sufficiently intelligent that it can recognise receiving an Environment
in the call signature for a method and pack up any exceptions into it
the object may throw, otherwise the client won't be able to handle them.
For true language independence this will need to be done anyway, since
clients written in C, for example, will be sending Environments all the
time.
Mark.
-----------------------------------------------------------------------
SENDER : Dr. Mark Little, Arjuna Project, Distributed Systems Research.
PHONE : +44 191 222 8066, FAX : +44 191 222 8232
POST : Department of Computing Science, University of Newcastle upon
Tyne, UK, NE1 7RU
EMAIL : M.C.Little@newcastle.ac.uk