Grokking Spring Boot
Vote

0% completed

​

Aspects and Pointcuts

@Before("bookingCalls() && args(email, request)") public void before(String email, Object request) { log.info("before: {} asks for {}", email, request); }

When a test called BookingService.book for Ana, the log showed this line before the method body ran.

before: ana@example.com asks for BookingRequest[eventId=7, seatLabel=A12]

BookingService contains no logging call, and nothing in BookingService refers to the method above. The line appeared because Spring placed a proxy in front of BookingService and ran this method on the way in

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content