I'm trying to control the execution of a Jython script from within Java and executed through a call to PythonInterpreter.exec(). The script contains calls to classes defined in Java. I'll call these classes "commands" for the discussion here. The commands can also be run on a different machine via RMI.
Since the commands take a while to complete, I want to check the progress of the commands' execution on the caller side, like at what percentage of the execution is complete. I can provide a getProgress() method to the classes but accessing this method seems to be impossible to do because PythonInterpreter doesn't allow the caller access to the command object running inside it.
Any ideas on how to do this?