comp.lang.ada
 help / color / mirror / Atom feed
* Calling Java Methods from Ada
@ 2002-03-02  2:33 The Alchemist
  2002-03-03 18:44 ` Bruce or Tracy Jacobs
  2002-03-04  5:42 ` Ray Blaak
  0 siblings, 2 replies; 6+ messages in thread
From: The Alchemist @ 2002-03-02  2:33 UTC (permalink / raw)


Hello,

	A group of us are trying to write a Java GUI to interface to some Ada 
APIs for a class project. We've spent several weeks trying to get this 
to work. We initially started with CORBA, but couldn't get Adabroker 
working easily.
	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).
	Is there any way to call Java methods from Ada? Similar to the JNI method 
for calling Ada from Java? Or do you think we will need to go with an 
intermediary technology like CORBA or SOAP?
	Your help would be greatly appreciated as we have spent many hours trying 
to figure this one out. Our project's success depends on it!


Thank You

please reply by post and if possible email also to 
junkymail50@delete.yahoo.com (delete the word delete)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Calling Java Methods from Ada
  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
  1 sibling, 0 replies; 6+ messages in thread
From: Bruce or Tracy Jacobs @ 2002-03-03 18:44 UTC (permalink / raw)


I second that request.  I have need to call Java from Ada 
*without converting Ada to Java*.  Has anyone developed
bindings or I/F to make this possible without code conversions?

Bruce

The Alchemist wrote:
> 
> Hello,
> 
>         A group of us are trying to write a Java GUI to interface to some Ada
> APIs for a class project. We've spent several weeks trying to get this
> to work. We initially started with CORBA, but couldn't get Adabroker
> working easily.
>         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).
>         Is there any way to call Java methods from Ada? Similar to the JNI method
> for calling Ada from Java? Or do you think we will need to go with an
> intermediary technology like CORBA or SOAP?
>         Your help would be greatly appreciated as we have spent many hours trying
> to figure this one out. Our project's success depends on it!
> 
> Thank You
> 
> please reply by post and if possible email also to
> junkymail50@delete.yahoo.com (delete the word delete)



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Calling Java Methods from Ada
  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
  2002-03-04 17:13   ` Ray Blaak
  1 sibling, 1 reply; 6+ messages in thread
From: Ray Blaak @ 2002-03-04  5:42 UTC (permalink / raw)


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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Calling Java Methods from Ada
  2002-03-04  5:42 ` Ray Blaak
@ 2002-03-04 17:13   ` Ray Blaak
  0 siblings, 0 replies; 6+ messages in thread
From: Ray Blaak @ 2002-03-04 17:13 UTC (permalink / raw)


Ray Blaak <blaak@telus.net> writes:
> The Alchemist <none@none.com> writes:
> > 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.

Note also, that CORBA/SOAP solutions would suffer from the same problem as the
JNI solution with the required JNI env parameter: they would also need some
sort of server "address" that describes where to send the message to.

If you can set that up, then you can also set up the JNI env value.

-- 
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.



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Calling Java Methods from Ada
@ 2002-05-16  3:55 Geoff Bull
  2002-05-16 12:10 ` Shayne Flint
  0 siblings, 1 reply; 6+ messages in thread
From: Geoff Bull @ 2002-05-16  3:55 UTC (permalink / raw)


See http://www.acenet.com.au/~gbull/

The Alchemist (none@none.com) wrote:
>         A group of us are trying to write a Java GUI to interface to some Ada 
> APIs for a class project. We've spent several weeks trying to get this 
> to work. We initially started with CORBA, but couldn't get Adabroker 
> working easily.
>         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).
>         Is there any way to call Java methods from Ada? Similar to the JNI method 
> for calling Ada from Java? Or do you think we will need to go with an 
> intermediary technology like CORBA or SOAP?
>         Your help would be greatly appreciated as we have spent many hours trying 
> to figure this one out. Our project's success depends on it!
>



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Calling Java Methods from Ada
  2002-05-16  3:55 Geoff Bull
@ 2002-05-16 12:10 ` Shayne Flint
  0 siblings, 0 replies; 6+ messages in thread
From: Shayne Flint @ 2002-05-16 12:10 UTC (permalink / raw)


This capability (in the form of AdaJNI) is part of ObjectAda from Aonix
(http://www.aonix.com/content/products/objectada/windows.html).

Conference papers at SigAda 98 and AdaEurope 2000 may also help.

--Shayne Flint

Geoff Bull wrote:

> See http://www.acenet.com.au/~gbull/
>
> The Alchemist (none@none.com) wrote:
> >         A group of us are trying to write a Java GUI to interface to some Ada
> > APIs for a class project. We've spent several weeks trying to get this
> > to work. We initially started with CORBA, but couldn't get Adabroker
> > working easily.
> >         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).
> >         Is there any way to call Java methods from Ada? Similar to the JNI method
> > for calling Ada from Java? Or do you think we will need to go with an
> > intermediary technology like CORBA or SOAP?
> >         Your help would be greatly appreciated as we have spent many hours trying
> > to figure this one out. Our project's success depends on it!
> >




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-05-16 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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

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