private void installBootstrapConfigurationService(WeldDeployment deployment, DeploymentUnit parentDeploymentUnit) { final boolean nonPortableMode = parentDeploymentUnit.getAttachment(WeldConfiguration.ATTACHMENT_KEY).isNonPortableMode(); final ExternalConfiguration configuration = new ExternalConfigurationBuilder() .add(ConfigurationKey.NON_PORTABLE_MODE.get(), nonPortableMode) .add(ConfigurationKey.ALLOW_OPTIMIZED_CLEANUP.get(), true) .build(); deployment.getServices().add(ExternalConfiguration.class, configuration); }
private ResourceRootHandler(DeploymentUnit deploymentUnit, Components components, Map<ResourceRoot, Index> indexes) { this.deploymentUnit = deploymentUnit; this.explicitBeanArchives = deploymentUnit.getAttachment(ExplicitBeanArchiveMetadataContainer.ATTACHMENT_KEY); this.module = deploymentUnit.getAttachment(Attachments.MODULE); this.indexes = indexes; this.components = components; this.reflectionIndex = deploymentUnit.getAttachment(Attachments.REFLECTION_INDEX); this.deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT); this.classesResourceRoot = deploymentUnit.getAttachment(WeldAttachments.CLASSES_RESOURCE_ROOT); HashSet<AnnotationType> annotationTypes = new HashSet<>(getRootDeploymentUnit(deploymentUnit).getAttachment(WeldAttachments.BEAN_DEFINING_ANNOTATIONS)); List<DotName> definingAnnotations = getRootDeploymentUnit(deploymentUnit).getAttachmentList(InjectionTargetDefiningAnnotations.INJECTION_TARGET_DEFINING_ANNOTATIONS); for(DotName annotation : definingAnnotations) { annotationTypes.add(new AnnotationType(annotation, false)); } this.beanDefiningAnnotations = annotationTypes; this.requireBeanDescriptor = getRootDeploymentUnit(deploymentUnit).getAttachment(WeldConfiguration.ATTACHMENT_KEY).isRequireBeanDescriptor(); }
@Override public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if (deploymentUnit.getParent() != null) { return; // only attach the configuration to the root deployment } boolean requireBeanDescriptor = requireBeanDescriptorGlobal; boolean nonPortableMode = nonPortableModeGlobal; boolean developmentMode = developmentModeGlobal; WeldJBossAllConfiguration configuration = deploymentUnit.getAttachment(WeldJBossAllConfiguration.ATTACHMENT_KEY); if (configuration != null) { requireBeanDescriptor = getValue(configuration.getRequireBeanDescriptor(), requireBeanDescriptorGlobal); nonPortableMode = getValue(configuration.getNonPortableMode(), nonPortableModeGlobal); developmentMode = getValue(configuration.getDevelopmentMode(), developmentModeGlobal); } WeldConfiguration mergedConfiguration = new WeldConfiguration(requireBeanDescriptor, nonPortableMode, developmentMode); deploymentUnit.putAttachment(WeldConfiguration.ATTACHMENT_KEY, mergedConfiguration); }
if (!configuration.isDevelopmentMode()) {
return; if (Utils.getRootDeploymentUnit(deploymentUnit).getAttachment(WeldConfiguration.ATTACHMENT_KEY).isRequireBeanDescriptor()) {