@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); }
@Override public Collection<Service> getServices(DeploymentUnit rootDeploymentUnit, DeploymentUnit deploymentUnit, Module module, ResourceRoot resourceRoot) { List<Service> services = new ArrayList<>(); // ResourceInjectionServices // TODO I'm not quite sure we should use rootDeploymentUnit here services.add(new WeldResourceInjectionServices(rootDeploymentUnit.getServiceRegistry(), rootDeploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION), module, DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit))); // ClassFileServices final CompositeIndex index = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); if (index != null) { services.add(new WeldClassFileServices(index, module.getClassLoader())); } return services; }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } List<ResourceRoot> potentialSubDeployments = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { if (ModuleRootMarker.isModuleRoot(resourceRoot)) { // module roots cannot be managed bean jars continue; } final Index index = resourceRoot.getAttachment(Attachments.ANNOTATION_INDEX); if (index != null) { if (!index.getAnnotations(MANAGED_BEAN).isEmpty()) { //this is a managed bean deployment SubDeploymentMarker.mark(resourceRoot); ModuleRootMarker.mark(resourceRoot); } } } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { handler.handleResourceRoot(bdaMap, handler.deploymentResourceRoot); id = bda.getId(); } else { id = deploymentUnit.getAttachment(WeldAttachments.DEPLOYMENT_ROOT_BEAN_DEPLOYMENT_ARCHIVE).getId();
/** * {@inheritDoc} */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); AbstractSecurityDeployer<?> deployer = null; if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { deployer = new EarSecurityDeployer(); JaccService<?> service = deployer.deploy(deploymentUnit); if (service != null) { final ServiceName jaccServiceName = deploymentUnit.getServiceName().append(JaccService.SERVICE_NAME); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); ServiceBuilder<?> builder = serviceTarget.addService(jaccServiceName, service); if (deploymentUnit.getParent() != null) { // add dependency to parent policy final DeploymentUnit parentDU = deploymentUnit.getParent(); builder.addDependency(parentDU.getServiceName().append(JaccService.SERVICE_NAME), PolicyConfiguration.class, service.getParentPolicyInjector()); } builder.setInitialMode(Mode.ACTIVE).install(); } } }
return deploymentUnit.getAttachment(BatchAttachments.JOB_XML_RESOLVER); final Module module = deploymentUnit.getAttachment(Attachments.MODULE); final ClassLoader classLoader = module.getClassLoader(); WildFlyJobXmlResolver resolver; if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { resolver = create(classLoader, deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS)); } else { resolver = create(classLoader, Collections.singletonList(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT)));
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); assert warMetaData != null; Map<String, WebMetaData> annotationsMetaData = warMetaData.getAnnotationsMetaData(); Map<ModuleIdentifier, CompositeIndex> additionalModelAnnotations = deploymentUnit.getAttachment(Attachments.ADDITIONAL_ANNOTATION_INDEXES_BY_MODULE); if (additionalModelAnnotations != null) { final List<WebMetaData> additional = new ArrayList<WebMetaData>();
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { List<ResourceRoot> potentialSubDeployments = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { final ResourceRoot root = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); final ModuleMetaData md = root.getAttachment(org.jboss.as.ee.structure.Attachments.MODULE_META_DATA); if (md != null) {
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } List<ResourceRoot> potentialSubDeployments = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { if (ModuleRootMarker.isModuleRoot(resourceRoot)) { // module roots cannot be managed bean jars continue; } final Index index = resourceRoot.getAttachment(Attachments.ANNOTATION_INDEX); if (index != null) { if (!index.getAnnotations(MANAGED_BEAN).isEmpty()) { //this is a managed bean deployment SubDeploymentMarker.mark(resourceRoot); ModuleRootMarker.mark(resourceRoot); } } } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments } log.info("adding dependency on mongo to: " + deploymentUnit.getServiceName()); deploymentUnit.addToAttachmentList(WEB_SETUP_ACTIONS, new DependencySetupAction()); }
private boolean shouldJsfActivate(final DeploymentUnit deploymentUnit, WarMetaData warMetaData) { if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return false; roots.add(deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT)); roots.addAll(deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS)); for (ResourceRoot root : roots) { CompositeIndex index = deploymentUnit.getAttachment(Attachments.COMPOSITE_ANNOTATION_INDEX); for (DotName annotation : JSF_ANNOTATIONS) { List<AnnotationInstance> annotations = index.getAnnotations(annotation);
@Override public Collection<Service> getServices(DeploymentUnit rootDeploymentUnit, DeploymentUnit deploymentUnit, Module module, ResourceRoot resourceRoot) { if (resourceRoot == null) { return Collections.emptySet(); } return Collections.singleton(new WeldEjbInjectionServices(rootDeploymentUnit.getServiceRegistry(), rootDeploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION), rootDeploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_APPLICATION_DESCRIPTION), resourceRoot.getRoot(), module, DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit))); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if(eeModuleDescription == null) { return; } processModuleDescription(eeModuleDescription, deploymentUnit, phaseContext); final Collection<ComponentDescription> componentDescriptions = eeModuleDescription.getComponentDescriptions(); if (componentDescriptions == null) { return; } for (ComponentDescription componentDescription : componentDescriptions) { if (componentDescription.getNamingMode() == ComponentNamingMode.NONE) { // skip components without namespace continue; } processComponentDescription(componentDescription); } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return;
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } List<ResourceRoot> potentialSubDeployments = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { if (ModuleRootMarker.isModuleRoot(resourceRoot)) { // module roots cannot be managed bean jars continue; } final Index index = resourceRoot.getAttachment(Attachments.ANNOTATION_INDEX); if (index != null) { if (!index.getAnnotations(MANAGED_BEAN).isEmpty()) { //this is a managed bean deployment SubDeploymentMarker.mark(resourceRoot); ModuleRootMarker.mark(resourceRoot); } } } }
/** * {@inheritDoc} */ @Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); AbstractSecurityDeployer<?> deployer = null; if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { deployer = new EarSecurityDeployer(); JaccService<?> service = deployer.deploy(deploymentUnit); if (service != null) { final ServiceName jaccServiceName = deploymentUnit.getServiceName().append(JaccService.SERVICE_NAME); final ServiceTarget serviceTarget = phaseContext.getServiceTarget(); ServiceBuilder<?> builder = serviceTarget.addService(jaccServiceName, service); if (deploymentUnit.getParent() != null) { // add dependency to parent policy final DeploymentUnit parentDU = deploymentUnit.getParent(); builder.addDependency(parentDU.getServiceName().append(JaccService.SERVICE_NAME), PolicyConfiguration.class, service.getParentPolicyInjector()); } builder.setInitialMode(Mode.ACTIVE).install(); } } }
if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { final List<ResourceRoot> roots = deploymentUnit.getAttachmentList(org.jboss.as.server.deployment.Attachments.RESOURCE_ROOTS); if(roots != null) for(ResourceRoot root : roots) { if(SubDeploymentMarker.isSubDeployment(root)) { final ResourceRoot parentRoot = deploymentUnit.getAttachment(org.jboss.as.server.deployment.Attachments.DEPLOYMENT_ROOT); final String relativePath = root.getRoot().getPathNameRelativeTo(parentRoot.getRoot()); final ServiceName subDeploymentServiceName = Services.deploymentUnitName(deploymentUnit.getName(), relativePath);
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (DeploymentTypeMarker.isType(EAR, deploymentUnit)) { return; } final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION); if(moduleDescription == null) { return; } final String defaultDataSource = moduleDescription.getDefaultResourceJndiNames().getDataSource(); if(defaultDataSource == null) { return; } final LookupInjectionSource injectionSource = new LookupInjectionSource(defaultDataSource); if (DeploymentTypeMarker.isType(WAR, deploymentUnit)) { moduleDescription.getBindingConfigurations().add(new BindingConfiguration(MODULE_DEFAULT_DATASOURCE_JNDI_NAME, injectionSource)); } else { if (DeploymentTypeMarker.isType(APPLICATION_CLIENT, deploymentUnit)) { moduleDescription.getBindingConfigurations().add(new BindingConfiguration(COMP_DEFAULT_DATASOURCE_JNDI_NAME, injectionSource)); } for(ComponentDescription componentDescription : moduleDescription.getComponentDescriptions()) { if(componentDescription.getNamingMode() == ComponentNamingMode.CREATE) { componentDescription.getBindingConfigurations().add(new BindingConfiguration(COMP_DEFAULT_DATASOURCE_JNDI_NAME, injectionSource)); } } } }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.WAR, deploymentUnit)) { return; // Skip non web deployments WarMetaData warMetaData = deploymentUnit.getAttachment(WarMetaData.ATTACHMENT_KEY); assert warMetaData != null; Map<String, WebFragmentMetaData> webFragments = warMetaData.getWebFragmentsMetaData();
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (!DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) { return; } List<ResourceRoot> potentialSubDeployments = deploymentUnit.getAttachmentList(Attachments.RESOURCE_ROOTS); for (ResourceRoot resourceRoot : potentialSubDeployments) { if (ModuleRootMarker.isModuleRoot(resourceRoot)) { // module roots cannot be managed bean jars continue; } final Index index = resourceRoot.getAttachment(Attachments.ANNOTATION_INDEX); if (index != null) { if (!index.getAnnotations(MANAGED_BEAN).isEmpty()) { //this is an managed bean deployment SubDeploymentMarker.mark(resourceRoot); ModuleRootMarker.mark(resourceRoot); } } } }