Search in sources :

Example 26 with ModuleLoader

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

the class ApplicationClientDependencyProcessor 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 ModuleLoader loader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
    moduleSpecification.addSystemDependency(new ModuleDependency(loader, CORBA_ID, false, true, true, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(loader, XNIO, false, true, true, false));
    final Set<ModuleIdentifier> moduleIdentifiers = new HashSet<ModuleIdentifier>();
    final DeploymentUnit top = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
    moduleIdentifiers.add(top.getAttachment(Attachments.MODULE_IDENTIFIER));
    for (final DeploymentUnit module : top.getAttachmentList(Attachments.SUB_DEPLOYMENTS)) {
        moduleIdentifiers.add(module.getAttachment(Attachments.MODULE_IDENTIFIER));
    }
    final ListIterator<ModuleDependency> iterator = moduleSpecification.getMutableUserDependencies().listIterator();
    while (iterator.hasNext()) {
        final ModuleDependency dep = iterator.next();
        final ModuleIdentifier identifier = dep.getIdentifier();
        if (identifier.getName().startsWith(ServiceModuleLoader.MODULE_PREFIX) && !identifier.getName().startsWith(ExtensionIndexService.MODULE_PREFIX)) {
            if (!moduleIdentifiers.contains(identifier)) {
                iterator.remove();
            }
        }
    }
}
Also used : ServiceModuleLoader(org.jboss.as.server.moduleservice.ServiceModuleLoader) 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) HashSet(java.util.HashSet)

Example 27 with ModuleLoader

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

the class IIOPDependencyProcessor 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 ModuleLoader moduleLoader = Module.getBootModuleLoader();
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, CORBA_ID, false, false, false, false));
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JAVAX_RMI_API_ID, false, false, false, false));
    //we need to add iiop, as the orb is initialized from the context class loader of the deployment
    moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, IIOP_OPENJDK_ID, 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) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 28 with ModuleLoader

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

the class KernelDeploymentModuleProcessor method deploy.

/**
     * Add POJO module if we have any bean factories.
     *
     * @param phaseContext the deployment unit context
     * @throws org.jboss.as.server.deployment.DeploymentUnitProcessingException
     */
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit unit = phaseContext.getDeploymentUnit();
    final List<KernelDeploymentXmlDescriptor> kdXmlDescriptors = unit.getAttachment(KernelDeploymentXmlDescriptor.ATTACHMENT_KEY);
    if (kdXmlDescriptors == null || kdXmlDescriptors.isEmpty())
        return;
    for (KernelDeploymentXmlDescriptor kdxd : kdXmlDescriptors) {
        if (kdxd.getBeanFactoriesCount() > 0) {
            final ModuleSpecification moduleSpecification = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
            final ModuleLoader moduleLoader = Module.getBootModuleLoader();
            ModuleDependency dependency = new ModuleDependency(moduleLoader, POJO_MODULE, false, false, false, false);
            PathFilter filter = PathFilters.isChildOf(BaseBeanFactory.class.getPackage().getName());
            dependency.addImportFilter(filter, true);
            dependency.addImportFilter(PathFilters.rejectAll(), false);
            moduleSpecification.addSystemDependency(dependency);
            return;
        }
    }
}
Also used : ModuleLoader(org.jboss.modules.ModuleLoader) PathFilter(org.jboss.modules.filter.PathFilter) ModuleDependency(org.jboss.as.server.deployment.module.ModuleDependency) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) KernelDeploymentXmlDescriptor(org.jboss.as.pojo.descriptor.KernelDeploymentXmlDescriptor) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 29 with ModuleLoader

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

the class MessagingDependencyProcessor method deploy.

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, JMS_API);
    if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
        addDependency(moduleSpecification, moduleLoader, AS_MESSAGING);
        // The messaging-activemq subsystem provides support for injected JMSContext.
        // one of the beans has a @TransactionScoped scope which requires the CDI context
        // provided by Narayana in the org.jboss.jts module.
        // @see CDIDeploymentProcessor
        addDependency(moduleSpecification, moduleLoader, JTS);
    }
}
Also used : ModuleLoader(org.jboss.modules.ModuleLoader) ModuleSpecification(org.jboss.as.server.deployment.module.ModuleSpecification) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit)

Example 30 with ModuleLoader

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

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