Hands-On High Performance with Spring 5
by Chintan Mehta, Subhash Shah, Pritesh Shah, Prashant Goswami, Dinesh Radadiya
AspectJ with Spring
Spring provides small libraries to enable AspectJ aspects into Spring projects. This library is named spring-aspects.jar. As we know from our earlier discussion, Spring allows dependency injection or AOP advice only on Spring bean. With Spring's AspectJ support using this small library, we can enable any object created outside the container for Spring-driven configuration. Just annotate the outside object with @Configurable. Annotating a non-Spring bean with @Configurable would require AnnotationBeanConfigurerAspect in spring-aspects.jar. The AnnotationBeanConfigurerAspect configuration needed by Spring can be done by annotating our configuration Java configuration class with @EnableSpringConfigured.
Spring provides a ...
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