On Fri, 03 Mar 2006, Bill Kelly defenestrated me:

> From: "Charles O Nutter" <headius / headius.com>
> >
> >>     Since JRuby uses a custom class loader, you will have to either sign
> >>     the applet or edit the client's java.policy file and add the line:
> >>         permission java.lang.RuntimePermission "getClassLoader";
> >
> >FYI, this is more a limitation of the Bean Scripting Framework than of
> >JRuby itself. JRuby currently has no hard dependencies on
> >security-risky features like custom classloaders, and a version of
> >JRuby could be built--sans BSF--that would run just fine as an applet.
> 
> Cool, nice to know!
> 
> It looked like it was mostly confined to that JRubyEngine.java 
> file, although I'm a little lost looking at the source, as I
> don't know what the purpose of a BSF is yet.  :)

  A more detailed explanation of BSF is at jakarta.apache.org/bsf.  We 
generally encourage anyone embedding JRuby (Ruby) into a Java application
to use BSF, since it takes care of setting up and managing the interpreter
with a fairly simple API.

  For some context of use of BSF with JRuby check out our lithe example
doc:
http://jruby.sourceforge.net/docs/bsf.shtml

  To embed JRuby in an applet without using BSF basically would be grokking
our JRubyEngine to understand under the covers how we set up, invoke, and 
tear down the interpreter.  We have the desire to make this easy to do 
without requiring BSF, but have not found the time to make it happen yet.

> But before I delve into it, I was wondering, would you say it
> should be fairly easy to remove the BSF dependency?  Or am I 
> looking at a lot of hacking and slashing?

  The impl of JRubyEngine we have shows the amount of code you need.
If you understand the url above on BSF usage and understand this manager
impl, you should get a good idea.

> Also, if JRuby is running as an applet, the ruby standard library
> files and my own program scripts will reside on the server, not
> the client's system.  Is this something that will somehow be 
> fairly transparent to the applet?  Or will I be looking at hacking
> in the ability for JRuby to read .rb files from the server?

  I have some ideas on this that I have not added yet to the source.  We 
want to extend the include path to give the ability to provide url paths.  
We need to do this in a safe way, but I have given it at least some thought.
Any continued discussion on this may be better served on 
jruby-devel / list.sourceforge.net.

-Tom

-- 
+ http://www.tc.umn.edu/~enebo +---- mailto:enebo / acm.org ----+
| Thomas E Enebo, Protagonist  | "Luck favors the prepared    |
|                              |  mind." -Louis Pasteur       |