Notes: Spring: AOP: 1

Ref: Spring documentation
Spring framework supports AspectJ annotations
○ No dependency on AspectJ compiler or weaver. However, their use enables us to use full support of AspectJ. What do I mean by full support?

Enabling AspectJ support
○ The @AspectJ support is enabled by including the following element inside your spring configuration:
§ Which schema is needed for this?
○ Also include two AspectJ jars:
§ aspectjrt.jar
§ aspectjweaver.jar

Declaring and Aspect
○ Declare the bean in XML
○ Annotate the class with @Aspect

○ Aspects (classes annotated with @Aspect) may have methods and fields just like any other class. They may also contain pointcut, advice, and introduction (inter-type) declarations.
○ @Aspects are excluded from auto-proxying. So in Spring we cannot advise aspect themselves with other aspects.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s