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:
Post a Comment