Well, I'm making slow but steady progress on my Java-Radio bridge toolkit. I've also done a lot of reading and hanging out with my fiancee this weekend, which is good... I was starting to get kind of blogged out.
Anyway, here's what I hope to accomplish with this bridge. From Java, you'll be able to do the following:
Radio radio = new Radio("127.0.0.1",5335); radio.eval("dialog.notify(\"This is a call from Java!")");
This code is running fine; I just need to figure out the extent to which I want to wrap the object database in a set of convenience objects and methods
From Radio things get a little more complicated. Since I don't know how to launch a JVM from within Radio, you're going to have to start one up yourself. You'll run a main method that sets up a lightweight XML-RPC server. It will also create a commandline from which you can type UserTalk commands and get the results, like so:
> sizeOf(JavaGlueThread) >> 3 > _
Then, from Radio, you could use the following UserTalk code:
local (args = {"arg1","arg2"}); local (instanceHandle = java.construct("com.mycompany.MyClass",args)); local (methodArgs = {"argA","argB"}); java.execute(instanceHandle,"aMethodName",methodArgs); java.cleanup(instanceHandle);
The code would execute in the JVM you started (so you'll have to make sure your classpath is set appropriately). Some of the Java glue for this part has been written, but none of the UserTalk yet.
Note that this has an important limitation, namely that the only argument types you can pass are those allowed by XML-RPC (strings, ints, et cetera). Also, leaving Radio open to eval calls like that introduces some pretty serious security concerns that I haven't yet begun to think though. Any ideas?
I'll try to get this done by the end of next weekend, but I needed a bit of a Radio break this weekend. If there's serious demand, let me know. I'm not that far away from having it completed.
8:11:29 PM
|