Spring AOP or AspectJ or Spring with AspectJ - spring

Difference between Spring AOP, AspectJ and Spring AOP with Annotation?
Here is my understanding:
Spring AOP means Springs Aspect oriented programming with xml based configurations.
AspectJ means its another AOP implementation which is not spring based, if we want to use it then we need to include some third party jars apart from spring.
Spring AOP annotation means spring uses AspectJ annotations to provide AOP feature.
are these fair assumptions?

Yes, that's right. Spring AOP have a limited options on AOP. The constructor and fields cant be intercepted with Spring AOP but it can be done using AspectJ.
Spring AOP also requires few AspectJ libries, like AspectJ weaving etc..
You can refer the link for more details.
Spring AOP vs AspectJ

Related

Does Quarkus have a Spring AOP analogue?

Does Quarkus have a Spring AOP analogue? What could I use instead of Spring AOP on Quarkus?
Thank you!
Quarkus uses CDI as a dependency injection mechanism, CDI provides interceptors that can be use to implement the same functionalities as AOP provides.
What you need to do is define an annotation, annotate the method you want to intercept with this annotation then define an interceptor bind to this annotation.
This is described here: https://quarkus.io/guides/cdi#interceptors and you can find more information on interceptors here: https://docs.jboss.org/weld/reference/latest/en-US/html/interceptors.html

aspectj annotation not working with flink [duplicate]

I am writing Spring 4 application with java config. I can use AOP in this project for all spring component. But i can't use it for a normal POJO class.
what is the library I need to add and what is the configuration I need to put in my config file to get this working
Spring AOP can only be applied to Spring-managed components/beans, not to non-Spring POJOs.
If you want to apply AOP to non-Spring classes you need AspectJ, not a proxy-based "AOP lite" framework like Spring AOP. For more information about how to use AspectJ (which does not need Spring at all) in combination with Spring and how to configure load-time weaving, please read the corresponding part of the Spring manual.

Spring vs JAX-RS

Here, several questions have been asked by many developers about difference between Spring-Rest and JAX-RS.
And, I have also learned that Spring is not following any specification and Spring framework has their own implementation then
Why Spring allows all that Annotations which are supported/used by JAX-RS by default?
Spring does not support JAX-RS annotations. If there is a situation where you think they do, then you are mistaken or it's just a coincidence. Period. If you will add any JAX-RS annotations in my Spring MVC program, nothing will happen. Annotations are just metadata. They are not programs. If Spring does not recognize the metadata, it will ignore it. But if you use a JAX-RS annotation in place of a Spring annotation that is used for the same purpose, respective of their framework, then you will not get the expected Spring behavior. So basically, if you are using Spring MVC, remove any JAX-RS dependencies so you don't mistakenly use them.

AspectJ with Spring framework

I have a question. Is it possible to inject spring bean into pure AspectJ project ( Let say we don't use Spring AOP, because of its limitations. We need to advice some static methods. )
And use those spring beans in AspectJ advices. Could we use CTW or LTW?

Spring AOP for non spring component

I am writing Spring 4 application with java config. I can use AOP in this project for all spring component. But i can't use it for a normal POJO class.
what is the library I need to add and what is the configuration I need to put in my config file to get this working
Spring AOP can only be applied to Spring-managed components/beans, not to non-Spring POJOs.
If you want to apply AOP to non-Spring classes you need AspectJ, not a proxy-based "AOP lite" framework like Spring AOP. For more information about how to use AspectJ (which does not need Spring at all) in combination with Spring and how to configure load-time weaving, please read the corresponding part of the Spring manual.

Resources