use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly by wildfly.
the class BatchDependencyProcessor 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, batchModule, false, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, jberetModule, false, false, true, false));
}
use of org.jboss.as.server.deployment.module.ModuleSpecification 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) && !moduleIdentifiers.contains(identifier)) {
iterator.remove();
}
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly by wildfly.
the class GlobalDirectoryDependencyProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ServiceName depUnitServiceName = deploymentUnit.getServiceName();
final DeploymentUnit parent = deploymentUnit.getParent();
final DeploymentUnit topLevelDeployment = parent == null ? deploymentUnit : parent;
final ExternalModule externalModuleService = topLevelDeployment.getAttachment(Attachments.EXTERNAL_MODULE_SERVICE);
final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final CapabilityServiceSupport capabilitySupport = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
final ServiceRegistry serviceRegistry = phaseContext.getServiceRegistry();
final ServiceTarget target = phaseContext.getServiceTarget();
final ServiceTarget externalServiceTarget = deploymentUnit.getAttachment(Attachments.EXTERNAL_SERVICE_TARGET);
final ServiceName allDirReadyServiceName = depUnitServiceName.append("directory-services-ready");
final ServiceBuilder<?> allDirReadyServiceBuilder = target.addService(allDirReadyServiceName);
final List<Supplier<GlobalDirectoryResourceDefinition.GlobalDirectory>> allDirReadySuppliers = new ArrayList<>();
final ServiceName csName = capabilitySupport.getCapabilityServiceName(EE_GLOBAL_DIRECTORY_CAPABILITY_NAME);
List<ServiceName> serviceNames = serviceRegistry.getServiceNames();
for (ServiceName serviceName : serviceNames) {
if (csName.isParentOf(serviceName)) {
Supplier<GlobalDirectoryResourceDefinition.GlobalDirectory> pathRequirement = allDirReadyServiceBuilder.requires(serviceName);
allDirReadySuppliers.add(pathRequirement);
}
}
if (!allDirReadySuppliers.isEmpty()) {
GlobalDirectoryDeploymentService globalDirDepService = new GlobalDirectoryDeploymentService(allDirReadySuppliers, externalModuleService, moduleSpecification, moduleLoader, serviceRegistry, externalServiceTarget);
allDirReadyServiceBuilder.requires(phaseContext.getPhaseServiceName());
allDirReadyServiceBuilder.setInstance(globalDirDepService).install();
phaseContext.requires(allDirReadyServiceName, new DelegatingSupplier());
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification 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);
final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
if (support.hasCapability(WELD_CAPABILITY_NAME)) {
final WeldCapability api = support.getOptionalCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class).get();
if (api.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);
}
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly by wildfly.
the class DependencyProcessor method addModuleDependencies.
private static void addModuleDependencies(DeploymentUnit deploymentUnit) {
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, "org.eclipse.microprofile.health.api", false, false, false, false));
}
Aggregations