From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,75dc140d36278665 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-03 21:42:32 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!peer1-sjc1.usenetserver.com!usenetserver.com!newsfeed.telusplanet.net!news2.telusplanet.net.POSTED!53ab2750!not-for-mail Sender: blaak@blight.transcend.org Newsgroups: comp.lang.ada Subject: Re: Calling Java Methods from Ada References: <3C8039A6.6050707@none.com> From: Ray Blaak Message-ID: X-Newsreader: Gnus v5.7/Emacs 20.7 Date: Mon, 04 Mar 2002 05:42:31 GMT NNTP-Posting-Host: 207.194.18.167 X-Trace: news2.telusplanet.net 1015220551 207.194.18.167 (Sun, 03 Mar 2002 22:42:31 MST) NNTP-Posting-Date: Sun, 03 Mar 2002 22:42:31 MST Xref: archiver1.google.com comp.lang.ada:20746 Date: 2002-03-04T05:42:31+00:00 List-Id: The Alchemist 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.