Author |
Message
|
Urizen |
Posted: Wed Sep 25, 2013 11:43 am Post subject: Non Static Java Functions from ESQL |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
Hi everyone,
I've read the documentation and several posts that show the interaction between JAVA and ESQL, but only for static functions.
Does anybody tried to call a java function (non static) from ESQL?. Is it possible?.
Thanks in advance. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Wed Sep 25, 2013 11:45 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
The called function needs to be static. Once you get inside the called function, you can call any regular Java function from there.
So you can use any Java jar you want, as long as you interface it properly through a static Java function. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 25, 2013 11:45 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
instead of making guesses based on what other people say, have you considered checking what the documentation says?
What requirement are you trying to fill by using a non-static method call? |
|
Back to top |
|
 |
Urizen |
Posted: Wed Sep 25, 2013 11:55 am Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
Thanks lancelotlinc, I didn't want to write a static custom wrapper for the function, but it seems that's the only way it can be done, so i'll do it.
On the other hand, mqjeff, instead of assuming that I didn't read the documentation, have you considered reading my first post complete before answering me?. If you didn't, I'll help you:
Quote: |
I've read the documentation and several posts that show the interaction between JAVA and ESQL, but only for static functions. |
Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 25, 2013 12:02 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
Urizen |
Posted: Wed Sep 25, 2013 12:11 pm Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
Yeah, the spanish version (that's the one I've read) says something like that... but there the phrase could mean "should" or "must", that's why I asked if someone have ever tried to call a non static function.
Thanks. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Sep 25, 2013 12:13 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Perhaps C++ compilers are more flexible in Spain?
Edit:
More seriously, Compute nodes are themselves static C++ methods (and reentrant) so I suspect it would be rather challenging to make a non-static call into the embedded JVM.
As mentioned, once inside the JVM, it's a free-for-all. |
|
Back to top |
|
 |
mgk |
Posted: Wed Sep 25, 2013 1:01 pm Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
Compute nodes are themselves static C++ methods (and reentrant) so I suspect it would be rather challenging to make a non-static call into the embedded JVM. |
Compute node are C++, but they are certainly not static . I have looked into this in the past - it certainly would be possible to call Java and .NET methods that are not static if we wanted to, so if you would like this feature, please raise a requirement for future consideration...
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
Urizen |
Posted: Wed Sep 25, 2013 1:05 pm Post subject: |
|
|
Novice
Joined: 11 Jul 2013 Posts: 22
|
That's great, I'll raise the requirement then.
Thanks both!!. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Sep 26, 2013 5:08 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
mgk wrote: |
Quote: |
Compute nodes are themselves static C++ methods (and reentrant) so I suspect it would be rather challenging to make a non-static call into the embedded JVM. |
Compute node are C++, but they are certainly not static . |
I remember stuff from when I was trying to do write extensions for v5 about there only every being a single copy of the node functional code running, which has always in my mind meant "static".
 |
|
Back to top |
|
 |
mgk |
Posted: Thu Sep 26, 2013 6:45 am Post subject: |
|
|
 Padawan
Joined: 31 Jul 2003 Posts: 1642
|
Quote: |
I remember stuff from when I was trying to do write extensions for v5 about there only every being a single copy of the node functional code running. |
This part is correct for a given node in a given flow.. But the same type of node can exist more that once in a single flow or indeed in a different flow. So it can't be static as each needs its own instance of a compute node object which is shared across only the instances that below to that flow...
Kind regards, _________________ MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions. |
|
Back to top |
|
 |
|