Calling java Method

Posted by HachDev on 15-May-2015 04:05

Hi everyone,

how can i call a java method using progress ABL ???

thanks

All Replies

Posted by Matt Baker on 15-May-2015 07:07

 
What are you trying to accomplish?   You cannot call directly from ABL to java.  Although you can do this with .NET.
 
[collapse]
From: HachDev [mailto:bounce-HachDev@community.progress.com]
Sent: Friday, May 15, 2015 5:07 AM
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] alling java Method
 
Thread created by HachDev

Hi everyone,

how can i call a java method using progress ABL ???

thanks

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by cwiner on 15-May-2015 13:40

You can use the Java Open Client product that is part of OE.
 
[collapse]
From: Matt Baker [mailto:bounce-mbaker@community.progress.com]
Sent: Friday, May 15, 2015 8:08 AM
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] alling java Method
 
Reply by Matt Baker
 
What are you trying to accomplish?   You cannot call directly from ABL to java.  Although you can do this with .NET.
 
[collapse]
From: HachDev [mailto:bounce-HachDev@community.progress.com]
Sent: Friday, May 15, 2015 5:07 AM
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] alling java Method
 
Thread created by HachDev

Hi everyone,

how can i call a java method using progress ABL ???

thanks

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]

Posted by Bill Wood on 15-May-2015 13:49

WRT

>>> You can use the Java Open Client product that is part of OE

This will let you call FROM Java into ABL.  It does not let you call FROM ABL to Java methods.  

Posted by Thomas Mercer-Hursh on 15-May-2015 13:56

John Green had a thing years ago for calling Java from ABL, but I doubt that it is even vaguely current and wasn't a real production tool in any case.  You could go the IKVM route to convert the Java to .NET and then it becomes easy to call from ABL ... or just find a .NET component that does what you want.

Posted by Brian K. Maher on 15-May-2015 14:06

Hi Hach,
 
If you want to call a Java method from OpenEdge, there are really only a few ways to go:
 
- Use OS-COMMAND or INPUT-OUTPUT THROUGH to call out and run java.  You would specify the full command line exactly as you would from a command prompt.  For this you need some kind of "main" class that does what you want.  This option will be slow and not a choice I would use if performance is an issue or you need to make this call many times.
 
- You could use sockets and have your Java process sitting in the background somewhere listening for requests and processing them.
 
- You could try to use JNI from the ABL to call out to Java.  I have no idea how feasible this is.
 
- You could also try to do as Thomas said and put it in a .NET wrapper of some kind.
 
I think it really comes down to what is the use case for this.  Once per session?  Many times per session?  On a single user machine (i.e. Windows) or will/can it be sitting on a server somewhere?
 
Sincerely, Brian Maher
 

Posted by Marian Edu on 15-May-2015 14:41

JNI works, just have to write some (more or less generic) wrappers in C

(dll, so) and call those from 4GL using external procedures

definition... the wrapper library loads the JVM and then it will be able

to call out Java methods through JNI, we did that for being able to

preview/export/print reports made with Birt/Jasper from 4GL run-time.

Posted by Garry Hall on 19-May-2015 20:50

Your solution might depend on the platform. I have seen problems trying to load a JVM into the AVM on unix platforms, due to the conflict of signal handlers in each product.

This thread is closed