@Override String getPathOfSubArchiveToScan() { /* * Take advantage of the fact that the app's getLibraryDirectory * method handles all the semantics of the <library-directory> * element. */ return app.getLibraryDirectory(); }
@Override String getPathOfSubArchiveToScan() { /* * Take advantage of the fact that the app's getLibraryDirectory * method handles all the semantics of the <library-directory> * element. */ return app.getLibraryDirectory(); }
public static List<URI> getLibraryJarURIs(Application app, ReadableArchive archive) throws Exception { List<URL> libraryURLs = new ArrayList<URL>(); List<URI> libraryURIs = new ArrayList<URI>(); // add libraries referenced through manifest libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive)); ReadableArchive parentArchive = archive.getParentArchive(); if (parentArchive == null) { return Collections.emptyList(); } File appRoot = new File(parentArchive.getURI()); // add libraries jars inside application lib directory libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList( appRoot, app.getLibraryDirectory(), null)); for (URL url : libraryURLs) { libraryURIs.add(Util.toURI(url)); } return libraryURIs; }
ApplicationHolder holder = context.getModuleMetaData(ApplicationHolder.class); if ((holder != null) && (holder.app != null)) { String libDir = holder.app.getLibraryDirectory(); if (libDir != null && !libDir.isEmpty()) { Enumeration<String> entries = archive.entries(libDir); String libDir = holder.app.getLibraryDirectory(); for (ReadableArchive libJarArchive : libJars) { createLibJarBda(libJarArchive, ejbs, libDir);
public static List<URL> getLibraryJars(BundleDescriptor bundleDesc, ReadableArchive archive) throws IOException { List<URL> libraryURLs = new ArrayList<URL>(); // add libraries referenced through manifest libraryURLs.addAll(DeploymentUtils.getManifestLibraries(archive)); ReadableArchive parentArchive = archive.getParentArchive(); if (parentArchive == null || bundleDesc == null) { // ear level or standalone module return libraryURLs; } File appRoot = new File(parentArchive.getURI()); ModuleDescriptor moduleDesc = ((BundleDescriptor)bundleDesc).getModuleDescriptor(); Application app = ((BundleDescriptor)moduleDesc.getDescriptor()).getApplication(); // add libraries jars inside application lib directory libraryURLs.addAll(ASClassLoaderUtil.getAppLibDirLibrariesAsList( appRoot, app.getLibraryDirectory(), null)); return libraryURLs; }
parentArchive.getURI()), app.getLibraryDirectory(), compatProp);
final URL[] earLibURLs = ASClassLoaderUtil.getAppLibDirLibraries(context.getSourceDir(), holder.app.getLibraryDirectory(), compatProp); final EarLibClassLoader earLibCl = AccessController.doPrivileged(new PrivilegedAction<EarLibClassLoader>() { @Override
/** * Decides whether we have any pu roots at ear level */ public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } // Scans for pu roots in the "lib" dir of an application. // We do not scan for PU roots in root of .ear. JPA 2.0 spec will clarify that it is not a portable use case. // It is not portable use case because JavaEE spec implies that jars in root of ears are not visible by default // to components (Unless an explicit Class-Path manifest entry is present) and can potentially be loaded by // different class loaders (corresponding to each component that refers to it) thus residing in different name // space. It does not make sense to make them visible at ear level (and thus in a single name space) boolean isJPAApplication = false; ApplicationHolder holder = context.getModuleMetaData(ApplicationHolder.class); ReadableArchive appRoot = context.getSource(); if (holder != null && holder.app != null) { isJPAApplication = scanForPURootsInLibDir(appRoot, holder.app.getLibraryDirectory()); if(!isJPAApplication) { if(DeploymentUtils.useV2Compatibility(context) ) { //Scan for pu roots in root of ear isJPAApplication = scanForPURRootsInEarRoot(context, holder.app.getModules()); } } } return isJPAApplication; }