use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly by wildfly.
the class DefaultEarSubDeploymentsIsolationProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// we only process .ear
if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) {
return;
}
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
// set the default ear subdeployment isolation value
moduleSpecification.setSubDeploymentModulesIsolated(earSubDeploymentsIsolated);
}
use of org.jboss.as.server.deployment.module.ModuleSpecification 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.as.server.deployment.module.ModuleSpecification 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(WILDFLY_NAMING), false, false, false, false));
for (final ModuleIdentifier moduleIdentifier : JAVA_EE_API_MODULES) {
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, moduleIdentifier, true, false, true, false));
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification 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);
boolean deploymentBundlesClientBuilder = isClientBuilderInDeployment(deploymentUnit);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
addDependency(moduleSpecification, moduleLoader, JAXRS_API, false, false);
addDependency(moduleSpecification, moduleLoader, JAXB_API, false, false);
addDependency(moduleSpecification, moduleLoader, JSON_API, false, false);
// we need to add these from all deployments, as they could be using the Jakarta RESTful Web Services client
addDependency(moduleSpecification, moduleLoader, RESTEASY_ATOM, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_VALIDATOR, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CLIENT, true, deploymentBundlesClientBuilder);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CLIENT_API, true, deploymentBundlesClientBuilder);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CORE, true, deploymentBundlesClientBuilder);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CORE_SPI, true, deploymentBundlesClientBuilder);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CLIENT_MICROPROFILE, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JAXB, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JACKSON2, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JSON_P_PROVIDER, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JSON_B_PROVIDER, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_JSAPI, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_MULTIPART, true, false);
addDependency(moduleSpecification, moduleLoader, RESTEASY_CRYPTO, true, false);
addDependency(moduleSpecification, moduleLoader, JACKSON_DATATYPE_JDK8, true, false);
addDependency(moduleSpecification, moduleLoader, JACKSON_DATATYPE_JSR310, true, false);
addDependency(moduleSpecification, moduleLoader, MP_REST_CLIENT, true, false);
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, RESTEASY_CDI, true, false);
}
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly by wildfly.
the class JSFDependencyProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final DeploymentUnit tl = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
// Set default when no default version has been set on the war file
String jsfVersion = JsfVersionMarker.getVersion(tl).equals(JsfVersionMarker.NONE) ? JSFModuleIdFactory.getInstance().getDefaultSlot() : JsfVersionMarker.getVersion(tl);
String defaultJsfVersion = JSFModuleIdFactory.getInstance().getDefaultSlot();
if (JsfVersionMarker.isJsfDisabled(deploymentUnit)) {
if (jsfVersion.equals(defaultJsfVersion) && !moduleIdFactory.isValidJSFSlot(jsfVersion)) {
throw JSFLogger.ROOT_LOGGER.invalidDefaultJSFImpl(defaultJsfVersion);
}
addJSFAPI(JsfVersionMarker.JSF_2_0, moduleSpecification, moduleLoader);
return;
}
if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit) && !DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) {
return;
}
if (jsfVersion.equals(JsfVersionMarker.WAR_BUNDLES_JSF_IMPL)) {
// if Jakarta Server Faces is provided by the application we leave it alone
return;
}
if (!moduleIdFactory.isValidJSFSlot(jsfVersion)) {
JSFLogger.ROOT_LOGGER.unknownJSFVersion(jsfVersion, defaultJsfVersion);
jsfVersion = defaultJsfVersion;
}
if (jsfVersion.equals(defaultJsfVersion) && !moduleIdFactory.isValidJSFSlot(jsfVersion)) {
throw JSFLogger.ROOT_LOGGER.invalidDefaultJSFImpl(defaultJsfVersion);
}
addJSFAPI(jsfVersion, moduleSpecification, moduleLoader);
addJSFImpl(jsfVersion, moduleSpecification, moduleLoader);
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JSF_SUBSYSTEM, false, false, true, false));
addJSFInjection(jsfVersion, moduleSpecification, moduleLoader);
WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY);
if (warMetaData != null) {
addCDIFlag(warMetaData, deploymentUnit);
}
}
Aggregations