From the course: Spring: Framework in Depth
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Implement AOP advice: After
- [Instructor] So we've seen executions through advice that occurred before the join point. Let's take a look at the execution that occurs after the join point. So in our logging aspect class, we are going to change the before to an after, but it's not just after. It's after returning, and we'll talk a little bit about that here in a moment, but it's important to note that there's after returning and after throwing. So we will add to this a return value. So this would be returning, and it will be return value, and that is an object that gets returned to this method. So now we have access to both the join point, so the data of the method, plus what the method returned. After we've done our appending of our message let's put a little bit more data in here. So if return value is an instance of a collection, we want to do message dot append, we'll do comma returning. I'm going to bring in this collection here real quick as an…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
Aspecting in Spring4m 51s
-
(Locked)
Define aspect-oriented programming (AOP) pointcuts6m 6s
-
(Locked)
Implement AOP advice: Before5m 9s
-
(Locked)
Implement AOP advice: After2m 40s
-
(Locked)
Implement AOP advice: Around4m 40s
-
(Locked)
Challenge: Building your own aspect53s
-
(Locked)
Solution: Building your own aspect2m 41s
-
-