Interface Invocation

All Known Implementing Classes:
Invocation.Base, Invocation.Call, Invocation.Run

public interface Invocation
Method invocation using in MethodInterceptor.invoke(Invocation) for Aspects.

Represents a method invocation that can be intercepted with additional before and after invocation logic.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Invocation base type for both callable and runnable methods.
    static final class 
    Callable based Invocation with checked exceptions.
    static interface 
    Runnable with checked exceptions.
    static interface 
    Callable with checked exceptions.
    static final class 
    Runnable based Invocation.
  • Method Summary

    Modifier and Type
    Method
    Description
    Return the arguments used for this invocation.
    Return the arguments additionally appending the throwable.
    Return the 'this' instance of the invocation.
    Invoke the underlying method returning the result.
    default Object
    Invoke the underlying method returning the result.
    Return the method being called for this invocation.
    void
    result(Object result)
    Set the result that will be returned to the caller.
  • Method Details

    • invoke

      Invoke the underlying method returning the result.
      Returns:
      The result of the method call. This will return null for void methods.
      Throws:
      Throwable - Exception thrown by underlying method
    • invokeUnchecked

      Invoke the underlying method returning the result. Checked exceptions will be caught and rethrown as InvocationExceptions.
      Returns:
      The result of the method call. This will return null for void methods.
    • result

      void result(Object result)
      Set the result that will be returned to the caller.

      This will replace a prior result set by calling #invoke or can be used to provide a result allowing to skip calling #invoke altogether.

      Parameters:
      result - The result that will be returned to the caller.
    • arguments

      Return the arguments used for this invocation.
    • arguments

      Return the arguments additionally appending the throwable.
    • method

      Return the method being called for this invocation.
    • instance

      Return the 'this' instance of the invocation.

      This is typically used when invoking fallback/recovery methods.