Search in sources :

Example 36 with ModuleDependency

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

the class WeldBeanValidationDependencyProcessor method deploy.

@Override
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();
    final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
    final WeldCapability weldCapability;
    try {
        weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class);
    } catch (CapabilityServiceSupport.NoSuchCapabilityException ignored) {
        return;
    }
    if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) {
        // Skip if there are no beans.xml files in the deployment
        return;
    }
    ModuleDependency cdiBeanValidationDep = new ModuleDependency(moduleLoader, CDI_BEAN_VALIDATION_ID, false, false, true, false);
    moduleSpecification.addSystemDependency(cdiBeanValidationDep);
}
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 37 with ModuleDependency

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

the class XTSDependenciesDeploymentProcessor method addXTSModuleDependency.

private void addXTSModuleDependency(final DeploymentUnit unit) {
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
    moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, XTS_MODULE, false, false, false, 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 38 with ModuleDependency

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

the class CompensationsDependenciesDeploymentProcessor method addCompensationsModuleDependency.

private void addCompensationsModuleDependency(final DeploymentUnit unit) {
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
    moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, COMPENSATIONS_MODULE, 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 39 with ModuleDependency

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

the class FederationDependencyProcessor method addDependency.

private void addDependency(DeploymentPhaseContext phaseContext, ServiceName federationServiceName) {
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    ModuleLoader moduleLoader = Module.getBootModuleLoader();
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MODULE_ORG_PICKETLINK, false, false, true, false));
    phaseContext.addDeploymentDependency(federationServiceName, DEPLOYMENT_ATTACHMENT_KEY);
}
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)

Example 40 with ModuleDependency

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

the class SecurityDependencyProcessor method deploy.

/** {@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));
}
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) RemotingLoginModule(org.jboss.as.security.remoting.RemotingLoginModule)

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