In the official documentation it is claimed that the parent has to be an interface, yet in the example given it is a class (class UsageTracking). How comes?
https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aop-introductions
@Aspect
public class UsageTracking {
@DeclareParents(value="com.xzy.myapp.service.*+", defaultImpl=DefaultUsageTracked.class)
public static UsageTracked mixin;
@Before("com.xyz.myapp.CommonPointcuts.businessService() && this(usageTracked)")
public void recordUsage(UsageTracked usageTracked) {
usageTracked.incrementUseCount();
}
}
From the documentation example : https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#aop-introductions
UsageTracking
UsageTracked
DefaultUsageTracked
The example looks valid. The confusion here appears to be about the Aspect
class name and the interface name.