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());
context = new DeploymentContextImpl(report, archive, parameters, env); context.setArchiveHandler(archiveHandler); String appName = archiveHandler.getDefaultApplicationName(archive, context); parameters.name = appName; archiveHandler.expand(archive, expandedArchive, context); context.setSource(expandedArchive);
private ClassLoader createClassLoader(ClassLoaderHierarchy clh, ArchiveHandler handler, String appName) throws URISyntaxException, MalformedURLException { // first we create the appLib class loader, this is non shared libraries class loader ClassLoader applibCL = clh.getAppLibClassLoader(appName, getAppLibs()); ClassLoader parentCL = clh.createApplicationParentCL(applibCL, this); return handler.getClassLoader(parentCL, this); }
name = archiveHandler.getDefaultApplicationName(initialContext.getSource(), initialContext); } else { DeploymentUtils.validateApplicationName(name); String versionIdentifier = archiveHandler.getVersionIdentifier(initialContext.getSource());
Long start = System.currentTimeMillis(); final WritableArchive expandedArchive = archiveFactory.createArchive(expansionDir); archiveHandler.expand(archive, expandedArchive, initial); if (logger.isLoggable(Level.FINE)) { logger.fine("Deployment expansion took " + (System.currentTimeMillis() - start));
params.name = archiveHandler.getDefaultApplicationName(archive, initialContext);
/** * 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); }
if (handler.requiresAnnotationScanning(context.getSource())) { getDeployableTypes(context);
name = archiveHandler.getDefaultApplicationName(archive, initialContext); } else { DeploymentUtils.validateApplicationName(name); String versionIdentifier = archiveHandler.getVersionIdentifier(archive);
Long start = System.currentTimeMillis(); final WritableArchive expandedArchive = archiveFactory.createArchive(expansionDir); archiveHandler.expand(archive, expandedArchive, initial); if (logger.isLoggable(Level.FINE)) { logger.fine("Deployment expansion took " + (System.currentTimeMillis() - start));
private static Collection<Sniffer> getSniffersForModule(ServiceLocator habitat, ReadableArchive archive, ModuleDescriptor md, Application app) throws Exception { ArchiveHandler handler = habitat.getService(ArchiveHandler.class, md.getModuleType().toString()); SnifferManager snifferManager = habitat.getService(SnifferManager.class); List<URI> classPathURIs = handler.getClassPathURIs(archive); classPathURIs.addAll(getLibraryJarURIs(app, archive)); Types types = archive.getParentArchive().getExtraData(Types.class);
if (handler.requiresAnnotationScanning(context.getSource())) { getDeployableTypes(context);
/** * 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()); }
if (tmpDir.mkdirs()) { ArchiveHandler handler = deployment.getArchiveHandler(sourceArchive); final String appName = handler.getDefaultApplicationName(sourceArchive); DeploymentContextImpl dummyContext = new DeploymentContextImpl(report, logger, sourceArchive, parameters, env); handler.expand(sourceArchive, archiveFactoryProvider.get().createArchive(tmpDir), dummyContext); sourceArchive = archiveFactoryProvider.get().openArchive(tmpDir);
subHandler.expand(subArchiveToExpand, subTarget, context); } else {
ClassLoader subCl = handler.getClassLoader(cl, subContext);
/** * 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;