Class Invocation<V>

java.lang.Object
io.helidon.inject.runtime.Invocation<V>
Type Parameters:
V - the invocation type
All Implemented Interfaces:
Interceptor.Chain<V>

public class Invocation<V> extends Object implements Interceptor.Chain<V>
Handles the invocation of Interceptor methods. Note that upon a successful call to the Interceptor.Chain.proceed(Object[]) or to the ultimate target, the invocation will be prevented from being executed again.
See Also:
  • InvocationContext
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createInvokeAndSupply

      public static <V> V createInvokeAndSupply(io.helidon.inject.api.InvocationContext ctx, Function<Object[],V> call, Object[] args)
      Creates an instance of Invocation and invokes it in this context.
      Type Parameters:
      V - the type returned from the method element
      Parameters:
      ctx - the invocation context
      call - the call to the base service provider's method
      args - the call arguments
      Returns:
      the invocation instance
      Throws:
      InvocationException - if there are errors during invocation chain processing
    • mergeAndCollapse

      @Deprecated public static <T> List<Provider<T>> mergeAndCollapse()
      Deprecated.
      this method should only be called by generated code
      The degenerate case for mergeAndCollapse(List[]). This is here only to eliminate the unchecked varargs compiler warnings that would otherwise be issued in code that does not have any interceptors on a method.
      Type Parameters:
      T - the type of the provider
      Returns:
      an empty list
    • mergeAndCollapse

      public static <T> List<Provider<T>> mergeAndCollapse(List<Provider<T>>... lists)
      Merges a variable number of lists together, where the net result is the merged set of non-null providers ranked in proper weight order, or else empty list.
      Type Parameters:
      T - the type of the provider
      Parameters:
      lists - the lists to merge
      Returns:
      the merged result or empty list if there is o interceptor providers
    • proceed

      public V proceed(Object... args)
      Description copied from interface: Interceptor.Chain
      Call the next interceptor in line, or finishing with the call to the service provider being intercepted. Note that that arguments are passed by reference to each interceptor ultimately leading up to the final call to the underlying intercepted target. Callers can mutate the arguments passed directly on the provided array instance.
      Specified by:
      proceed in interface Interceptor.Chain<V>
      Parameters:
      args - the arguments passed
      Returns:
      the result of the call