Search in sources :

Example 21 with ModuleDependency

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

the class TransactionDependenciesProcessor method addJTSModuleDependencyToDeployment.

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

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

the class TransactionDependenciesProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit unit = phaseContext.getDeploymentUnit();
    final ModuleLoader moduleLoader = Module.getBootModuleLoader();
    final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
    moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, TRANSACTION_API, false, false, true, false));
    moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.fromString("org.wildfly.transaction.client"), false, false, true, false));
    final CompositeIndex compositeIndex = unit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX);
    if (compositeIndex == null) {
        return;
    }
    final List<AnnotationInstance> transactionalAnnotations = compositeIndex.getAnnotations(DotName.createSimple(Transactional.class.getName()));
    final List<AnnotationInstance> transactionScopedAnnotations = compositeIndex.getAnnotations(DotName.createSimple(TransactionScoped.class.getName()));
    if (transactionalAnnotations.size() > 0 || transactionScopedAnnotations.size() > 0) {
        addJTSModuleDependencyToDeployment(unit);
    }
}
Also used : ModuleLoader(org.jboss.modules.ModuleLoader) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) CompositeIndex(org.jboss.as.server.deployment.annotation.CompositeIndex) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) AnnotationInstance(org.jboss.jandex.AnnotationInstance)

Example 23 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 24 with ModuleDependency

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

the class WeldDependencyProcessor method deploy.

/**
     * 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)) {
        // Skip if there are no beans.xml files in the deployment
        return;
    }
    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);
}
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 25 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) throws DeploymentUnitProcessingException {
    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)

Aggregations

ModuleDependency (org.jboss.as.server.deployment.module.ModuleDependency)33 ModuleSpecification (org.jboss.as.server.deployment.module.ModuleSpecification)27 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)24 ModuleLoader (org.jboss.modules.ModuleLoader)22 ModuleIdentifier (org.jboss.modules.ModuleIdentifier)12 HashSet (java.util.HashSet)4 CompositeIndex (org.jboss.as.server.deployment.annotation.CompositeIndex)3 WarMetaData (org.jboss.as.web.common.WarMetaData)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 ServiceModuleLoader (org.jboss.as.server.moduleservice.ServiceModuleLoader)2 AnnotationInstance (org.jboss.jandex.AnnotationInstance)2 Module (org.jboss.modules.Module)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 Map (java.util.Map)1 Set (java.util.Set)1 ExecutorService (java.util.concurrent.ExecutorService)1 ServletContainerInitializer (javax.servlet.ServletContainerInitializer)1 HandlesTypes (javax.servlet.annotation.HandlesTypes)1 ApplicationPath (javax.ws.rs.ApplicationPath)1