Search in sources :

Example 56 with ModuleDependency

use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.

the class JSFDependencyProcessor method addJSFAPI.

private void addJSFAPI(String jsfVersion, ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) {
    if (jsfVersion.equals(JsfVersionMarker.WAR_BUNDLES_JSF_IMPL))
        return;
    ModuleIdentifier jsfModule = moduleIdFactory.getApiModId(jsfVersion);
    ModuleDependency jsfAPI = new ModuleDependency(moduleLoader, jsfModule, false, false, false, false);
    moduleSpecification.addSystemDependency(jsfAPI);
}
Also used : ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleIdentifier(org.jboss.modules.ModuleIdentifier)

Example 57 with ModuleDependency

use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.

the class DependencyProcessor method addDependencies.

private void addDependencies(DeploymentUnit deploymentUnit) {
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.config.api", false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "io.smallrye.config", false, false, true, false));
}
Also used : ModuleLoader(org.jboss.modules.ModuleLoader) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification)

Example 58 with ModuleDependency

use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.

the class MicroProfileFaultToleranceDependenciesProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
    Optional<WeldCapability> weldCapability = support.getOptionalCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class);
    if (weldCapability.isPresent() && weldCapability.get().isPartOfWeldDeployment(deploymentUnit) && MicroProfileFaultToleranceMarker.hasMicroProfileFaultToleranceAnnotations(deploymentUnit)) {
        MicroProfileFaultToleranceMarker.mark(deploymentUnit);
        ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        ModuleLoader moduleLoader = Module.getBootModuleLoader();
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.fault-tolerance.api", false, false, false, false));
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.wildfly.microprofile.fault-tolerance-smallrye.executor", false, false, true, false));
    }
}
Also used : ModuleLoader(org.jboss.modules.ModuleLoader) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) WeldCapability(org.jboss.as.weld.WeldCapability) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) CapabilityServiceSupport(org.jboss.as.controller.capability.CapabilityServiceSupport)

Example 59 with ModuleDependency

use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.

the class ApplicationClientDependencyProcessor method deploy.

@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader loader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
    moduleSpecification.addSystemDependency(new ModuleDependency(loader, CORBA_ID, false, true, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(loader, XNIO, false, true, true, false));
    final Set<ModuleIdentifier> moduleIdentifiers = new HashSet<ModuleIdentifier>();
    final DeploymentUnit top = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
    moduleIdentifiers.add(top.getAttachment(Attachments.MODULE_IDENTIFIER));
    for (final DeploymentUnit module : top.getAttachmentList(Attachments.SUB_DEPLOYMENTS)) {
        moduleIdentifiers.add(module.getAttachment(Attachments.MODULE_IDENTIFIER));
    }
    final ListIterator<ModuleDependency> iterator = moduleSpecification.getMutableUserDependencies().listIterator();
    while (iterator.hasNext()) {
        final ModuleDependency dep = iterator.next();
        final ModuleIdentifier identifier = dep.getIdentifier();
        if (identifier.getName().startsWith(ServiceModuleLoader.MODULE_PREFIX) && !identifier.getName().startsWith(ExtensionIndexService.MODULE_PREFIX) && !moduleIdentifiers.contains(identifier)) {
            iterator.remove();
        }
    }
}
Also used : ServiceModuleLoader(org.jboss.as.server.moduleservice.ServiceModuleLoader) ModuleLoader(org.jboss.modules.ModuleLoader) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) ModuleIdentifier(org.jboss.modules.ModuleIdentifier) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) HashSet(java.util.HashSet)

Example 60 with ModuleDependency

use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.

the class BatchDependencyProcessor method deploy.

@Override
public void deploy(final 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, batchModule, false, false, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, jberetModule, false, false, true, false));
}
Also used : ModuleLoader(org.jboss.modules.ModuleLoader) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

ModuleDependency (org.jboss.as.server.deployment.module.ModuleDependency)66 ModuleSpecification (org.jboss.as.server.deployment.module.ModuleSpecification)45 ModuleLoader (org.jboss.modules.ModuleLoader)40 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)34 ModuleIdentifier (org.jboss.modules.ModuleIdentifier)16 Test (org.junit.Test)6 ModuleLoadException (org.jboss.modules.ModuleLoadException)5 HashSet (java.util.HashSet)4 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)4 ArrayList (java.util.ArrayList)3 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)3 WarMetaData (org.jboss.as.web.common.WarMetaData)3 WeldCapability (org.jboss.as.weld.WeldCapability)3 Module (org.jboss.modules.Module)3 HashMap (java.util.HashMap)2 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)2 ResourceRoot (org.jboss.as.server.deployment.module.ResourceRoot)2 ServiceModuleLoader (org.jboss.as.server.moduleservice.ServiceModuleLoader)2 VirtualFile (org.jboss.vfs.VirtualFile)2 Closeable (java.io.Closeable)1