This content has been marked as final. Show 2 replies
I think I have to access the JVM, where my Java application is running, or don't you think so??
Is this possible??
I need a solution for this problem: My Java program queries via JPL a .pl-file and executes this... Now I want, that the .pl-file may ask such "Java program, please give me the value of the current getName() back".... On the fly. While the java program is running.
Is it possible, that, in this situation, Java and Prolog can "talk" to eachother?
Thanks a lot!!!
966541 wrote:This sounds like a dubious design. Java objects don't have automatic access to the object which calls one of their methods, so why should you expect this to be a feature of JPL?
But I want to access the "caller-instance", that invoked the prolog to be running.
When you write Java code which does require that the called method will have access to the calling object, the way you do that is for the calling object to pass "this" as one of the method parameters. Perhaps you should try this? I have no experience in JPL so I have no idea whether that is possible or not.