Skip to Content
Java 9 Dependency Injection
book

Java 9 Dependency Injection

by Nilang Patel, Krunal Patel
April 2018
Intermediate to advanced content levelIntermediate to advanced
246 pages
6h 11m
English
Packt Publishing
Content preview from Java 9 Dependency Injection

@AspectJ annotation-based Spring AOP

Spring allows another way to support AOP through the @AspectJ annotation. It's an alternative to XML-based configuration to define the aspect using regular Java classes with AOP-specific annotation. Spring introduced the @AspectJ style as a part of the AspectJ 5 release. Though with @AspectJ, Spring facilitates same annotation like AspectJ 5, the underlying framework is pure Spring AOP. Due to this arrangement, there is no dependency on AspectJ compiler or weaver.

To use @AspectJ annotation for Spring AOP, you need to enable its support in Spring through configuration and turn auto-proxy on. Autoproxying is a mechanism to create a proxy on the object of a Spring bean on which one or more aspects are woven. ...

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.
Start your free trial

You might also like

Pro CDI 2 in Java EE 8: An In-Depth Guide to Context and Dependency Injection

Pro CDI 2 in Java EE 8: An In-Depth Guide to Context and Dependency Injection

Jan Beernink, Arjan Tijms
Dependency Injection

Dependency Injection

Dhananjay Prasanna

Publisher Resources

ISBN: 9781788296250Supplemental Content