Chris In Michigan
The (mis)adventures of a geek in the Great White North
Last Updated 8/5/2002; 10:09:24 PM
 
Click to see the XML version of this web page.

Subscribe to "Chris In Michigan" in Radio UserLand.
 

Sunday, February 10, 2002

Radio won't return an address or an object's type from an XML-RPC call, even though both are basically nothing more than strings.  For some reason, they have special types within Radio.  It would be very useful if the app would automatically convert objects that can't be handled as XML-RPC values could be encoded as Strings by default.  I think it would save a lot of headaches, and I can't see a good reason not to.


10:31:18 PM    

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    

"Andy Sylvester is maintaining a directory of Radio tools... and, if you click up: macros, scripts, themes, tutorials... there's a whole lot of stuff in there." [Garth Kidd: Deadly Bloody Serious about Radio UserLand]
1:47:44 PM    


© Copyright 2002 Christopher T. Nitchie

Click here to visit the Radio UserLand website.

 
February 2002
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28    
Jan   Mar


Categories:
Home Page
Geek Stuff
Personal Stuff
 

  Current book:
1916

days until the wedding!
My Amazon Wishlist
Click here to send an email to the editor of this weblog.