Welcome Message

Hi, welcome to my website. This is a place where you can get all the questions, puzzles, algorithms asked in interviews and their solutions. Feel free to contact me if you have any queries / suggestions and please leave your valuable comments.. Thanks for visiting -Pragya.

June 11, 2010

Advice in Spring AOP

Advice contains the logic of your aspect. So,when you create an advice object, you are writing the code that implements the
cross-cutting functionality. Also, remember that Spring’s joinpoint model is built
around method interception. This means that the Spring advice you write will be
woven into your application at different points around a method’s invocation.
Because there are several points during the execution of a method that Spring
can weave in advice, there are several different advice types.

Advice type Interface Description
Around org.aopalliance.intercept.MethodInterceptor Intercepts calls to the target
method
Before org.springframework.aop.BeforeAdvice Called before the target
method is invoked
After org.springframework.aop.AfterReturningAdvice Called after the target
method returns
Throws org.springframework.aop.ThrowsAdvice Called when target
method throws an
exception

No comments: