Interface MethodInterceptor

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface MethodInterceptor
Provides method interception logic that can be executed before, during, and after a method invocation.

MethodInterceptor instances are provided by AspectProvider.interceptor(Method, Annotation).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    invoke(Invocation invocation)
    Intercepts the method invocation.
  • Method Details

    • invoke

      void invoke(Invocation invocation) throws Throwable
      Intercepts the method invocation.

      If the interceptor wants to replace the result, it can be done via Invocation.result(Object).

      Parameters:
      invocation - The invocation being intercepted
      Throws:
      Throwable - If the interception or underlying invocation throws an exception