comp.lang.ada
 help / color / mirror / Atom feed
* Interfacing Ada code to Java - resources and hints
@ 2005-03-20  1:29 Dr. Adrian Wrigley
  2005-03-20  3:43 ` Ed Falis
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Dr. Adrian Wrigley @ 2005-03-20  1:29 UTC (permalink / raw)


Hi Guys!

I'm looking at doing a project linking a network-based Java client
library to Ada (using GNAT on ia32 Linux).

So far I haven't found much online info about how to do this :(

An interesting but old article talks of ADEPT to interface
via Annex E:
http://stsc.hill.af.mil/crossTalk/1997/12/adept.asp

And a newsgroup posting  by Tucker Taft from ten years ago:
http://archive.dstc.edu.au/AU/staff/crawley/ada/ada-java.txt

What I want to do seems fairly basic, but I'm not sure
where to start!  What libraries would I need to link to?
How do I initialize the Java runtime?  Is Annex E the way to go?

Does anyone know of basic tutorials and/or working
code I can plunder to learn how to do this?

Thanks!
-- 
Adrian




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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20  1:29 Interfacing Ada code to Java - resources and hints Dr. Adrian Wrigley
@ 2005-03-20  3:43 ` Ed Falis
  2005-03-20 10:44   ` Jerome Hugues
  2005-03-20  9:22 ` Pascal Obry
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Ed Falis @ 2005-03-20  3:43 UTC (permalink / raw)


On Sun, 20 Mar 2005 01:29:37 GMT, Dr. Adrian Wrigley  
<amtw@linuxchip.demon.co.uk.uk.uk> wrote:

>
> Does anyone know of basic tutorials and/or working
> code I can plunder to learn how to do this?
>
>

