We're looking to integrate Java 6's embedded version of Rhino for
extensibility, but one thing that worries us is the possibility of
someone writing a script that goes rogue in some fashion and tanks at
least that thread if not the entire server instance (especially if
multiple requests cause that script to go rogue on multiple threads).

We'd like to be able to set a timeout on the execution of a script
after which we'd terminate the script's execution and report an error
to the user.

To further complicate things, we also want to use the ability to
compile into bytecode for optimal execution speed.  If we were
evaluating a script, I think terminating the interpreter would be a no-
brainer.  However, once the script is compiled into and executed as
bytecode, I'm concerned that you're looking violating the old "never
call Thread.stop()" rule to get a rogue execution thread to terminate.

Is there a well documented way to do this safely, or if not well
documented, does someone have a good suggestion on how to approach it?

Thanks much!
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to