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