@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())); } }
/** * Reads persistence.xml from spec defined pu roots of an ear. * Spec defined pu roots are - (1)Non component jars in root of ear (2)jars in lib of ear */ @Override public Object open(Archivist main, ReadableArchive earArchive, final RootDeploymentDescriptor descriptor) throws IOException, SAXParseException { if(logger.isLoggable(Level.FINE)) { logger.logp(Level.FINE, "EarArchivist", "readPersistenceDeploymentDescriptors", "archive = {0}", earArchive.getURI()); } Map<String, ReadableArchive> probablePersitenceArchives = new HashMap<String, ReadableArchive>(); try { final Application app = Application.class.cast(descriptor); // TODO: need to compute includeRoot, not hard-code it, in the next invocation. The flag should be set to true if operating in v2 compatibility mode false otherwise. // Check with Hong how to get hold of the flag here? EARBasedPersistenceHelper.addLibraryAndTopLevelCandidates(earArchive, app, true /* includeRoot */, probablePersitenceArchives); for(Map.Entry<String, ReadableArchive> pathToArchiveEntry : probablePersitenceArchives.entrySet()) { readPersistenceDeploymentDescriptor(main, pathToArchiveEntry.getValue(), pathToArchiveEntry.getKey(), descriptor); } } finally { for(Archive subArchive : probablePersitenceArchives.values()) { subArchive.close(); } } return null; }
private void addOtherNondeployedScanTargets(final ReadableArchive clientArchive, final ApplicationClientDescriptor acDescr, final Map<String,ReadableArchive> candidates) { /* * The archive is a non-deployed one. We know from an earlier check * that this is not a stand-alone app client, so we can use the * app client archive's parent archive to get to the containing EAR for * use in a subarchive scanner. */ final ReadableArchive earArchive = clientArchive.getParentArchive(); EARBasedPersistenceHelper.addLibraryAndTopLevelCandidates(earArchive, acDescr.getApplication(), true, candidates); }
@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())); } }
private void addOtherNondeployedScanTargets(final ReadableArchive clientArchive, final ApplicationClientDescriptor acDescr, final Map<String,ReadableArchive> candidates) { /* * The archive is a non-deployed one. We know from an earlier check * that this is not a stand-alone app client, so we can use the * app client archive's parent archive to get to the containing EAR for * use in a subarchive scanner. */ final ReadableArchive earArchive = clientArchive.getParentArchive(); EARBasedPersistenceHelper.addLibraryAndTopLevelCandidates(earArchive, acDescr.getApplication(), true, candidates); }
private boolean scanForPURRootsInEarRoot(DeploymentContext ctx, Set<ModuleDescriptor<BundleDescriptor>> modules) { boolean puPresentInEarRoot = false; Enumeration<String> entriesInEar = ctx.getSource().entries(); while(entriesInEar.hasMoreElements() && !puPresentInEarRoot) { String entry = entriesInEar.nextElement(); puPresentInEarRoot = PersistenceArchivist.isProbablePuRootJar(entry) && !EARBasedPersistenceHelper.isComponentJar(entry, modules); } return puPresentInEarRoot; } }
EARBasedPersistenceHelper.addLibraryAndTopLevelCandidates(earArchive, app, true /* includeRoot */, probablePersitenceArchives);