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);
}
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));
}
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;
}
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);
}
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));
}
}
Aggregations