Spring AOP what is not jointpoint

246 views Asked by At

I need some information about Spring AOP jointpoint. I have read the below in Stackoverflow which explains the difference between jointpoint and pointcut. As per that joint is "A joinpoint is a candidate point in the execution of the application where an aspect can be plugged in. This point could be a method being called, an exception being thrown, or even a field being modified. These are the points where your aspect’s code can be inserted into the normal flow of your application to add new behavior."

After reading this to me it looks like every method and field in a class could be a jointpoint. Is there anything which couldn't be a jointput and hence advice couldn't be applied.

Spring AOP: What's the difference between JoinPoint and PointCut?

1

There are 1 answers

0
pklndnst On

As for the difference between 'jointpoint' and 'pointcut' you're right so far. A jointpoint is every spot in your code where an aspect might be woven in, whereas a pointcut matches a concrete aspect definition.Acoording to the Spring Documentation, every method of a bean could be defined as a pointcut. Consider that using Spring AOP the definition of pointcuts is limited to method calls. If you're searching for something that supports more sophisticated AOP logic, you may take a look at AspectJ. With AspectJ you're able to choose for example instance beans as pointcuts.