-
Notifications
You must be signed in to change notification settings - Fork 63
Home
= Roadmap =
This is an informal roadmap for Javabridge's development. The major drivers for development right now are CellProfiler's use of the Javabridge to access Java, ImageJ (https://github.com/imagej) and Bio-Formats (https://github.com/openmicroscopy/bioformats, https://github.com/scifio). A secondary driver is support of Javabridge's use in Scijava's scripting-cpython (https://github.com/scijava/scripting-cpython).
== Calling Python from Java ==
There's a clear need for a facility to do a Python eval or exec from within Java and to implement Python methods for Java interfaces (see the proxy branch: https://github.com/CellProfiler/python-javabridge/tree/proxy). AWT calls need to be made on the UI thread. A couple strategies:
-
The proxy mechanism could detect that it is in the UI thread and run the runnable queue loop while waiting for the method invocation to complete on the Python invocation thread. That would let the Python invocation thread post runnables to the UI thread.
-
We could implement a JNI class capable of performing Python exec and eval calls. The Python thread context and GIL could be handled using code from wx (or borrow the ideas for their mechanism) that remembers the Python thread state and recaptures the GIL when going from Python to Java.
The second mechanism is a bit of work, but has more utility long-term.