Package com.liferay.portal.kernel.aop
Class ChainableMethodAdvice
Object
com.liferay.portal.kernel.aop.ChainableMethodAdvice
Provides method advice to implement an aspect for services.
- Author:
- Shuyang Zhou, Brian Wing Shun Chan
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterReturning
(AopMethodInvocation aopMethodInvocation, Object[] arguments, Object result) protected void
afterThrowing
(AopMethodInvocation aopMethodInvocation, Object[] arguments, Throwable throwable) protected Object
before
(AopMethodInvocation aopMethodInvocation, Object[] arguments) abstract Object
createMethodContext
(Class<?> targetClass, Method method, Map<Class<? extends Annotation>, Annotation> annotations) Creates the context to be used when invoking this advice.protected void
duringFinally
(AopMethodInvocation aopMethodInvocation, Object[] arguments) invoke
(AopMethodInvocation aopMethodInvocation, Object[] arguments)
-
Field Details
-
nullResult
-
-
Constructor Details
-
ChainableMethodAdvice
public ChainableMethodAdvice()
-
-
Method Details
-
createMethodContext
public abstract Object createMethodContext(Class<?> targetClass, Method method, Map<Class<? extends Annotation>, Annotation> annotations) Creates the context to be used when invoking this advice. The context can be useful for caching information derived from reflective calls on the method. Returningnull
disables this advice for all invocations on the target class and method. The context object can be obtained by callingAopMethodInvocation.getAdviceMethodContext()
. The context should be immutable as it is reused by concurrent calls toinvoke(AopMethodInvocation, Object[])
.- Parameters:
targetClass
- the target class for the contextmethod
- the method for the contextannotations
- a map of the method's annotations- Returns:
- the context object for use during method invocations or
null
to disable this advice for the method
-
invoke
- Throws:
Throwable
-
afterReturning
protected void afterReturning(AopMethodInvocation aopMethodInvocation, Object[] arguments, Object result) throws Throwable - Throws:
Throwable
-
afterThrowing
protected void afterThrowing(AopMethodInvocation aopMethodInvocation, Object[] arguments, Throwable throwable) throws Throwable - Throws:
Throwable
-
before
protected Object before(AopMethodInvocation aopMethodInvocation, Object[] arguments) throws Throwable - Throws:
Throwable
-
duringFinally
-