Using target

The target keyword is used to match the join points where the target object is an interface of the specified type. It is used when Spring AOP uses JDK-based proxy creation. target is used only if the target object implements an interface. The developers can even configure the proxy target class property set to true.

Let's consider the following example to understand the use of this and target in expression:

package com.packt.ch04; 
Class MyClass implements MyInterface{ 
  // method declaration 
} 

We can write the expression to target the methods as follows:

target(com.packt.ch04.MyInterface) or this(com.packt.ch04.MyClass)

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.116.159