While using @Around aspect and Spring boot. What would be the best approach to create a variable before joinPoint execution, make it available during joinPoint execution to collect data in it and after joinPoint execution use the data collected in variable?
Assuming it is a multithreaded environment.
@Aspect
@EnableAspectJAutoProxy
public class SomeConfig {
@Around(value = "@annotation(path.to.my.annotation.here)", argNames = "specificArg")
public void doLogic(ProceedingJoinPoint joinPoint) throws Throwable {
//create local variable X for thread execution here
try{
joinPoint.proceed(); //or joinPoint.proceed(Object[]);
}
finally {
//use local variable X to do some logic
}
}
}
Don't want to change method signatures using custom annotation.
Any design pattern, or implementation example would help alot. Thanks!