use of org.jboss.modules.ModuleLoader in project wildfly by wildfly.
the class BeanValidationDeploymentDependenciesProcessor 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();
//
for (final ModuleIdentifier moduleIdentifier : DEPENDENCIES) {
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, true, false, true, false));
}
}
use of org.jboss.modules.ModuleLoader in project wildfly by wildfly.
the class ClusteringDependencyProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, API, true, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MARSHALLING_API, true, false, false, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, SINGLETON_API, true, false, false, false));
}
use of org.jboss.modules.ModuleLoader in project wildfly by wildfly.
the class JaxrsDependencyProcessor 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, JAXRS_API, false);
addDependency(moduleSpecification, moduleLoader, JAXB_API, false);
addDependency(moduleSpecification, moduleLoader, JSON_API, false);
//we need to add these from all deployments, as they could be using the JAX-RS client
addDependency(moduleSpecification, moduleLoader, RESTEASY_ATOM, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_VALIDATOR_11, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JAXRS, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JAXB, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JACKSON2, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JSON_P_PROVIDER, true);
//addDependency(moduleSpecification, moduleLoader, RESTEASY_JETTISON);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JSAPI, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_MULTIPART, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_YAML, true);
addDependency(moduleSpecification, moduleLoader, JACKSON_CORE_ASL, true);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CRYPTO, true);
addDependency(moduleSpecification, moduleLoader, JACKSON_DATATYPE_JDK8, true);
addDependency(moduleSpecification, moduleLoader, JACKSON_DATATYPE_JSR310, true);
if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
addDependency(moduleSpecification, moduleLoader, RESTEASY_CDI, true);
}
}
use of org.jboss.modules.ModuleLoader 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.modules.ModuleLoader in project wildfly by wildfly.
the class PersistenceProviderAdaptorLoader method loadPersistenceAdapterModule.
/**
* Loads the persistence provider adapter
*
* @param adapterModule may specify the adapter module name (can be null to use noop provider)
* @return the persistence provider adaptor for the provider class
* @throws ModuleLoadException
*/
public static PersistenceProviderAdaptor loadPersistenceAdapterModule(final String adapterModule, final Platform platform, JtaManagerImpl manager) throws ModuleLoadException {
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
if (adapterModule == null) {
return noopAdaptor;
}
PersistenceProviderAdaptor persistenceProviderAdaptor = null;
Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(adapterModule));
final ServiceLoader<PersistenceProviderAdaptor> serviceLoader = module.loadService(PersistenceProviderAdaptor.class);
if (serviceLoader != null) {
for (PersistenceProviderAdaptor adaptor : serviceLoader) {
if (persistenceProviderAdaptor != null) {
throw JpaLogger.ROOT_LOGGER.multipleAdapters(adapterModule);
}
persistenceProviderAdaptor = adaptor;
ROOT_LOGGER.debugf("loaded persistence provider adapter %s", adapterModule);
}
if (persistenceProviderAdaptor != null) {
persistenceProviderAdaptor.injectJtaManager(manager);
persistenceProviderAdaptor.injectPlatform(platform);
}
}
return persistenceProviderAdaptor;
}
Aggregations