java-sandbox
Securly execute untrusted code from within your application.
...It allows you to specify resources and classes that may be used by the code, thus, separating the execution from the application's execution environment.
It allows to wrap execution environments in threads or even execute them remotely on different jvms.