Why we can not provide a null parameter to method in CORBA?
5 Message(s) by 3 Author(s) originally posted in java corba
| From: billdavidcn |
Date: Tuesday, July 03, 2007
|
If I have a
method like this in my idl defined interface:
string echoString(in string mesg);
And if I call this method with a
null parameter ,
ORB will fail in
serializing this parameter and report a org.omg.
CORBA .BAD_PARAM.
But why CORBA has such a limitation? What's the history?
And how can I avoid this? Always check the parameter before CORBA
method invoke?
BTW:
My
environment is JDK1.5 and the ORB is
inline JAVA
IDL .
The same thing happens in ORBACUS 4.3.
| From: Yakov Gerlovin |
Date: Tuesday, July 03, 2007
|
CORBA allows you to pass an empty string.
Passing 'null' means you do not want to send
data . If you do not want to
pass data, there is no reason to specify parameters.
What you actually want is 2 functions:
string echoString(in string mesg);
and another
void echoString();
Unfortunately, CORBA doesn't allow
overloading (to allow
mapping s to
programming
language s with this limitation)
Further, since the string is passed by value (deep copied) you can not
pass 'null'.
| From: billdavidcn |
Date: Wednesday, July 04, 2007
|
Thanks Yakov!
But I still think it's a little strange. Actually, when doing remote
data transfering, it's possible to mark a null value. In my memory,
this limitation doesn't exist in
RMI .
| From: Yakov Gerlovin |
Date: Wednesday, July 04, 2007
|
RMI is (JAVA) language specific while CORBA isn't limited to specific
language, nor platform. In order to simplify mapping to as wide range
of languages as possible CORBA adopted some limitations, for example,
CORBA doesn't allow overloading (like C). Some languages doesn't
have pointers, that is probably the reason why passing 'null' isn't
allowed.
| From: Piet van Oostrum |
Date: Saturday, July 07, 2007
|
wrote in message:
b> Thanks Yakov!
b> But I still think it's a little strange. Actually, when doing remote
b> data transfering, it's possible to mark a null value. In my memory,
b> this limitation doesn't exist in RMI.
In Corba you can use a valuetype (if the implementation you are using
supports them). A valuetype can
accept null values.
--
Piet van Oostrum
<piet@xxxxxxxxxxx>
URL:
http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet@xxxxxxxxxxx
Next Message: JBoss, EJB, JAVA Server, and C++ CORBA Clients
Blogs related to Why we can not provide a null parameter to method in CORBA?
ArcSDE Plugin (updated)
For the 2.4.x branch arcsde is working on returning to supported status;
we need to
provide a profile for nightly builds to run. ArcSDE Raster Support is also available on 2.4.x as well. You
can find out about it at the ArcSDE Raster
...
svn commit: r528088 [1/2] - in /maven/plugins/branches/MWAR-97 ...
specify a file which is
not named
web.xml. If the file + * Copies webapp webResources from the specified directory. Note that the
webXml parameter could be + *
null and may specify a file which is
not named
...
Re: Possible memory leak in JspStateManagerImpl
For our > > case,
we only have a very few places where there is any use for this > > functionality, but if
we crank up this
parameter to something like 7,
we > > greatly reduce the number of concurrent users
we can support due to
...
Re: Possible bug in the columns tag with the convertDateTime tag
Let's take convertDateTime type as an example. Note that this one is a little trickier than most since the default value isn't
null -- the default is Type.DATE.getName() so
we can't simply call the super.getType() method.
...
Apache Wicket 1.3.0 Beta 2 released
[WICKET-319] - No
java source code in examples; [WICKET-323] - AjaxEditableLabel on setModel does
not update the labels model only the editors; [WICKET-341] - [Patch] AjaxServerAndClientTimeFilter either throws an exception or displays
...
[picocontainer-scm] [3353] java/sandbox/baby-steps/pico2/container ...
@return the instance or
null if no suitable instance
can be found. - * @throws PicoInitializationException if a referenced component could
not be instantiated. + * @throws PicoInitializationException if a referenced
...