May 2015
Intermediate to advanced
234 pages
4h 18m
English
An introduction allows us to make a Java class (we will refer to it as the target class) implement an interface at runtime. With Spring AOP, introductions can be applied only to Spring beans (controllers, services, and so on). In this recipe, we will create an interface, its implementation, and make a Spring controller implement that interface at runtime using that implementation. To check whether it's working, we will also add a before advice to the controller method to execute a method from the interface implementation.
We will use the aspect class defined in the Creating a Spring AOP aspect class recipe.
Here are the steps for using an introduction: ...
Read now
Unlock full access