in safeguard-impl/src/main/java/org/apache/safeguard/impl/cdi/SafeguardExtension.java [132:150]
void activateSafeguard(@Observes @WithAnnotations({
/*Asynchronous.class, */
Bulkhead.class, CircuitBreaker.class,
Fallback.class, Retry.class, Timeout.class
}) final ProcessAnnotatedType<?> processAnnotatedType) {
if (processAnnotatedType.getAnnotatedType().getJavaClass().getName().startsWith("org.apache.safeguard.impl.")) {
return;
}
if (faultToleranceAnnotations().anyMatch(it -> processAnnotatedType.getAnnotatedType().isAnnotationPresent(it))) {
processAnnotatedType.configureAnnotatedType().add(SafeguardEnabled.Literal.INSTANCE);
} else {
final List<Method> methods = processAnnotatedType.getAnnotatedType().getMethods().stream()
.filter(it -> faultToleranceAnnotations().anyMatch(it::isAnnotationPresent))
.map(AnnotatedMethod::getJavaMember).collect(toList());
processAnnotatedType.configureAnnotatedType()
.filterMethods(it -> methods.contains(it.getJavaMember()))
.forEach(m -> m.add(SafeguardEnabled.Literal.INSTANCE));
}
}