comp.lang.ada
 help / color / mirror / Atom feed
From: Ray Blaak <blaak@telus.net>
Subject: Re: Calling Java Methods from Ada
Date: Mon, 04 Mar 2002 05:42:31 GMT
Date: 2002-03-04T05:42:31+00:00	[thread overview]
Message-ID: <m38z98x55n.fsf@blight.transcend.org> (raw)
In-Reply-To: 3C8039A6.6050707@none.com

The Alchemist <none@none.com> writes:
> 	A group of us are trying to write a Java GUI to interface to some Ada 
> APIs for a class project.
[...]
> 	We then tried to go with JNI which lets us call Ada functions. However,
> we need to register callback functions to the pre-existing Ada APIs (to
> receive events coming from existing Ada infrastructure that will then call
> Java methods to update GUI components). Our callback functions would like to
> call Java code, but this doesn't seem possible with a JNI connection (JNI
> needs a reference to a JNIENV that it only gets when Java calls a JNI
> method).

So why not call the Ada from Java sometime during initialization to supply that
JNIENV? Then, when the callback actually occurs, you can call Java with it.

> 	Is there any way to call Java methods from Ada? Similar to the JNI
> method for calling Ada from Java?

The short answer is no, unless you have a JVM with a custom API. JNI is simply
a standardized way of talking to JVMs in the same process from other languages.

> Or do you think we will need to go with an intermediary technology like CORBA
> or SOAP?

These would be far too heavyweight, given that they are designed for
interprocess communications across wide area networks.

-- 
Cheers,                                        The Rhythm is around me,
                                               The Rhythm has control.
Ray Blaak                                      The Rhythm is inside me,
blaak@telus.net                                The Rhythm has my soul.



  parent reply	other threads:[~2002-03-04  5:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-02  2:33 Calling Java Methods from Ada The Alchemist
2002-03-03 18:44 ` Bruce or Tracy Jacobs
2002-03-04  5:42 ` Ray Blaak [this message]
2002-03-04 17:13   ` Ray Blaak
  -- strict thread matches above, loose matches on Subject: below --
2002-05-16  3:55 Geoff Bull
2002-05-16 12:10 ` Shayne Flint
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox