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); }
/** * Add POJO module if we have any bean factories. * * @param phaseContext the deployment unit context * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY); if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty()) return; for (KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors) { if (kdxd.getBeanFactoriesCount() > 0) { final ModuleSpecification moduleSpecification = unit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); ModuleDependency dependency = new ModuleDependency(moduleLoader, POJO_MODULE, false, false, false, false); PathFilter filter = PathFilters.isChildOf(BaseBeanFactory.class.getPackage().getName()); dependency.addImportFilter(filter, true); dependency.addImportFilter(PathFilters.rejectAll(), false); moduleSpecification.addSystemDependency(dependency); return; } } }
/** * Add the EE APIs as a dependency to all deployments * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException * */ 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(); //add jboss-invocation classes needed by the proxies ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false); invocation.addImportFilter(PathFilters.is("org/jboss/invocation/proxy/classloading"), true); invocation.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(invocation); ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/component/serialization"), true); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent"), true); ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent/handle"), true); ee.addImportFilter(PathFilters.acceptAll(), false); moduleSpecification.addSystemDependency(ee); // add dep for naming permission moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.wildfly.naming"), false, false, false, false)); //we always add all Java EE API modules, as the platform spec requires them to always be available //we do not just add the javaee.api module, as this breaks excludes for (final ModuleIdentifier moduleIdentifier : JAVA_EE_API_MODULES) { moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, true, false, true, false)); } }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACC_API, false, false, true, false)); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, AUTH_MESSAGE_API, false, false, true, 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); 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); }
@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 addDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier, boolean optional, boolean deploymentBundelesClientBuilder) { ModuleDependency dependency = new ModuleDependency(moduleLoader, moduleIdentifier, optional, false, true, false); if(deploymentBundelesClientBuilder) { dependency.addImportFilter(PathFilters.is(CLIENT_BUILDER), false); } moduleSpecification.addSystemDependency(dependency); }
private void addDependency(ModuleSpecification moduleSpecification, ModuleLoader moduleLoader, ModuleIdentifier moduleIdentifier, boolean optional, boolean deploymentBundelesClientBuilder) { ModuleDependency dependency = new ModuleDependency(moduleLoader, moduleIdentifier, optional, false, true, false); if(deploymentBundelesClientBuilder) { dependency.addImportFilter(PathFilters.is(CLIENT_BUILDER), false); } moduleSpecification.addSystemDependency(dependency); }
/** * Add POJO module if we have any bean factories. * * @param phaseContext the deployment unit context * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit unit = phaseContext.getDeploymentUnit(); final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY); if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty()) return; for (KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors) { if (kdxd.getBeanFactoriesCount() > 0) { final ModuleSpecification moduleSpecification = unit.getAttachment(Attachments.MODULE_SPECIFICATION); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); ModuleDependency dependency = new ModuleDependency(moduleLoader, POJO_MODULE, false, false, false, false); PathFilter filter = PathFilters.isChildOf(BaseBeanFactory.class.getPackage().getName()); dependency.addImportFilter(filter, true); dependency.addImportFilter(PathFilters.rejectAll(), false); moduleSpecification.addSystemDependency(dependency); return; } } }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); }
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); } }
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); } }
/** {@inheritDoc} */ public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ModuleLoader moduleLoader = Module.getBootModuleLoader(); final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false)); //add the remoting login module final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false); remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".","/")), true); moduleSpecification.addSystemDependency(remoting); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACC_API, false, false, true, false)); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, AUTH_MESSAGE_API, false, false, true, false)); }
@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); } }
/** * Add the EE APIs as a dependency to all deployments * * @param phaseContext the deployment unit context * @throws DeploymentUnitProcessingException * */ 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(); moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAVAEE_API_ID, false, false, true, false)); // TODO: Post 7.0, we have to rethink this whole hibernate dependencies that we add to user deployments moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HIBERNATE_VALIDATOR_ID, false, false, true, false)); //add jboss-invocation classes needed by the proxies ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false); invocation.addImportFilter(PathFilters.is("org.jboss.invocation.proxy.classloading"), true); moduleSpecification.addSystemDependency(invocation); ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false); ee.addImportFilter(PathFilters.is("org.jboss.as.ee.component.serialization"), true); moduleSpecification.addSystemDependency(ee); }
/** * 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); }