Search in sources :

Example 31 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 32 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 33 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)

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