Search in sources :

Example 1 with EjbProxyNormalizerCdiExtension

use of org.jboss.as.ejb3.validator.EjbProxyNormalizerCdiExtension in project wildfly by wildfly.

the class HibernateValidatorDeploymentUnitProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
    final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
    final CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
    if (support.hasCapability(WELD_CAPABILITY_NAME) && support.hasCapability(BEAN_VALIDATION_CAPABILITY)) {
        try {
            final WeldCapability weldCapability = support.getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class);
            weldCapability.registerExtensionInstance(new EjbProxyNormalizerCdiExtension(), deploymentUnit);
        } catch (CapabilityServiceSupport.NoSuchCapabilityException e) {
            Assert.unreachableCode();
        }
    }
}
Also used : EjbProxyNormalizerCdiExtension(org.jboss.as.ejb3.validator.EjbProxyNormalizerCdiExtension) WeldCapability(org.jboss.as.weld.WeldCapability) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) CapabilityServiceSupport(org.jboss.as.controller.capability.CapabilityServiceSupport)

Aggregations

CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)1 EjbProxyNormalizerCdiExtension (org.jboss.as.ejb3.validator.EjbProxyNormalizerCdiExtension)1 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)1 WeldCapability (org.jboss.as.weld.WeldCapability)1