Skip to content

Commit

Permalink
Only start WeldBootstrap once per the entire deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jharting committed Mar 17, 2013
1 parent 8821379 commit 0dcd3ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -59,7 +59,6 @@
import org.jboss.as.weld.ejb.EjbDescriptorImpl;
import org.jboss.as.weld.services.bootstrap.WeldJpaInjectionServices;
import org.jboss.as.weld.util.Indices;
import org.jboss.as.weld.util.ResourceRoots;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.jandex.Index;
Expand Down Expand Up @@ -230,7 +229,11 @@ private ResourceRootHandler(DeploymentUnit deploymentUnit, Multimap<ResourceRoot
}
this.prefix = prefix;
this.indexes = AnnotationIndexUtils.getAnnotationIndexes(deploymentUnit);
this.discoveryConfiguration = deploymentUnit.getAttachment(WeldAttachments.WELD_TYPE_DISCOVERY_CONFIGURATION);
DeploymentUnit rootDeploymentUnit = deploymentUnit;
if (rootDeploymentUnit.getParent() != null) {
rootDeploymentUnit = rootDeploymentUnit.getParent();
}
this.discoveryConfiguration = rootDeploymentUnit.getAttachment(WeldAttachments.WELD_TYPE_DISCOVERY_CONFIGURATION);
this.ejbComponentDescriptions = ejbComponentDescriptions;
this.reflectionIndex = deploymentUnit.getAttachment(Attachments.REFLECTION_INDEX);
this.deploymentResourceRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
Expand Down
Expand Up @@ -61,6 +61,10 @@ public class WeldTypeDiscoveryProcessor implements DeploymentUnitProcessor {
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();

if (deploymentUnit.getParent() != null) {
return; // only start WeldBootstrap for the root deployment
}

if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
return;
}
Expand Down

0 comments on commit 0dcd3ac

Please sign in to comment.