Interface InterceptorHandler
-
public interface InterceptorHandler
The hook used to implement an interceptor. It can be associated to aIntercepts
marker. IMPORTANT: if you want a delegate instance you have to provide a constructor taking an object as parameter. Alternatively you can use a BiFunction<Method, Object[], Object> constructor parameter to be able to delegate the invocation. Else you must provide a default constructor. NOTE: if your interceptor doesn't take an invoker as parameter (java.util.function.BiFunction<Method, Object[], Object>) then the interceptor chain can be broken if you invoke yourself a method. It is recommended to respect it.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T extends Annotation>
Optional<T>findAnnotation(Method method, Class<T> type)
Object
invoke(Method method, Object[] args)
Called instead of the delegate method.
-
-
-
Method Detail
-
invoke
Object invoke(Method method, Object[] args)
Called instead of the delegate method.- Parameters:
method
- th emethod being invoked.args
- the parameters of the method.- Returns:
- the returned value of the method.
-
findAnnotation
default <T extends Annotation> Optional<T> findAnnotation(Method method, Class<T> type)
-
-