use of org.jboss.as.server.deployment.module.ModuleDependency 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));
}
use of org.jboss.as.server.deployment.module.ModuleDependency 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);
}
}
use of org.jboss.as.server.deployment.module.ModuleDependency 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));
}
use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class WeldDependencyProcessor method deploy.
/**
* Add dependencies for modules required for weld deployments, if managed weld configurations are attached to the deployment
*
*/
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, JAVAX_ENTERPRISE_API);
addDependency(moduleSpecification, moduleLoader, JAVAX_INJECT_API);
if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
// Skip if there are no beans.xml files in the deployment
return;
}
addDependency(moduleSpecification, moduleLoader, JAVAX_PERSISTENCE_API_ID);
addDependency(moduleSpecification, moduleLoader, WELD_CORE_ID);
addDependency(moduleSpecification, moduleLoader, WELD_PROBE_ID, true);
addDependency(moduleSpecification, moduleLoader, WELD_API_ID);
addDependency(moduleSpecification, moduleLoader, WELD_SPI_ID);
ModuleDependency weldSubsystemDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_ID, false, false, false, false);
weldSubsystemDependency.addImportFilter(PathFilters.getMetaInfFilter(), true);
weldSubsystemDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/injection"), true);
weldSubsystemDependency.addImportFilter(PathFilters.acceptAll(), false);
weldSubsystemDependency.addExportFilter(PathFilters.getMetaInfFilter(), true);
moduleSpecification.addSystemDependency(weldSubsystemDependency);
// Due to serialization of EJBs
ModuleDependency weldEjbDependency = new ModuleDependency(moduleLoader, JBOSS_AS_WELD_EJB_ID, true, false, false, false);
weldEjbDependency.addImportFilter(PathFilters.is("org/jboss/as/weld/ejb"), true);
weldEjbDependency.addImportFilter(PathFilters.acceptAll(), false);
moduleSpecification.addSystemDependency(weldEjbDependency);
}
use of org.jboss.as.server.deployment.module.ModuleDependency in project wildfly by wildfly.
the class JSFDependencyProcessor method addJSFAPI.
private void addJSFAPI(String jsfVersion, ModuleSpecification moduleSpecification, ModuleLoader moduleLoader) throws DeploymentUnitProcessingException {
if (jsfVersion.equals(JsfVersionMarker.WAR_BUNDLES_JSF_IMPL))
return;
ModuleIdentifier jsfModule = moduleIdFactory.getApiModId(jsfVersion);
ModuleDependency jsfAPI = new ModuleDependency(moduleLoader, jsfModule, false, false, false, false);
moduleSpecification.addSystemDependency(jsfAPI);
}
Aggregations