Interface MethodInterceptor
-
- All Known Implementing Classes:
DefaultMethodInvokingInterceptor
public interface MethodInterceptor
Intercepts calls on an interface on its way to the target. These are nested "on top" of the target.Implementing classes are required to implement the
invoke(MethodInvocation)
method to modify the original behavior.- Since:
- 5.0
- Author:
- Mark Paluch
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Object
invoke(MethodInvocation invocation)
Implement this method to perform extra treatments before and after the invocation.
-
-
-
Method Detail
-
invoke
Object invoke(MethodInvocation invocation) throws Throwable
Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeMethodInvocation.proceed()
.- Parameters:
invocation
- the method invocation- Returns:
- the result of the call to
MethodInvocation.proceed()
, might be intercepted by the interceptor. - Throws:
Throwable
- if the interceptors or the target-object throws an exception.
-
-