Hi everbody, I have published an update of JNIPort 3.0 alpha at SmalltalkHub.
Changes from the previous version: - The Java classes needed for calling back from Java into Smalltalk and for executing the regression tests have been updated. I have shortened the Java package name from org.metagnostic.jniport to just jniport, and renamed those classes which had „Dolphin“ in their class name. JNIPort has been developed for Dolphin Smalltalk by Chris Uppal, but it is available for VisualWorks and Pharo, too. Therefore I decided that the references to Dolphin are obsolete. Some methods have been renamed for the same reason. - The class files in the jars have been compiled with Java 1.6. I don’t think that the old class files compiled with Java 1.4 (or earlier?) would be a problem, but still... (and I don’t have anything earlier than Java 1.6 anyway). - Several Smalltalk wrapper classes and methods for the renamed Java classes and methods have been renamed as well. The new names should be more obvious than the old ones. - The performance problem from the first alpha version has been partly solved. The rest is caused by longer execution times for #become: in Pharo - I can’t do anything about it for the moment. If you want to use the new version, download it from SmalltalkHub, and get the archive JNIPort30-Extras.zip containing the updated jar files from the JNIPort wiki (see below). The new jar files are called JNIPort30.jar and JNIPort30-Tests.jar instead of JNIPort.jar and JNIPort-Tests.jar, such that you can use the old and the new version in parallel, if there is any need for it. For those who don’t know what JNIPort is: > JNIPort is a Smalltalk library which allows Java code to be invoked from > Smalltalk. It acts as a bridge between the world of Smalltalk objects and a > Java Virtual Machine (JVM) where Java code is executing. > > If you want to try it, load it via the ConfigurationOfJNIPort. I hope this > works. If it does not, load the packages individually in the order in which > they appear in the ConfigurationOfJNIPort. > http://www.smalltalkhub.com/#!/~JNIPort/JNIPort > The next step is to read the documentation at > http://jniport.wikispaces.com/ > Otherwise, you won't know what to do next. ;-) > Download the extra files from the download page at Wikispaces, you will need > two jar files from there. Issues: - Callbacks from „foreign“ threads, i.e. threads in the Java VM other than the one in which the Smalltalk VM runs, should be handled by the callback queueing mechanism implemented by the classes in JNIPort30.jar. This mechanism ensures that the callback into Smalltalk is executed in the Smalltalk thread. This works in VisualWorks and Dolphin, but in Pharo it leads to a crash of the VM when executing the Smalltalk callback block which is installed as a native method in Java space. I have as yet no idea why this does not work. - The JNIPort wiki lacks documentation about the Pharo version and a recipe for using callbacks. The latter is hidden in the original documentation by Chris Uppal, which can be downloaded from the wiki. - No tool support in Pharo yet. In VisualWorks, there is a settings editor, storage of settings in a „registry“ (on Windows, this is the „real“ registry), and there are menu items in the system browser for generating Smalltalk wrapper classes for Java classes. None of this exists for Pharo yet. Best regards, Joachim Geidel