Search in sources :

Example 6 with ModuleLoader

use of org.jboss.modules.ModuleLoader 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();
    if (!WeldDeploymentMarker.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) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 7 with ModuleLoader

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

use of org.jboss.modules.ModuleLoader in project wildfly by wildfly.

the class ExternalBeanArchiveProcessor method loadModuleDependency.

private Module loadModuleDependency(DependencySpec dep) {
    if (dep instanceof ModuleDependencySpec) {
        ModuleDependencySpec dependency = (ModuleDependencySpec) dep;
        final ModuleLoader loader = dependency.getModuleLoader();
        if (loader != null) {
            try {
                return dependency.getModuleLoader().loadModule(dependency.getIdentifier());
            } catch (ModuleLoadException e) {
                return null;
            }
        }
    }
    return null;
}
Also used : ModuleLoadException(org.jboss.modules.ModuleLoadException) ModuleDependencySpec(org.jboss.modules.ModuleDependencySpec) ModuleLoader(org.jboss.modules.ModuleLoader)

Example 9 with ModuleLoader

use of org.jboss.modules.ModuleLoader in project wildfly by wildfly.

the class RarDependencyProcessor method deploy.

/**
     * Add dependencies for modules required for ra deployments
     *
     * @param phaseContext the deployment unit context
     * @throws DeploymentUnitProcessingException
     *
     */
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, RESOURCE_API_ID, false, false, false, false));
    if (phaseContext.getDeploymentUnit().getAttachment(ConnectorXmlDescriptor.ATTACHMENT_KEY) == null) {
        // Skip non ra deployments
        return;
    }
    //if a module depends on a rar it also needs a dep on all the rar's "local dependencies"
    moduleSpecification.setLocalDependenciesTransitive(true);
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JMS_ID, false, false, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, VALIDATION_ID, false, false, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, IRON_JACAMAR_ID, false, false, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, IRON_JACAMAR_IMPL_ID, false, true, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, HIBERNATE_VALIDATOR_ID, false, false, true, false));
    if (!appclient)
        phaseContext.addDeploymentDependency(ConnectorServices.RESOURCEADAPTERS_SUBSYSTEM_SERVICE, ResourceAdaptersSubsystemService.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 10 with ModuleLoader

use of org.jboss.modules.ModuleLoader in project wildfly by wildfly.

the class JavaEEDependencyProcessor method deploy.

/**
     * Add the EE APIs as a dependency to all deployments
     *
     * @param phaseContext the deployment unit context
     * @throws DeploymentUnitProcessingException
     *
     */
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();
    //add jboss-invocation classes needed by the proxies
    ModuleDependency invocation = new ModuleDependency(moduleLoader, JBOSS_INVOCATION_ID, false, false, false, false);
    invocation.addImportFilter(PathFilters.is("org/jboss/invocation/proxy/classloading"), true);
    invocation.addImportFilter(PathFilters.acceptAll(), false);
    moduleSpecification.addSystemDependency(invocation);
    ModuleDependency ee = new ModuleDependency(moduleLoader, JBOSS_AS_EE, false, false, false, false);
    ee.addImportFilter(PathFilters.is("org/jboss/as/ee/component/serialization"), true);
    ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent"), true);
    ee.addImportFilter(PathFilters.is("org/jboss/as/ee/concurrent/handle"), true);
    ee.addImportFilter(PathFilters.acceptAll(), false);
    moduleSpecification.addSystemDependency(ee);
    // add dep for naming permission
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.wildfly.naming"), false, false, false, false));
    for (final ModuleIdentifier moduleIdentifier : JAVA_EE_API_MODULES) {
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, 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) ModuleIdentifier(org.jboss.modules.ModuleIdentifier) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

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