use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly by wildfly.
the class SecurityDependencyProcessor method deploy.
/** {@inheritDoc} */
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final ModuleLoader moduleLoader = Module.getBootModuleLoader();
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, PICKETBOX_ID, false, false, false, false));
//add the remoting login module
final ModuleDependency remoting = new ModuleDependency(moduleLoader, REMOTING_LOGIN_MODULE, false, false, false, false);
remoting.addImportFilter(PathFilters.is(RemotingLoginModule.class.getName().replace(".", "/")), true);
moduleSpecification.addSystemDependency(remoting);
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, JACC_API, false, false, true, false));
moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, AUTH_MESSAGE_API, false, false, true, false));
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project wildfly-camel by wildfly-extras.
the class CamelDependenciesProcessor method deploy.
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit depUnit = phaseContext.getDeploymentUnit();
CamelDeploymentSettings depSettings = depUnit.getAttachment(CamelDeploymentSettings.ATTACHMENT_KEY);
// Camel dependencies disabled
if (!depSettings.isEnabled()) {
return;
}
ModuleLoader moduleLoader = depUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
ModuleSpecification moduleSpec = depUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create(GRAVIA_MODULE), false, false, false, false));
moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create(WILDFLY_CAMEL_MODULE), false, false, false, false));
// Add camel aggregator dependency
ModuleDependency moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_MODULE), false, false, true, false);
moddep.addImportFilter(PathFilters.getMetaInfFilter(), true);
moduleSpec.addUserDependency(moddep);
List<ModuleIdentifier> deploymentDefinedModules = depSettings.getModuleDependencies();
if (!deploymentDefinedModules.isEmpty()) {
for (ModuleIdentifier modid : deploymentDefinedModules) {
moduleSpec.addUserDependency(new ModuleDependency(moduleLoader, modid, false, false, true, false));
}
} else {
moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create(APACHE_CAMEL_COMPONENT_MODULE), false, false, true, false);
moddep.addImportFilter(PathFilters.getMetaInfFilter(), true);
moddep.addImportFilter(PathFilters.isOrIsChildOf("META-INF/cxf"), true);
moduleSpec.addUserDependency(moddep);
moddep = new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.apache.camel.component.cdi"), true, false, false, false);
moddep.addImportFilter(PathFilters.getMetaInfSubdirectoriesFilter(), true);
moddep.addImportFilter(PathFilters.getMetaInfFilter(), true);
moduleSpec.addUserDependency(moddep);
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project teiid by teiid.
the class FileRootMountProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null || !deploymentUnit.getName().toLowerCase().endsWith(this.fileSuffix)) {
return;
}
final DeploymentMountProvider deploymentMountProvider = deploymentUnit.getAttachment(Attachments.SERVER_DEPLOYMENT_REPOSITORY);
if (deploymentMountProvider == null) {
throw new DeploymentUnitProcessingException("No deployment repository available.");
}
final VirtualFile deploymentContents = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS);
// internal deployments do not have any contents, so there is nothing to mount
if (deploymentContents == null)
return;
String deploymentName = deploymentUnit.getName();
final VirtualFile deploymentRoot = VFS.getChild("content/" + deploymentName);
Closeable handle = null;
final MountHandle mountHandle;
boolean failed = false;
try {
handle = deploymentMountProvider.mountDeploymentContent(deploymentContents, deploymentRoot, MountType.REAL);
mountHandle = new MountHandle(handle);
} catch (IOException e) {
failed = true;
throw new DeploymentUnitProcessingException("Failed to mount " + this.fileSuffix + " file", e);
} finally {
if (failed) {
VFSUtils.safeClose(handle);
}
}
final ResourceRoot resourceRoot = new ResourceRoot(deploymentRoot, mountHandle);
ModuleRootMarker.mark(resourceRoot);
deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, resourceRoot);
deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification());
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project teiid by teiid.
the class DynamicVDBRootMountDeployer method deploy.
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT) != null) {
return;
}
final String deploymentName = deploymentUnit.getName();
final VirtualFile deploymentContents = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_CONTENTS);
// internal deployments do not have any contents, so there is nothing to mount
if (deploymentContents == null)
return;
if (deploymentName.endsWith(DYNAMIC_VDB_STRUCTURE) || deploymentName.endsWith(DDL_VDB_STRUCTURE)) {
// use the contents directly
// nothing was mounted
final ResourceRoot resourceRoot = new ResourceRoot(deploymentContents, null);
ModuleRootMarker.mark(resourceRoot);
deploymentUnit.putAttachment(Attachments.DEPLOYMENT_ROOT, resourceRoot);
deploymentUnit.putAttachment(Attachments.MODULE_SPECIFICATION, new ModuleSpecification());
}
}
use of org.jboss.as.server.deployment.module.ModuleSpecification in project teiid by teiid.
the class TranslatorDependencyDeployer method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
try {
final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
// $NON-NLS-1$
final ModuleLoader moduleLoader = Module.getCallerModule().getModule(ModuleIdentifier.create("org.jboss.teiid")).getModuleLoader();
// $NON-NLS-1$
moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.api"), false, false, false, false));
// $NON-NLS-1$
moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("org.jboss.teiid.common-core"), false, false, false, false));
// $NON-NLS-1$
moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("javax.api"), false, false, false, false));
// $NON-NLS-1$
moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, ModuleIdentifier.create("javax.resource.api"), false, false, false, false));
} catch (ModuleLoadException e) {
throw new DeploymentUnitProcessingException(e);
}
}
Aggregations