My Personal Spring AOP notes
advice -
a method that is called in a Spring classic AOP process.- MethodBeforeAdvice - must implement the method before(Method method, Object[] args, Object target) throws Throwable on the proxy object before calling the actual object's method.
- AfterReturnAdvice - must implement the method afterReturning(Object returnValue, Method method, Object[] args, Object target) throws Throwable on the proxy object after calling the actual object's method.
- ThrowingAdvice - invoked when an exception defined in the method implementation of this interface is being thrown. The interface did not declare any method but to implement this advice, the method must match either afterThrowing( e) or afterThrowing(Method method, Object[] args, Object target).
pointcut -
if we want to advise only some of the methods in an interface, the methods are called pointcuts. Advises will be applied only on these specific methods.
No comments:
Post a Comment