Search in sources :

Example 16 with WeldCapability

use of org.jboss.as.weld.WeldCapability in project wildfly by wildfly.

the class OpenTelemetrySubsystemDeploymentProcessor method deploy.

@Override
public void deploy(DeploymentPhaseContext deploymentPhaseContext) throws DeploymentUnitProcessingException {
    OTEL_LOGGER.processingDeployment();
    final DeploymentUnit deploymentUnit = deploymentPhaseContext.getDeploymentUnit();
    if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) {
        return;
    }
    try {
        final WeldCapability weldCapability = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT).getCapabilityRuntimeAPI(WELD_CAPABILITY_NAME, WeldCapability.class);
        if (!weldCapability.isPartOfWeldDeployment(deploymentUnit)) {
            // Jakarta RESTful Web Services require Jakarta Contexts and Dependency Injection. Without Jakarta
            // Contexts and Dependency Injection, there's no integration needed
            OTEL_LOGGER.noCdiDeployment();
            return;
        }
    } catch (CapabilityServiceSupport.NoSuchCapabilityException e) {
        // We should not be here since the subsystem depends on weld capability. Just in case ...
        throw OTEL_LOGGER.deploymentRequiresCapability(deploymentPhaseContext.getDeploymentUnit().getName(), WELD_CAPABILITY_NAME);
    }
    setupOtelCdiBeans(deploymentPhaseContext);
}
Also used : WeldCapability(org.jboss.as.weld.WeldCapability) DeploymentUnit(org.jboss.as.server.deployment.DeploymentUnit) CapabilityServiceSupport(org.jboss.as.controller.capability.CapabilityServiceSupport)

Aggregations

WeldCapability (org.jboss.as.weld.WeldCapability)16 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)15 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)13 ModuleSpecification (org.jboss.as.server.deployment.module.ModuleSpecification)5 ModuleLoader (org.jboss.modules.ModuleLoader)5 ModuleDependency (org.jboss.as.server.deployment.module.ModuleDependency)3 Module (org.jboss.modules.Module)3 ServiceName (org.jboss.msc.service.ServiceName)2 ServiceTarget (org.jboss.msc.service.ServiceTarget)2 FaultToleranceExtension (io.smallrye.faulttolerance.FaultToleranceExtension)1 BeanManager (javax.enterprise.inject.spi.BeanManager)1 DataSource (javax.sql.DataSource)1 JobRepository (org.jberet.repository.JobRepository)1 ArtifactFactory (org.jberet.spi.ArtifactFactory)1 ProcessStateNotifier (org.jboss.as.controller.ProcessStateNotifier)1 EEModuleDescription (org.jboss.as.ee.component.EEModuleDescription)1 EjbProxyNormalizerCdiExtension (org.jboss.as.ejb3.validator.EjbProxyNormalizerCdiExtension)1 BeanManagerAfterDeploymentValidation (org.jboss.as.jpa.beanmanager.BeanManagerAfterDeploymentValidation)1 NamespaceContextSelector (org.jboss.as.naming.context.NamespaceContextSelector)1 DeploymentUnitProcessingException (org.jboss.as.server.deployment.DeploymentUnitProcessingException)1