use of org.jboss.as.weld.deployment.WeldPortableExtensions in project wildfly by wildfly.
the class PersistenceUnitServiceHandler method registerJPAEntityListenerRegister.
private static BeanManagerAfterDeploymentValidation registerJPAEntityListenerRegister(DeploymentUnit deploymentUnit) {
deploymentUnit = DeploymentUtils.getTopDeploymentUnit(deploymentUnit);
if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
synchronized (deploymentUnit) {
BeanManagerAfterDeploymentValidation beanManagerAfterDeploymentValidation = deploymentUnit.getAttachment(JpaAttachments.BEAN_MANAGER_AFTER_DEPLOYMENT_VALIDATION_ATTACHMENT_KEY);
if (null == beanManagerAfterDeploymentValidation) {
beanManagerAfterDeploymentValidation = new BeanManagerAfterDeploymentValidation();
deploymentUnit.putAttachment(JpaAttachments.BEAN_MANAGER_AFTER_DEPLOYMENT_VALIDATION_ATTACHMENT_KEY, beanManagerAfterDeploymentValidation);
WeldPortableExtensions extensions = WeldPortableExtensions.getPortableExtensions(deploymentUnit);
extensions.registerExtensionInstance(beanManagerAfterDeploymentValidation, deploymentUnit);
}
return beanManagerAfterDeploymentValidation;
}
} else {
return new BeanManagerAfterDeploymentValidation(true);
}
}
use of org.jboss.as.weld.deployment.WeldPortableExtensions in project wildfly by wildfly.
the class WeldPortableExtensionProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
// for war modules we require a beans.xml to load portable extensions
if (PrivateSubDeploymentMarker.isPrivate(deploymentUnit)) {
if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
return;
}
} else {
// even if this one does not.
if (!WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
return;
}
}
WeldPortableExtensions extensions = WeldPortableExtensions.getPortableExtensions(deploymentUnit);
final Module module = deploymentUnit.getAttachment(Attachments.MODULE);
ClassLoader oldCl = WildFlySecurityManager.getCurrentContextClassLoaderPrivileged();
try {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(module.getClassLoader());
loadAttachments(module, deploymentUnit, extensions);
} finally {
WildFlySecurityManager.setCurrentContextClassLoaderPrivileged(oldCl);
}
}
use of org.jboss.as.weld.deployment.WeldPortableExtensions in project wildfly by wildfly.
the class JSFCdiExtensionDeploymentProcessor method deploy.
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final DeploymentUnit parent = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
WeldPortableExtensions extensions = WeldPortableExtensions.getPortableExtensions(parent);
extensions.registerExtensionInstance(new JSFPassivatingViewScopedCdiExtension(), parent);
}
}
use of org.jboss.as.weld.deployment.WeldPortableExtensions in project wildfly by wildfly.
the class CDIDeploymentProcessor method deploy.
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
final DeploymentUnit parent = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
PropertyReplacer propertyReplacer = EJBAnnotationPropertyReplacement.propertyReplacer(deploymentUnit);
if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
WeldPortableExtensions extensions = WeldPortableExtensions.getPortableExtensions(parent);
extensions.registerExtensionInstance(new JMSCDIExtension(propertyReplacer), parent);
}
}
Aggregations