Hi all,I’m trying to invoke an XQuery function (instance of FItem) from a Java class that acts a callback listener for a Java client adapter.
I’m able to instantiate and register it in a query module by using the Java bindings, passing the reference to the XQuery code to invoke) but at the moment that the function is invoked a QueryContext instance is needed (or at least the current Context to create it if I understood correctly) of the running BaseX service (an HTTP server in my case). I tried to find a way to do that taking a look of the Jobs module and similar packages in the source code but without success.
In the “Java" examples it is shown how to do this for code invoked during a query execution in a class that is a subclass of the QueryModule and by using the ContextDependent annotation that do the job automatically. It is not my case since the code is not directly call during a query execution but asynchronously in a separate thread.
Finally my questions: It is something that is possibile to do? Is there some singleton I can access or other classes I can use to achieve that?
Thanks and regards.
Mauro