overview

Overview of Hutool-aop

The AOP module mainly aims at encapsulating dynamic proxy in JDK, abstracting dynamic proxy as the aspect class Aspect, and fusing the aspect object and the proxy object through the proxy tool class ProxyUtil, thereby performing generic functionality before and after each method execution.

In the aop module, there are two default aspect objects that can be implemented:

  1. SimpleAspect: a simple aspect object that does not perform any operations. By inheriting this object, you can override the methods you need without having to implement all methods.
  2. TimeIntervalAspect: an aspect object for executing time, used for simply calculating the method execution time and then logging and printing the method execution time.

Due to the fact that the module encapsulates JDK’s proxy, the proxy object must implement an interface.