Search code examples
javasecuritysandbox

Multiple Sandboxes in the same JavaVM


Is there a framework or api to let multiple isolated sandboxes run in a single java vm?


Solution

  • Under the Sun/Oracle implementation of the Java library, if you want to sandbox what might loosely be called "GUIs" then you need to use the non-standard, undocumented and unsupported sun.awt.AppContext API.

    Other than using APIs involved in that sort of mess, you just need to keep separate ClassLoaders and perhaps Thread/ThreadGroups.

    There was a JSR for "isolates", but nothing has come of that as yet.