Search in sources :

Example 61 with ModuleDependency

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

the class EjbDependencyDeploymentUnitProcessor method deploy.

/**
 * Adds Jakarta EE module as a dependency to any deployment unit which is an Jakarta Enterprise Beans deployment
 *
 * @param phaseContext the deployment unit context
 * @throws DeploymentUnitProcessingException
 */
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    // get hold of the deployment unit
    DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    // always add EE API
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_API, false, false, true, false));
    // previously exported by Jakarta Enterprise Beans_API prior to WFLY-5922 TODO WFLY-5967 look into moving this to WS subsystem
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAX_RPC_API, true, false, true, false));
    // we always give them the Jakarta Enterprise Beans client
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_CLIENT, false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_NAMING_CLIENT, false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_IIOP_CLIENT, false, false, false, false));
    // we always have to add this, as even non-ejb deployments may still lookup IIOP ejb's
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, EJB_SUBSYSTEM, false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_EJB, false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_NAMING, false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HTTP_TRANSACTION, false, false, true, false));
    if (IIOPDeploymentMarker.isIIOPDeployment(deploymentUnit)) {
        // needed for dynamic IIOP stubs
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, IIOP_OPENJDK, false, false, false, false));
    }
    // TODO: remove the app client bit after the next Jakarta Enterprise Beans release
    if (!isEjbDeployment(deploymentUnit) && !DeploymentTypeMarker.isType(DeploymentType.APPLICATION_CLIENT, deploymentUnit)) {
        // nothing to do
        return;
    }
    // this must be the first dep listed in the module
    if (Boolean.getBoolean("org.jboss.as.ejb3.EMBEDDED"))
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.CLASSPATH, 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) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 62 with ModuleDependency

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

the class OpenAPIDependencyProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext context) {
    DeploymentUnit unit = context.getDeploymentUnit();
    // If this is a sub-deployment, we can afford to be more discerning of the type of web application while still passing the TCK.
    boolean enabled = DeploymentTypeMarker.isType(DeploymentType.WAR, unit) && ((unit.getParent() == null) || isJaxrsDeployment(unit));
    unit.putAttachment(ATTACHMENT_KEY, enabled);
    if (enabled) {
        ModuleSpecification specification = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
        ModuleLoader loader = Module.getBootModuleLoader();
        specification.addSystemDependency(new ModuleDependency(loader, "org.eclipse.microprofile.openapi.api", 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) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 63 with ModuleDependency

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

the class DependencyProcessor method addModuleDependencies.

private static void addModuleDependencies(DeploymentUnit deploymentUnit) {
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.health.api", 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 64 with ModuleDependency

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

the class DependencyProcessor method addModuleDependencies.

private void addModuleDependencies(DeploymentUnit deploymentUnit) {
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.metrics.api", false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "io.smallrye.metrics", 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 65 with ModuleDependency

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

the class ReactiveStreamsOperatorsDependencyProcessor method addModuleDependencies.

private void addModuleDependencies(DeploymentUnit deploymentUnit) {
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.reactive-streams-operators.core", false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.reactive-streams-operators.api", false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.reactivestreams", false, false, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "io.smallrye.reactive.mutiny.reactive-streams-operators", false, false, true, false));
    ModuleDependency moduleDependency = cdiDependency(new ModuleDependency(moduleLoader, "org.wildfly.reactive.mutiny.reactive-streams-operators.cdi-provider", false, false, true, false));
    moduleSpecification.addSystemDependency(moduleDependency);
    // Converters
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "io.smallrye.reactive.converters.api", true, false, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "io.smallrye.reactive.converters.rxjava2", true, 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)

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