public abstract class ChainableMethodAdvice
extends Object
Modifier and Type | Field and Description |
---|---|
protected static Object |
nullResult |
Constructor and Description |
---|
ChainableMethodAdvice() |
Modifier and Type | Method and Description |
---|---|
protected 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) |
Object |
invoke(AopMethodInvocation aopMethodInvocation,
Object[] arguments) |
public abstract Object createMethodContext(Class<?> targetClass, Method method, Map<Class<? extends Annotation>,Annotation> annotations)
null
disables this advice for all
invocations on the target class and method. The context object can be
obtained by calling AopMethodInvocation.getAdviceMethodContext()
.
The context should be immutable as it is reused by concurrent calls to
invoke(AopMethodInvocation, Object[])
.targetClass
- the target class for the contextmethod
- the method for the contextannotations
- a map of the method's annotationsnull
to disable this advice for the methodpublic Object invoke(AopMethodInvocation aopMethodInvocation, Object[] arguments) throws Throwable
Throwable
protected void afterReturning(AopMethodInvocation aopMethodInvocation, Object[] arguments, Object result) throws Throwable
Throwable
protected void afterThrowing(AopMethodInvocation aopMethodInvocation, Object[] arguments, Throwable throwable) throws Throwable
Throwable
protected Object before(AopMethodInvocation aopMethodInvocation, Object[] arguments) throws Throwable
Throwable
protected void duringFinally(AopMethodInvocation aopMethodInvocation, Object[] arguments)