Discussion:
RMI server
(too old to reply)
Graham Walsh
2009-06-29 15:38:26 UTC
Permalink
hi,

I have an RMI server thats up in running, everything is java, client
and server. nothing is defined in IDL. My java client gets its server
reference from the (TAO) name service and invokes problem free.

I want to write a c++ client that connects to the same service and
invokes methods on it. There's no IDL, no poa exposed, so I don't
really see how I can get to it from c++. Is it possible, can anybody
tell me?


thanks much
G
Phil Mesnier
2009-07-02 03:06:14 UTC
Permalink
Hi Graham,
Post by Graham Walsh
hi,
I have an RMI server thats up in running, everything is java, client
and server. nothing is defined in IDL. My java client gets its server
reference from the (TAO) name service and invokes problem free.
I want to write a c++ client that connects to the same service and
invokes methods on it. There's no IDL, no poa exposed, so I don't
really see how I can get to it from c++. Is it possible, can anybody
tell me?
My memory isn't clear on this, but I think you can use rmic -idl or some
variant of that to generate IDL. Take a look at
http://www.omg.org/technology/documents/formal/java_language_mapping_to_omg_idl.htm
which looks like it was updated in 2008.

Perhaps you can use DII to synthesize invocations?

Best regards,
Phil
--
Phil Mesnier
Principal Software Engineer and Partner, http://www.ociweb.com
Object Computing, Inc. +01.314.579.0066 x225
Piet van Oostrum
2009-07-02 08:36:27 UTC
Permalink
GW> hi,
GW> I have an RMI server thats up in running, everything is java, client
GW> and server. nothing is defined in IDL. My java client gets its server
GW> reference from the (TAO) name service and invokes problem free.
I am not familiar with TAO myself, but with Corba in general (I am an
omniORRB fan).

The fact that your java client gets a reference from the TAO name
service suggests that RMI-IIOP is used rather than plain RMI (JRMP).
GW> I want to write a c++ client that connects to the same service and
GW> invokes methods on it. There's no IDL, no poa exposed, so I don't
GW> really see how I can get to it from c++. Is it possible, can anybody
GW> tell me?
As Phil Mesnier has stated you can rmic -idl to generate IDL. This
generated very ugly IDL in general, with lots of valuetypes. The problem
might be to use these valuetypes from C++. If your RMI methods use
non-remote objects as parameters or results you need these valuetypes.
If they are anything other that simple things like strings, e.g. your
own objects, or instances of very specific Java classes you have a
problem as you would have to emulate these in C++.

In those cases you might be able to write some wrapper classes in Java
to make access from C++ easier. These wrappe classes could use RMI-IIOP
or Corba. I think the latter option gives you more possibilities.
--
Piet van Oostrum <***@cs.uu.nl>
URL: http://pietvanoostrum.com [PGP 8DAE142BE17999C4]
Private email: ***@vanoostrum.org
Graham Walsh
2009-07-03 09:29:41 UTC
Permalink
Post by Piet van Oostrum
GW> hi,
GW> I have an RMI server thats up in running, everything is java, client
GW> and server. nothing is defined in IDL. My java client gets its server
GW> reference from the (TAO) name service and invokes problem free.
I am not familiar with TAO myself, but with Corba in general (I am an
omniORRB fan).
The fact that your java client gets a reference from the TAO name
service suggests that RMI-IIOP is used rather than plain RMI (JRMP).
GW> I want to write a c++ client that connects to the same service and
GW> invokes methods on it. There's no IDL, no poa exposed, so I don't
GW> really see how I can get to it from c++. Is it possible, can anybody
GW> tell me?
As Phil Mesnier has stated you can rmic -idl to generate IDL. This
generated very ugly IDL in general, with lots of valuetypes. The problem
might be to use these valuetypes from C++. If your RMI methods use
non-remote objects as parameters or results you need these valuetypes.
If they are anything other that simple things like strings, e.g. your
own objects, or instances of very specific Java classes you have a
problem as you would have to emulate these in C++.
In those cases you might be able to write some wrapper classes in Java
to make access from C++ easier. These wrappe classes could use RMI-IIOP
or  Corba. I think the latter option gives you more possibilities.
--
URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
thanks for the replies. Its RMI over IIOP alright. I think I'll just
go with a java client instead of trying to attack it from C++. Good to
know that I can use rmic -idl if I need to.

have a nice weekend.

Graham

Loading...