/** * Create a new VFSClassLoaderPolicy. * * @param roots the roots * @param excludedRoots the excluded roots * @return the classloader policy * @throws IllegalArgumentException for null roots */ public static VFSClassLoaderPolicy createVFSClassLoaderPolicy(VirtualFile[] roots, VirtualFile[] excludedRoots) { return new VFSClassLoaderPolicy(roots, excludedRoots); }
/** * Create a new VFSClassLoaderPolicy. * * @param name a name of the policy * @param roots the roots * @param excludedRoots the excluded roots * @return the classloader policy * @throws IllegalArgumentException for null roots */ public static VFSClassLoaderPolicy createVFSClassLoaderPolicy(String name, VirtualFile[] roots, VirtualFile[] excludedRoots) { return new VFSClassLoaderPolicy(name, roots, excludedRoots); }
/** * Create a new VFSClassLoaderPolicy. * * @param roots the roots * @return the classloader policy * @throws IllegalArgumentException for null roots */ public static VFSClassLoaderPolicy createVFSClassLoaderPolicy(VirtualFile... roots) { return new VFSClassLoaderPolicy(roots); }
/** * Create a new VFSClassLoaderPolicy. * * @param name a name of the policy * @param roots the roots * @return the classloader policy * @throws IllegalArgumentException for null roots */ public static VFSClassLoaderPolicy createVFSClassLoaderPolicy(String name, VirtualFile... roots) { return new VFSClassLoaderPolicy(name, roots); }
/** * Initialize the boot libraries using the new classloader * * @return the classloader * @throws Exception for any error */ private ClassLoader initBootLibraries() throws Exception { ClassLoaderSystem system = ClassLoaderSystem.getInstance(); mbeanServer.registerMBean(system, new ObjectName("jboss.classloader:service=ClassLoaderSystem")); List<URL> list = getBootURLs(); VirtualFile[] files = new VirtualFile[list.size()]; for (int i = 0; i < list.size(); ++i) { URL url = list.get(i); files[i] = VFS.getChild(url); } VFSClassLoaderPolicy policy = new VFSClassLoaderPolicy(files); policy.setExportAll(ExportAll.NON_EMPTY); policy.setImportAll(true); ClassLoader classLoader = system.registerClassLoaderPolicy(policy); if (classLoader instanceof RealClassLoader) bootstrapUCLName = ((RealClassLoader) classLoader).getObjectName(); return classLoader; }