I'm not certain, but I know that PolyOrb either does or will provide the  
ability to use RMI, which should solve your problem (if it's ready).  Go  
to libre.adacore.com for PolyOrb.

- Ed



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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20  1:29 Interfacing Ada code to Java - resources and hints Dr. Adrian Wrigley
  2005-03-20  3:43 ` Ed Falis
@ 2005-03-20  9:22 ` Pascal Obry
  2005-03-20 10:49 ` Jerome Hugues
  2005-03-20 12:35 ` Dr. Adrian Wrigley
  3 siblings, 0 replies; 8+ messages in thread
From: Pascal Obry @ 2005-03-20  9:22 UTC (permalink / raw)



"Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk> writes:

> What I want to do seems fairly basic, but I'm not sure
> where to start!  What libraries would I need to link to?
> How do I initialize the Java runtime?  Is Annex E the way to go?

Maybe SOAP can be a solution, it depends on your need. If it is
have a look at AWS: http://libre.act-europe.fr/aws

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595



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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20  3:43 ` Ed Falis
@ 2005-03-20 10:44   ` Jerome Hugues
  0 siblings, 0 replies; 8+ messages in thread
From: Jerome Hugues @ 2005-03-20 10:44 UTC (permalink / raw)


In article <opsnw26qlx5afhvo@localhost>, Ed Falis wrote:
> 
> I'm not certain, but I know that PolyOrb either does or will provide the  
> ability to use RMI, which should solve your problem (if it's ready).  Go  
> to libre.adacore.com for PolyOrb.

PolyORB does not provide any RMI capabilities. In some papers we wrote
about the schizophrenic architecture (in a broader sense) that is
meant to support multiple middleware "personalities", among which we
usually cite CORBA or RMI; but this is only an illustration of the
schizophrenic architecture capabilities, not an assesment of PolyORB
capabilities. PolyORB implements DSA, not RMI ..

-- 
Jerome



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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20  1:29 Interfacing Ada code to Java - resources and hints Dr. Adrian Wrigley
  2005-03-20  3:43 ` Ed Falis
  2005-03-20  9:22 ` Pascal Obry
@ 2005-03-20 10:49 ` Jerome Hugues
  2005-03-20 12:35 ` Dr. Adrian Wrigley
  3 siblings, 0 replies; 8+ messages in thread
From: Jerome Hugues @ 2005-03-20 10:49 UTC (permalink / raw)


In article <pan.2005.03.20.01.31.27.365834@linuxchip.demon.co.uk.uk.uk>, Dr. Adrian Wrigley wrote:
> Hi Guys!
> 
> I'm looking at doing a project linking a network-based Java client
> library to Ada (using GNAT on ia32 Linux).
> 
> So far I haven't found much online info about how to do this :(
> 
> An interesting but old article talks of ADEPT to interface
> via Annex E:
> http://stsc.hill.af.mil/crossTalk/1997/12/adept.asp
> 
> And a newsgroup posting  by Tucker Taft from ten years ago:
> http://archive.dstc.edu.au/AU/staff/crawley/ada/ada-java.txt
> 
> What I want to do seems fairly basic, but I'm not sure
> where to start!  What libraries would I need to link to?
> How do I initialize the Java runtime?  Is Annex E the way to go?
> 
> Does anyone know of basic tutorials and/or working
> code I can plunder to learn how to do this?

If you mean you want to build an 'executable' that uses simultaneously
Ada and Java source code, then you might review jgnat. Unfortunately,
it seems it is no longer supported, but it may provide some basics.

I've used it for a project in my school, the goal was to use stubs
written by an IDL-to-Java compiler with some Ada code. It was
technical, but the project succeeded.

Another option might be to use gcj to compile you java code, and then
interface it with Ada. I have no idea wether this is easy or not.

-- 
Jerome



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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20  1:29 Interfacing Ada code to Java - resources and hints Dr. Adrian Wrigley
                   ` (2 preceding siblings ...)
  2005-03-20 10:49 ` Jerome Hugues
@ 2005-03-20 12:35 ` Dr. Adrian Wrigley
  2005-03-20 18:11   ` Ludovic Brenta
  3 siblings, 1 reply; 8+ messages in thread
From: Dr. Adrian Wrigley @ 2005-03-20 12:35 UTC (permalink / raw)


In case it's not clear, I'm hoping to use the normal GNAT compilation
system to build an Ada program (Ada "main") which calls some
code written in Java.  Preferably I'd end up with a single executable
without bringing in loads of additional libraries and runtime files.

For my current project (interfacing to Interactive Brokers' Java
TWS API), there are several alternatives:

Rewrite the supplied Java or C++ code in Ada or C
Modify the supplied C++ to work without MSFC etc 

The code is simple enough that a rewrite wouldn't take too
long, but it would require regular updates as the interfaces changed :(

I think Ada can interface to Java as if it were regular C code.
This would involve the JNI, with pragma Import (C,...)
Something based on gcj might also be interesting to try.

Looking to the future, I'd like to be able to interface to things
like JGraph http://www.jgraph.com/ (a graph editing component),
but this looks much more challenging.  Java seems designed
with little regard to inter-language interoperability :(

Thanks for your ideas!
-- 
Adrian




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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20 12:35 ` Dr. Adrian Wrigley
@ 2005-03-20 18:11   ` Ludovic Brenta
  2005-03-20 18:55     ` Dr. Adrian Wrigley
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2005-03-20 18:11 UTC (permalink / raw)


"Dr. Adrian Wrigley" writes:
> In case it's not clear, I'm hoping to use the normal GNAT compilation
> system to build an Ada program (Ada "main") which calls some
> code written in Java.  Preferably I'd end up with a single executable
> without bringing in loads of additional libraries and runtime files.

Look at Cafe1815: http://www.acenet.com.au/~gbull/

I used in in the past to call an Ada shared library from a Java
program.  The reverse is also possible.  Does this help?

-- 
Ludovic Brenta.



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

* Re: Interfacing Ada code to Java - resources and hints
  2005-03-20 18:11   ` Ludovic Brenta
@ 2005-03-20 18:55     ` Dr. Adrian Wrigley
  0 siblings, 0 replies; 8+ messages in thread
From: Dr. Adrian Wrigley @ 2005-03-20 18:55 UTC (permalink / raw)


On Sun, 20 Mar 2005 19:11:48 +0100, Ludovic Brenta wrote:

> "Dr. Adrian Wrigley" writes:
>> In case it's not clear, I'm hoping to use the normal GNAT compilation
>> system to build an Ada program (Ada "main") which calls some
>> code written in Java.  Preferably I'd end up with a single executable
>> without bringing in loads of additional libraries and runtime files.
> 
> Look at Cafe1815: http://www.acenet.com.au/~gbull/
> 
> I used in in the past to call an Ada shared library from a Java
> program.  The reverse is also possible.  Does this help?

Conceptually, this looks very interesting.  But it says it only
works with JDK 1.2, and is over five years old.  My best bet
for for this project now seems to be to port the MS Visual C++
code to g++ and call that using a normal Ada binding.
-- 
Adrian




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

end of thread, other threads:[~2005-03-20 18:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-20  1:29 Interfacing Ada code to Java - resources and hints Dr. Adrian Wrigley
2005-03-20  3:43 ` Ed Falis
2005-03-20 10:44   ` Jerome Hugues
2005-03-20  9:22 ` Pascal Obry
2005-03-20 10:49 ` Jerome Hugues
2005-03-20 12:35 ` Dr. Adrian Wrigley
2005-03-20 18:11   ` Ludovic Brenta
2005-03-20 18:55     ` Dr. Adrian Wrigley

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