CAMEL-676 - intercept() - code changed a bit

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

CAMEL-676 - intercept() - code changed a bit

Claus Ibsen

We have changed the default behavior of intercept() to proceed() by default. This was the most logical assumption end-users will have that an interceptor will just divert the route for a while and continue on its original path. Eg. use the very common logging example that we have on the wiki page.

Hadrian was so kind to take up this task and code the changes. However I found a glitch that when you use predicates it failed to operate correctly.

I have fixed this but in this course I needed to change some unit tests that was operation on the old behavior.

Please give it a review. The code changes are primarily in InterceptType. Check out the commit mailing list.

Also CAMEL-675 is related as well.

PS: I was impressed with the Expression in Camel. IDEA debugger had good toString() representations of the processors so even I was able to figure out what was going on and (hopefully) how to fix it.

PPS: The code gets a bit hairy since the predicate test is negated and you need to insert proceed at the correct places (when and/or at the end) and also consider if there was a stop() appended.

PPPS: It's important that the unit tests test for both conditions on the predicates (true|false) to test the intercept thoroughly.

Med venlig hilsen

Claus Ibsen
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576