AOP execution flow
In our security checker example, without applying the @SecurityCheck annotation to the MessageService.save() method, the code execution flows directly from the MessageController.saveMessage() method to the MessageService.save() method. After applying the @SecurityCheck annotation, during runtime, the code execution flows from the MessageController.saveMessage() method to the AOP proxy object that Spring AOP creates. In our example, MessageService doesn't implement any interface, so the AOP proxy object is an instance of the MessageService subclass that Spring AOP creates with CGLIB. From the AOP proxy object, the execution flows to the checkSecurity() advisor. Inside the advisor, the MessageService.save() target method ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access