Search in sources :

Example 1 with GlobalModule

use of org.jboss.as.ee.subsystem.GlobalModulesDefinition.GlobalModule in project wildfly by wildfly.

the class GlobalModuleDependencyProcessor method deploy.

@Override
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
    final List<GlobalModule> globalMods = this.globalModules;
    for (final GlobalModule module : globalMods) {
        final ModuleDependency dependency = new ModuleDependency(Module.getBootModuleLoader(), module.getModuleIdentifier(), false, false, module.isServices(), false);
        if (module.isMetaInf()) {
            dependency.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true);
            dependency.addImportFilter(PathFilters.getMetaInfFilter(), true);
        }
        if (module.isAnnotations()) {
            deploymentUnit.addToAttachmentList(Attachments.ADDITIONAL_ANNOTATION_INDEXES, module.getModuleIdentifier());
        }
        moduleSpecification.addSystemDependency(dependency);
    }
}
Also used : GlobalModule(org.jboss.as.ee.subsystem.GlobalModulesDefinition.GlobalModule) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Aggregations

GlobalModule (org.jboss.as.ee.subsystem.GlobalModulesDefinition.GlobalModule)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 ModuleDependency (org.jboss.as.server.deployment.module.ModuleDependency)1 ModuleSpecification (org.jboss.as.server.deployment.module.ModuleSpecification)1