davsclaus commented on code in PR #29387:
URL: https://github.com/apache/camel/pull/29387#discussion_r4503553731
##########
components/camel-chaos/src/main/java/org/apache/camel/component/chaos/ChaosTargets.java:
##########
@@ -89,6 +110,169 @@ private static String checkEndpoints(CamelContext
camelContext, ChaosRule rule)
return null;
}
+ /**
+ * The hooks of the rule that can fire in the context now, for the list
and the report: of the hooks of an
+ * {@code endpoint=} or {@code component=} rule, {@code poll} only when a
route that consumes a matching endpoint
+ * polls on a schedule ({@link ScheduledPollConsumer}), and {@code send}
(and {@code reply}, the reply of a send)
+ * only when something sends to a matching endpoint. A hook where the rule
fired already can fire, whatever the
+ * context has now. The other hooks, and the hooks of the other targets,
are those of the rule.
+ */
+ static Set<Hook> hooksThatCanFire(Reach reach, ChaosRule rule) {
+ if (rule.target != ChaosRule.Target.ENDPOINT && rule.target !=
ChaosRule.Target.COMPONENT
+ || rule.lifecycle != null || reach == null) {
Review Comment:
Done in 81fa3200ebb9: the parentheses are added.
_Claude Code on behalf of Claus Ibsen_
##########
components/camel-chaos/src/main/java/org/apache/camel/component/chaos/ChaosTargets.java:
##########
@@ -89,6 +110,169 @@ private static String checkEndpoints(CamelContext
camelContext, ChaosRule rule)
return null;
}
+ /**
+ * The hooks of the rule that can fire in the context now, for the list
and the report: of the hooks of an
+ * {@code endpoint=} or {@code component=} rule, {@code poll} only when a
route that consumes a matching endpoint
+ * polls on a schedule ({@link ScheduledPollConsumer}), and {@code send}
(and {@code reply}, the reply of a send)
+ * only when something sends to a matching endpoint. A hook where the rule
fired already can fire, whatever the
+ * context has now. The other hooks, and the hooks of the other targets,
are those of the rule.
+ */
+ static Set<Hook> hooksThatCanFire(Reach reach, ChaosRule rule) {
+ if (rule.target != ChaosRule.Target.ENDPOINT && rule.target !=
ChaosRule.Target.COMPONENT
+ || rule.lifecycle != null || reach == null) {
Review Comment:
Same as the thread above, done in 81fa3200ebb9.
_Claude Code on behalf of Claus Ibsen_
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]