我有这个代码:
JarByteClassloader loader = new JarByteClassloader(jar);
Class c = loader.loadClass(classToLoad);
Thread.currentThread().setContextClassLoader(loader);
JarEntryObject jarEntry = (JarEntryObject) c.newInstance();
Response response = jarEntry.execute(module);
是否有可能:
- 限制
execute()函数内的代码可以访问的内容,例如封闭函数内的代码不应该能够从其他加载JarEntryObject的(隔离)访问其他对象 - 并且不应该能够访问、读取或修改应用程序和系统变量
- 不应该能够创建将创建网络端口的进程/线程
所以execute函数只能访问它创建的module对象和传递给它的对象。