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);
}
Aggregations