public List<EngineInfo> setupContainerInfos(DeploymentContext context) throws Exception { return setupContainerInfos(context.getArchiveHandler(), getSniffers(context.getArchiveHandler(), null, context), context); }
public List<EngineInfo> setupContainerInfos(DeploymentContext context) throws Exception { return setupContainerInfos(context.getArchiveHandler(), getSniffers(context.getArchiveHandler(), null, context), context); }
public static List<URL> getModuleLibraryJars(DeploymentContext context) throws Exception { ReadableArchive archive = context.getSource(); List<URL> moduleLibraryURLs = new ArrayList<URL>(); ArchiveHandler handler = context.getArchiveHandler(); if (handler.getClass() == null || handler.getClass().getAnnotation(Service.class) == null) { return moduleLibraryURLs; } String handlerName = handler.getClass().getAnnotation(Service.class).name(); File archiveFile = new File(archive.getURI()); if (handlerName.equals("war")) { // we should add all the WEB-INF/lib jars for web module File webInf = new File(archiveFile, "WEB-INF"); File webInfLib = new File(webInf, "lib"); if (webInfLib.exists()) { moduleLibraryURLs = getLibDirectoryJars(webInfLib); } } else if (handlerName.equals("connector")) { // we should add the top level jars for connector module moduleLibraryURLs = getLibDirectoryJars(archiveFile); } return moduleLibraryURLs; }
/** * Returns a collection of sniffers that recognized some parts of the * passed archive as components their container handle. * * If no sniffer recognize the passed archive, an empty collection is * returned. * * @param context the deployment context * @return possibly empty collection of sniffers that handle the passed * archive. */ public Collection<Sniffer> getSniffers(DeploymentContext context) { ReadableArchive archive = context.getSource(); ArchiveHandler handler = context.getArchiveHandler(); List<URI> uris = handler.getClassPathURIs(archive); Types types = context.getTransientAppMetaData(Types.class.getName(), Types.class); return getSniffers(context, uris, types); }
private <T extends Sniffer> List<T> getApplicableSniffers(DeploymentContext context, List<URI> uris, Types types, Collection<T> sniffers, boolean checkPath) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType());
/** * Returns true if the passed file or directory is recognized by this * composite sniffer. * @param context deployment context * @return true if the location is recognized by this sniffer */ public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } return handles(context.getSource()); }
/** * Returns true if the passed file or directory is recognized by this * sniffer. * @param context deployment context * @return true if the location is recognized by this sniffer */ @Override public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } return DeploymentUtils.isArchiveOfType(context.getSource(), warType, context, locator); }
/** * Returns true if the passed file or directory is recognized by this * sniffer. * @param context deployment context * @return true if the location is recognized by this sniffer */ @Override public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } return DeploymentUtils.isArchiveOfType(context.getSource(), rarType, context, locator); }
/** * Returns true if the passed file or directory is recognized by this * composite sniffer. * @param context deployment context * @return true if the location is recognized by this sniffer */ @Override public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } return DeploymentUtils.isArchiveOfType(context.getSource(), earType, context, locator); }
archive.exists("META-INF/application-client.xml") || archive.exists("META-INF/ra.xml")) { String archiveType = context.getArchiveHandler().getArchiveType() ; application = applicationFactory.createApplicationFromStandardDD(archive, archiveType); DeploymentTracing tracing = null;
/** * Returns true if the passed file or directory is recognized by this * sniffer. * * @param context deployment context * @return true if the location is recognized by this sniffer */ @Override public boolean handles(DeploymentContext context) { ArchiveType archiveType = habitat.getService(ArchiveType.class, context.getArchiveHandler().getArchiveType()); if (archiveType != null && !supportsArchiveType(archiveType)) { return false; } if (archiveType != null && (archiveType.equals(DOLUtils.warType()) || archiveType.equals(DOLUtils.earType()) || archiveType.equals(DOLUtils.ejbType()))) return true; return handles(context.getSource()); }
/** * 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; }
String archiveType = dc.getArchiveHandler().getArchiveType(); Archivist archivist = archivistFactory.getArchivist(archiveType, cl); if (archivist == null) {