Multiple sandboxes in one JavaVM

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

+2


a source to share


2 answers


As part of the Sun / Oracle Java library implementation, if you want to use a sandboxing, which can be called "GUI", you need to use a non-standard, undocumented and unsupported API sun.awt.AppContext

.

Apart from using the APIs involved in this mess, you just need to keep separate ClassLoader

and possibly Thread

/ ThreadGroup

s.



There was a JSR for the "isolates", but nothing has happened yet.

+2


a source


As a starting point, Classworlds is useful for creating separate class loaders and class hierarchies.



+1


a source