How to import java library into uniface | Uniface Integration | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

—  Results per page  —








— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters
For a group of consecutive words like 'end of support' use Match phrase

sp_Feed Topic RSS sp_TopicIcon
How to import java library into uniface
25 Jun 2016
5:27 pm
Avatar
neifassula
Member
Forum Posts: 9
Member Since:
08 Jan 2016
sp_UserOfflineSmall Offline

I’ve had a lock at documentation and I saw that is possible to call uniface operations from java classes, using as describe in java call-in documentation.  

But are there some way to import a java library into uniface and then call it using the activate?

Many thanks

Nei

28 Jun 2016
11:37 am
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

Hello Nei,

Unfortunately, as you have probably already noticed, we do not have a direct Java call-out mechanism in Uniface.

But using a C module that calls Java via JNI you can do quite a lot. In fact last year I worked on such a thing, a signature plus 3GL module which lets you call more or less arbitrary Java classes – provided they use only basic parameters and return values (numeric, string, boolean). I had planned to document this and publish it here but never found the time for it.

If you think this can be useful for you I can give you the details. It might be good if someone other than me tries it out before it gets published 🙂

 

Cheers,

Chris Breemer
Uniface Technical Support 

01 Jul 2016
1:23 pm
Avatar
neifassula
Member
Forum Posts: 9
Member Since:
08 Jan 2016
sp_UserOfflineSmall Offline

Hi Chris,

Yes, I think this can be useful.

Would be nice if you can share the details about it, so I can advance with my researchs, and will be nice if I can contribute somehow.

Feel free to call me privately via email “nei.fassula@dnacode.com.br” or even via Skype “cfassula”.

Many thanks

Nei

04 Jul 2016
4:40 pm
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

Hello Nei,

Ok. I’ll need to get this off the shelf and make it work with Uniface 9.7. Watch this space.

Cheers

Chris

29 Jul 2016
1:08 pm
Avatar
neifassula
Member
Forum Posts: 9
Member Since:
08 Jan 2016
sp_UserOfflineSmall Offline

Hello Chris

Any news about it?

If you need I’m happy to try to make it works with Uniface 9.7.

Cheers

Nei

01 Aug 2016
11:07 am
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

Hello Nei,

I am working on it as we speak. What I still need to do is implement it on Windows 64 bits. When that works I’ll start wrapping it up for publication. Should not take very long now !

 

Cheers,

Chris Breemer

03 Aug 2016
5:29 pm
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

It’s now working on Win32, Win64, and Linux. Now I remember there was a memory leak on repeated invocation. I guess may as well try and fix that before making it available. Working on it….

Cheers,

Chris Breemer

10 Aug 2016
2:24 pm
Avatar
neifassula
Member
Forum Posts: 9
Member Since:
08 Jan 2016
sp_UserOfflineSmall Offline

Chris Breemer said
It’s now working on Win32, Win64, and Linux. Now I remember there was a memory leak on repeated invocation. I guess may as well try and fix that before making it available. Working on it….

Cheers,

Chris Breemer  

Hello Chris, 

Many thanks for the update. I’m locking forward to see it working. 

Cheers

Nei

07 Sep 2016
8:05 pm
Avatar
neifassula
Member
Forum Posts: 9
Member Since:
08 Jan 2016
sp_UserOfflineSmall Offline

Hello Chris, 

Do you have any news about it?

I appreciate if you could share the project as it is, maybe where you are in the project will contribute a lot with mine.

And I’m happy to contribute to fix some bug and getting the project done. 

 

Cheers

Nei

09 Sep 2016
11:37 am
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

neifassula said
Hello Chris, 

Do you have any news about it?

I appreciate if you could share the project as it is, maybe where you are in the project will contribute a lot with mine.

And I’m happy to contribute to fix some bug and getting the project done. 

 

Cheers

Nei  

Hello Nei !

I am just wrapping it all up, code and documentation are done, it is merely a question of packaging and uploading. Should be any day now. Stay tuned !

Chris

12 Sep 2016
1:31 pm
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

Hello Nei, and others interested,

Please find a first version of my Java call-out module in the Community Samples section. Your feedback will be greatly appreciated.

Cheers,

Chris

13 Sep 2016
1:14 pm
Avatar
neifassula
Member
Forum Posts: 9
Member Since:
08 Jan 2016
sp_UserOfflineSmall Offline

Hello Chris,

Many thanks for share!

I’m going to have a look at the  project and I’ll let you to know my point of view.

once again,

Many thanks!

Nei

13 Sep 2016
2:04 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1677
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Chris,

a very nice piece of work, I just had a quick glanceand a first import under 9604.

Given a bit more time, I will return some proofreading/typohunting to you.

Greetings from Frankfurt/Germany to Amsterdam,

Uli

 

 P.S. On your:

    fp = popen(cmd, “r”);
<snip>
    //fclose(fp);    //????????????????????????????????????????????

Andrew Hunt / David Thomas in “The Pragmatic Programmer – From Journeyman to Master” from 2000
in chapter 4 under “25 Balancing Resources”, there is an example where a file is opened, but not always closed.
As the “Single Responsibility Principle” it is the duty of the method opening a resource to close it as well.

