/** * Used for dynamic class loading in dependent jars in ears; the set is used to terminate a * cycle if one exists; the cycle is invalid, but you never know what people might try... */ protected synchronized Class loadClass(String name, Set visitedArchives) throws ClassNotFoundException { if (visitedArchives.contains(getArchive())) throw new ClassNotFoundException(name); visitedArchives.add(getArchive()); try { return super.loadClass(name, false); } catch (ClassNotFoundException ex) { return loadClassInDependentJarInEAR(name, visitedArchives); } }
protected File getFileFromArchive(String name) { try { return getArchive().getFile(name); } catch (FileNotFoundException e) { } return null; }
protected Object getResourceInDependentJarInEAR(String name, int type) { Set visitedArchives = new HashSet(5); visitedArchives.add(getArchive()); return getResourceInDependentJarInEAR(name, visitedArchives, type); }
protected EARFile getEARFile() { return (EARFile) getArchive().getContainer(); }