Sandboxing with javax.script
<p>I'd like to add scripting functionality to an app that runs in a Java EE container. The javax.script API seems ideal, since I can support multiple languages with one API; the catch is, the scripts may be coming from untrusted sources, so I need to restrict what they can do. Basically, here are my requirements:</p>

<ol>
<li>Multiple scripts running at the same time.</li>
<li>The scripts do not interact with each other.</li>
<li>The scripts have no access to the JVM or the Java application code.</li>
<li>The scripts have no access to the underlying platform (file system, etc).</li>
<li>The scripts have no network access.</li>
</ol>

<p>If I can allow specific exceptions, that's great, but it's not essential. </p>

<p>Can this be done at all through the Java Scripting API? Can it be done at a lower level by configuring the scripting providers? Is there a better way to accomplish what I want?</p>