13 Sep 2016
2:54 pm
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

Hi Nei and Uli, and others who had already downloaded this,

Please download again – I fixed a couple of little fluffs, one of them not closing the pipe.

( Thanks for spotting that Uli. Though I don’t need a book to know I should close my files Wink )

Have fun.

 

Chris

14 Sep 2016
10:22 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1677
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

To support testing, I added the following entry called in the RETR:

 

entry load_test
variables
   string v_occlist
endvariables
putlistitems/occ v_occlist,”A.A”
putmess v_occlist
askmess “Which Testset?”,”concatStrings,upperCase,multiply,listParameters”
selectcase($status)
   case 1
      v_occlist = “CLASS=myclass·;METHOD=concatStrings·;SIGNATURE=(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;·;ARGLIST=Hello, |world !·;CLASSPATH=.·;JVMOPTIONS=-XX:+PrintGCDetails -DDEBUG=true·;SEPARATOR=|·;GC=T·;BUFSIZE=1000·;CDEBUG=T”
   case 2
      v_occlist = “CLASS=myclass·;METHOD=upperCase·;SIGNATURE=(Ljava/lang/String;)Ljava/lang/String;·;ARGLIST=Hello, world !·;CLASSPATH=.·;JVMOPTIONS=·;SEPARATOR=·;GC=·;BUFSIZE=·;CDEBUG=”
   case 3
      v_occlist = “CLASS=myclass·;METHOD=multiply·;SIGNATURE=(II)I·;ARGLIST=81*12345679·;CLASSPATH=.·;JVMOPTIONS=·;SEPARATOR=*·;GC=·;BUFSIZE=·;CDEBUG=”
   case 4
      v_occlist = “CLASS=myclass·;METHOD=listParameters·;SIGNATURE=(ZBCDFIJSLjava/lang/String;)Ljava/lang/String;·;ARGLIST=1,2,A,3.14,2.718,123456,789012345,99,foo bar·;CLASSPATH=.·;JVMOPTIONS=-·;SEPARATOR=,·;GC=·;BUFSIZE=·;CDEBUG=”
endselectcase
getlistitems/occ v_occlist,”A.A”
end ; load_test

26 Sep 2016
9:47 am
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1677
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Test passed all my available versions from 9604 upwards, even on 10201.

Thanks Chris for opening the gate to JavaWorld,
Uli

27 Sep 2016
2:36 pm
Avatar
Chris Breemer
Member
Forum Posts: 32
Member Since:
08 May 2014
sp_UserOfflineSmall Offline

Thanks for testing that Uli. But I was not in doubt it would work with different versions (actually I did verify it on Uniface 10).

What would be more interesting to know is whether this can do what people actually need, rather than just 3 very trivial tests. The trouble is that I know there is a lot of interest in this, but I don’t know what exactly people intend to do with it. Except in one case where I already said it was not possible :-/

Cheers,

Chris 

27 Sep 2016
5:09 pm
Avatar
ulrich-merkel
Frankfurt/Germany
Member
Forum Posts: 1677
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Chris,

I think it would be benefitial for potential users (as you said: a lot of interest)
if you can add the “verified against uniface version” to your documentation.

And it may be helpful to mention the your compiled archive requires version 97 (I assume?).

Given a bit of time, I will test a bit more on the technical side like transfering collections and lists.

Once again: thank you for sharing,

Uli

27 Sep 2016
5:23 pm
Avatar
gianni
Member
Forum Posts: 237
Member Since:
01 Oct 2012
sp_UserOfflineSmall Offline

Hi Chris,

sharing toughts because I’ve sometimes discussed the option to interface Uniface with Java world with customer.

The basic functionality requested is to be able to activate “Java services” from Uniface, more or less in the same way like Uniface is already doing today with other technologies; this means a larger data type support than your current implementation.

Hope it helps…

Gianni

25 Jul 2017
1:10 pm
Avatar
assignmenthelpexperts
New Member
Forum Posts: 1
Member Since:
25 Jul 2017
sp_UserOfflineSmall Offline

Import the Java classes of the Java Call-In API into each Java call-in application

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 131

Currently Online:
18 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

ulrich-merkel: 1677

Iain Sharp: 596

Theo Neeskens: 333

gianni: 237

rogerw: 228

lalitpct: 195

istiller: 191

-GHAN-: 171

Knut: 168

sochaz: 165

Member Stats:

Guest Posters: 3

Members: 4727

Moderators: 0

Admins: 8

Forum Stats:

Groups: 1

Forums: 62

Topics: 1980

Posts: 8555

Newest Members:

RonnieArror, MashaEcs, CeccilCet, etcuvuqe, TotaluTwino, ueemporuveson, Kvas, Ernestastor, Roxbo, Aliafah

Administrators: admin: 23, Adrian Gosbell: 268, diseli: 786, Bob Maier: 2, Nico Peereboom: 58, Michael Rabone: 4, richiet: 406, JanCees: 25