boolean isProbablePuRootJar(String jarName) { // all jars in root of subarchive are probable pu roots boolean probablePuRootJar = PersistenceArchivist.isProbablePuRootJar(jarName); if(!probablePuRootJar && isJarEntry(jarName) ) { // A jar that is not in root of archive. Log that it will not be scanned if (st_logger.isLoggable(Level.FINE)) { st_logger.logp(Level.FINE, "PersistenceArchivist", "readPersistenceDeploymentDescriptors", "skipping {0} as it exists inside a directory in {1}.", new Object[]{jarName, getPathOfSubArchiveToScan()}); } } return probablePuRootJar; } }
/** * Gets probable persitence roots from given parentArchive using given subArchiveRootScanner * @param parentArchive the parentArchive within which probable persitence roots need to be scanned * @param subArchivePURootScanner the scanner instance used for the scan * @see com.sun.enterprise.deployment.archivist.EarPersistenceArchivist.SubArchivePURootScanner * @return Map of puroot path to probable puroot archive. */ protected static Map<String, ReadableArchive> getProbablePersistenceRoots(ReadableArchive parentArchive, SubArchivePURootScanner subArchivePURootScanner) { Map<String, ReadableArchive> probablePersitenceArchives = new HashMap<String, ReadableArchive>(); ReadableArchive archiveToScan = subArchivePURootScanner.getSubArchiveToScan(parentArchive); if(archiveToScan != null) { // The subarchive exists Enumeration<String> entries = archiveToScan.entries(); String puRootPrefix = subArchivePURootScanner.getPurRootPrefix(); while(entries.hasMoreElements()) { String entry = entries.nextElement(); if(subArchivePURootScanner.isProbablePuRootJar(entry)) { ReadableArchive puRootArchive = getSubArchive(archiveToScan, entry, false /* expect entry to be present */); if(puRootArchive != null) { String puRoot = puRootPrefix + entry; probablePersitenceArchives.put(puRoot, puRootArchive); } } } } return probablePersitenceArchives; }
/** * Gets probable persitence roots from given parentArchive using given subArchiveRootScanner * @param parentArchive the parentArchive within which probable persitence roots need to be scanned * @param subArchivePURootScanner the scanner instance used for the scan * @see com.sun.enterprise.deployment.archivist.EarPersistenceArchivist.SubArchivePURootScanner * @return Map of puroot path to probable puroot archive. */ protected static Map<String, ReadableArchive> getProbablePersistenceRoots(ReadableArchive parentArchive, SubArchivePURootScanner subArchivePURootScanner) { Map<String, ReadableArchive> probablePersitenceArchives = new HashMap<String, ReadableArchive>(); ReadableArchive archiveToScan = subArchivePURootScanner.getSubArchiveToScan(parentArchive); if(archiveToScan != null) { // The subarchive exists Enumeration<String> entries = archiveToScan.entries(); String puRootPrefix = subArchivePURootScanner.getPurRootPrefix(); while(entries.hasMoreElements()) { String entry = entries.nextElement(); if(subArchivePURootScanner.isProbablePuRootJar(entry)) { ReadableArchive puRootArchive = getSubArchive(archiveToScan, entry, false /* expect entry to be present */); if(puRootArchive != null) { String puRoot = puRootPrefix + entry; probablePersitenceArchives.put(puRoot, puRootArchive); } } } } return probablePersitenceArchives; }
boolean isProbablePuRootJar(String jarName) { // all jars in root of subarchive are probable pu roots boolean probablePuRootJar = PersistenceArchivist.isProbablePuRootJar(jarName); if(!probablePuRootJar && isJarEntry(jarName) ) { // A jar that is not in root of archive. Log that it will not be scanned if (deplLogger.isLoggable(Level.FINE)) { deplLogger.logp(Level.FINE, "PersistenceArchivist", "readPersistenceDeploymentDescriptors", "skipping {0} as it exists inside a directory in {1}.", new Object[]{jarName, getPathOfSubArchiveToScan()}); } } return probablePuRootJar; } }
String getPurRootPrefix() { String pathOfSubArchiveToScan = getPathOfSubArchiveToScan(); return (pathOfSubArchiveToScan == null || pathOfSubArchiveToScan.isEmpty()) ? pathOfSubArchiveToScan : pathOfSubArchiveToScan + SEPERATOR_CHAR; }
ReadableArchive getSubArchiveToScan(ReadableArchive parentArchive) { String pathOfSubArchiveToScan = getPathOfSubArchiveToScan(); return (pathOfSubArchiveToScan == null || pathOfSubArchiveToScan.isEmpty()) ? parentArchive : getSubArchive(parentArchive, pathOfSubArchiveToScan, true /*It is possible that lib does not exist for a given ear */); }
@Override public boolean isProbablePuRootJar(String jarName) { return super.isProbablePuRootJar(jarName) && // component roots are not scanned while scanning ear. They will be handled // while scanning the component. !isComponentJar(jarName,(app.getModules())); } }
String getPurRootPrefix() { String pathOfSubArchiveToScan = getPathOfSubArchiveToScan(); return (pathOfSubArchiveToScan == null || pathOfSubArchiveToScan.isEmpty()) ? pathOfSubArchiveToScan : pathOfSubArchiveToScan + SEPERATOR_CHAR; }
@Override public boolean isProbablePuRootJar(String jarName) { return super.isProbablePuRootJar(jarName) && // component roots are not scanned while scanning ear. They will be handled // while scanning the component. !isComponentJar(jarName,(app.getModules())); } }
ReadableArchive getSubArchiveToScan(ReadableArchive parentArchive) { String pathOfSubArchiveToScan = getPathOfSubArchiveToScan(); return (pathOfSubArchiveToScan == null || pathOfSubArchiveToScan.isEmpty()) ? parentArchive : getSubArchive(parentArchive, pathOfSubArchiveToScan, true /*It is possible that lib does not exist for a given ear */); }