Compile / load time with spring

docs explain that LTW should be enabled either with the <context:load-time-weaver/>xml command or with the @EnableLoadTimeWeavingannotation. However, I did not do either, but I still see that the aspects are correctly intertwined in my projects!

  • In this case, I don’t think they were woven at compile time (but are they?), So of course it was load time?
  • Even if in this case, how does it automatically select aspects during the boot process? Should aspects not remain unaffected if they are not included using one of the methods mentioned above, as the docs say?
  • I have an asta weaver on my way to classes, but this may not be enough to choose any of these types of weaving, right?
+4
source share
1 answer

Spring AOP does not rely on AspectJ byte code encoding. It simply borrows the annotations used to define aspects of the AspectJ project. This is a separately implemented framework that uses proxy servers at runtime to implement aspects. If you have it <aop:aspectj-autoproxy />in the context of your application, then spring uses a proxy to implement the supported aspects defined on beans that are in the container.

AspectJ, , . :

  • ( )
  • public (private/protected )
  • ( this super)

, , , Native AspectJ.

+5

Source: https://habr.com/ru/post/1524640/


All Articles