private void addJSFImpl(String jsfVersion, ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) { if (jsfVersion.equals(JsfVersionMarker.WAR_BUNDLES_JSF_IMPL)) return; ModuleIdentifier jsfModule = moduleIdFactory.getImplModId(jsfVersion); ModuleDependency jsfImpl = new ModuleDependency(moduleLoader, jsfModule, false, false, true, false); jsfImpl.addImportFilter(PathFilters.getMetaInfFilter(), true); moduleSpecification.addSystemDependency(jsfImpl); }
private void addJSFInjection(String jsfVersion, ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) throws DeploymentUnitProcessingException { if (jsfVersion.equals(JsfVersionMarker.WAR_BUNDLES_JSF_IMPL)) return; ModuleIdentifier jsfInjectionModule = moduleIdFactory.getInjectionModId(jsfVersion); ModuleDependency jsfInjectionDependency = new ModuleDependency(moduleLoader, jsfInjectionModule, false, true, true, false); try { if (isJSF12(jsfInjectionDependency, jsfInjectionModule.toString())) { JSFLogger.ROOT_LOGGER.loadingJsf12(); jsfInjectionDependency.addImportFilter(PathFilters.is("META-INF/faces-config.xml"), false); jsfInjectionDependency.addImportFilter(PathFilters.is("META-INF/1.2/faces-config.xml"), true); } else { JSFLogger.ROOT_LOGGER.loadingJsf2x(); jsfInjectionDependency.addImportFilter(PathFilters.getMetaInfFilter(), true); // Exclude JSF 1.2 faces-config.xml to make extra sure it won't interfere with JSF 2.0 deployments jsfInjectionDependency.addImportFilter(PathFilters.is("META-INF/1.2/faces-config.xml"), false); } } catch (ModuleLoadException e) { throw JSFLogger.ROOT_LOGGER.jsfInjectionFailed(jsfVersion); } moduleSpecification.addSystemDependency(jsfInjectionDependency); }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final List<GlobalModule> globalMods = this.globalModules; for (final GlobalModule module : globalMods) { final ModuleDependency dependency = new ModuleDependency(Module.getBootModuleLoader(), module.getModuleIdentifier(), false, false, module.isServices(), false); if (module.isMetaInf()) { dependency.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true); dependency.addImportFilter(PathFilters.getMetaInfFilter(), true); } if(module.isAnnotations()) { deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_ANNOTATION_INDEXES, module.getModuleIdentifier()); } moduleSpecification.addSystemDependency(dependency); } }
/** * Add dependencies for modules required for weld deployments, if managed weld configurations are attached to the deployment * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); addDependency(moduleSpecification, moduleLoader, JAVAX_ENTERPRISE_API); addDependency(moduleSpecification, moduleLoader, JAVAX_INJECT_API); if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) { return; // Skip if there are no beans.xml files in the deployment } addDependency(moduleSpecification, moduleLoader, JAVAX_PERSISTENCE_API_ID); addDependency(moduleSpecification, moduleLoader, WELD_CORE_ID); addDependency(moduleSpecification, moduleLoader, WELD_PROBE_ID, true); addDependency(moduleSpecification, moduleLoader, WELD_API_ID); addDependency(moduleSpecification, moduleLoader, WELD_SPI_ID); ModuleDependency weldSubsystemDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_ID, false, false, false, false); weldSubsystemDependency.addImportFilter(PathFilters.getMetaInfFilter(), true); weldSubsystemDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/injection"), true); weldSubsystemDependency.addImportFilter(PathFilters.acceptAll(), false); weldSubsystemDependency.addExportFilter(PathFilters.getMetaInfFilter(), true); moduleSpecification.addSystemDependency(weldSubsystemDependency); // Due to serialization of EJBs ModuleDependency weldEjbDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_EJB_ID, true, false, false, false); weldEjbDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/ejb"), true); weldEjbDependency.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(weldEjbDependency); }
deploymentResourceRoot.getExportFilters().add(new FilterSpecification(PathFilters.getMetaInfFilter(), true)); deploymentResourceRoot.getExportFilters().add(new FilterSpecification(PathFilters.getMetaInfSubdirectoriesFilter(), true)); deploymentResourceRoot.getExportFilters().add(new FilterSpecification(PathFilters.acceptAll(), false));
private void addModuleDependency(DeploymentUnit deployment, ModuleIdentifier moduleIdentifier) { ModuleSpecification moduleSpec = deployment.getAttachment(Attachments.MODULE_SPECIFICATION); ModuleLoader moduleLoader = deployment.getAttachment(Attachments.SERVICE_MODULE_LOADER); ModuleDependency dependency = new ModuleDependency(moduleLoader, moduleIdentifier, false, true, true, false); dependency.addImportFilter(PathFilters.getMetaInfFilter(), true); moduleSpec.addSystemDependency(dependency); } }
exportBuilder.addFilter(PathFilters.getMetaInfFilter(), false);
exportBuilder.addFilter(PathFilters.getMetaInfFilter(), false);
exportBuilder.addFilter(PathFilters.getMetaInfFilter(), false);
exportBuilder.addFilter(PathFilters.getMetaInfFilter(), false);
/** * Add dependencies for modules required for weld deployments, if managed weld configurations are attached to the deployment * */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) { return; // Skip if there are no beans.xml files in the deployment } final ModuleLoader moduleLoader = Module.getBootModuleLoader(); addDependency(moduleSpecification, moduleLoader, JAVAX_PERSISTENCE_API_ID); addDependency(moduleSpecification, moduleLoader, JAVAEE_API_ID); addDependency(moduleSpecification, moduleLoader, JAVASSIST_ID); addDependency(moduleSpecification, moduleLoader, WELD_CORE_ID); addDependency(moduleSpecification, moduleLoader, WELD_API_ID); addDependency(moduleSpecification, moduleLoader, WELD_SPI_ID); ModuleDependency dep = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_ID, false, false, false, false); dep.addImportFilter(PathFilters.getMetaInfFilter(), true); dep.addExportFilter(PathFilters.getMetaInfFilter(), true); moduleSpecification.addSystemDependency(dep); }
private void addDeploymentDependencies(DeploymentUnit depUnit, CamelDeploymentSettings depSettings) { ModuleLoader moduleLoader = depUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER); ModuleSpecification moduleSpec = depUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create(WILDFLY_CAMEL_MODULE), false, false, false, false)); // Add camel aggregator dependency ModuleDependency moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_MODULE), false, false, true, false); moddep.addImportFilter(PathFilters.getMetaInfFilter(), true); moduleSpec.addUserDependency(moddep); List<String> deploymentDefinedModules = depSettings.getModuleDependencies(); if (!deploymentDefinedModules.isEmpty()) { for (String modid : deploymentDefinedModules) { moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, modid, false, false, true, false)); } } else { moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_COMPONENT_MODULE), false, false, true, false); moddep.addImportFilter(PathFilters.getMetaInfFilter(), true); moddep.addImportFilter(PathFilters.isOrIsChildOf("META-INF/cxf"), true); moduleSpec.addUserDependency(moddep); moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_COMPONENT_CDI_MODULE), true, false, false, false); moddep.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true); moddep.addImportFilter(PathFilters.getMetaInfFilter(), true); moduleSpec.addUserDependency(moddep); } }
private void addDeploymentDependencies(DeploymentUnit depUnit, CamelDeploymentSettings depSettings) { ModuleLoader moduleLoader = depUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER); ModuleSpecification moduleSpec = depUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create(WILDFLY_CAMEL_MODULE), false, false, false, false)); // Add camel aggregator dependency ModuleDependency moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_MODULE), false, false, true, false); moddep.addImportFilter(PathFilters.getMetaInfFilter(), true); moduleSpec.addUserDependency(moddep); List<String> deploymentDefinedModules = depSettings.getModuleDependencies(); if (!deploymentDefinedModules.isEmpty()) { for (String modid : deploymentDefinedModules) { moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, modid, false, false, true, false)); } } else { moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_COMPONENT_MODULE), false, false, true, false); moddep.addImportFilter(PathFilters.getMetaInfFilter(), true); moddep.addImportFilter(PathFilters.isOrIsChildOf("META-INF/cxf"), true); moduleSpec.addUserDependency(moddep); moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_COMPONENT_CDI_MODULE), true, false, false, false); moddep.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true); moddep.addImportFilter(PathFilters.getMetaInfFilter(), true); moduleSpec.addUserDependency(moddep); } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final List<GlobalModule> globalMods = this.globalModules; for (final GlobalModule module : globalMods) { final ModuleDependency dependency = new ModuleDependency(Module.getBootModuleLoader(), module.getModuleIdentifier(), false, false, module.isServices(), false); if (module.isMetaInf()) { dependency.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true); dependency.addImportFilter(PathFilters.getMetaInfFilter(), true); } if(module.isAnnotations()) { deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_ANNOTATION_INDEXES, module.getModuleIdentifier()); } moduleSpecification.addSystemDependency(dependency); } }
@Override public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); final List<GlobalModule> globalMods = this.globalModules; for (final GlobalModule module : globalMods) { final ModuleDependency dependency = new ModuleDependency(Module.getBootModuleLoader(), module.getModuleIdentifier(), false, false, module.isServices(), false); if (module.isMetaInf()) { dependency.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true); dependency.addImportFilter(PathFilters.getMetaInfFilter(), true); } if(module.isAnnotations()) { deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_ANNOTATION_INDEXES, module.getModuleIdentifier()); } moduleSpecification.addSystemDependency(dependency); } }
private void addAddonDependencies(AddonRepository repository, AddonId found, Builder builder) throws ContainerException { Set<AddonDependencyEntry> addons = repository.getAddonDependencies(found); for (AddonDependencyEntry dependency : addons) { ModuleIdentifier moduleId = findCompatibleInstalledModule(dependency.getId()); if (moduleId == null && !dependency.isOptional()) { throw new ContainerException("Dependency [" + dependency + "] could not be loaded for addon [" + found + "]"); } else { builder.addDependency(DependencySpec.createModuleDependencySpec( PathFilters.not(PathFilters.getMetaInfFilter()), dependency.isExported() ? PathFilters.acceptAll() : PathFilters.rejectAll(), this, moduleCache.getModuleId(dependency.getId()), dependency.isOptional())); } } }
importBuilder.addFilter(PathFilters.getMetaInfFilter(), false); importFilter = importBuilder.create(); if (exportFilters.isEmpty()) {
importBuilder.addFilter(PathFilters.getMetaInfFilter(), false); importFilter = importBuilder.create(); if (exportFilters.isEmpty()) {
importBuilder.addFilter(PathFilters.getMetaInfFilter(), false); importFilter = importBuilder.create(); if (exportFilters.isEmpty()) {
importBuilder.addFilter(PathFilters.getMetaInfFilter(), false); importFilter = importBuilder.create(); if (exportFilters.isEmpty()) {