Search in sources :

Example 31 with ModuleLoader

use of org.jboss.modules.ModuleLoader 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 32 with ModuleLoader

use of org.jboss.modules.ModuleLoader 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

ModuleLoader (org.jboss.modules.ModuleLoader)32 ModuleSpecification (org.jboss.as.server.deployment.module.ModuleSpecification)26 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)24 ModuleDependency (org.jboss.as.server.deployment.module.ModuleDependency)22 Module (org.jboss.modules.Module)4 ModuleIdentifier (org.jboss.modules.ModuleIdentifier)4 ArrayList (java.util.ArrayList)2 PredicatedHandler (io.undertow.server.handlers.builder.PredicatedHandler)1 Method (java.lang.reflect.Method)1 Collections (java.util.Collections)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 ConcurrencyManagementType (javax.ejb.ConcurrencyManagementType)1 TransactionManagementType (javax.ejb.TransactionManagementType)1 PersistenceProvider (javax.persistence.spi.PersistenceProvider)1 Attachments (org.jboss.as.ee.component.Attachments)1 ComponentConfiguration (org.jboss.as.ee.component.ComponentConfiguration)1 ComponentConfigurator (org.jboss.as.ee.component.ComponentConfigurator)1 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)1