use of io.smallrye.faulttolerance.FaultToleranceExtension in project wildfly by wildfly.
the class MicroProfileFaultToleranceDeploymentProcessor method deploy.
@Override
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
if (!MicroProfileFaultToleranceMarker.isMarked(deploymentUnit)) {
return;
}
// Weld Extension
CapabilityServiceSupport support = deploymentUnit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT);
WeldCapability weldCapability;
try {
weldCapability = support.getCapabilityRuntimeAPI(Capabilities.WELD_CAPABILITY_NAME, WeldCapability.class);
} catch (CapabilityServiceSupport.NoSuchCapabilityException e) {
throw new IllegalStateException();
}
weldCapability.registerExtensionInstance(new FaultToleranceExtension(), deploymentUnit);
}
Aggregations