views:

66

answers:

2

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

+2  A: 

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.

Tom Hawtin - tackline
+1  A: 

As a starting point, Classworlds is useful for creating separate classloaders, and classloader hierarchies.

mdma